Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove vscodetask and vscodelaunch, deprecate project.github #349

Merged
merged 5 commits into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
415 changes: 27 additions & 388 deletions crds/workspace.devfile.io_devworkspaces.v1beta1.yaml

Large diffs are not rendered by default.

415 changes: 27 additions & 388 deletions crds/workspace.devfile.io_devworkspaces.yaml

Large diffs are not rendered by default.

404 changes: 26 additions & 378 deletions crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml

Large diffs are not rendered by default.

404 changes: 26 additions & 378 deletions crds/workspace.devfile.io_devworkspacetemplates.yaml

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions pkg/apis/workspaces/v1alpha1/attributes_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ func getCommandAttributes(command *Command) map[string]string {
return command.Exec.Attributes
case command.Apply != nil:
return command.Apply.Attributes
case command.VscodeTask != nil:
return command.VscodeTask.Attributes
case command.VscodeLaunch != nil:
return command.VscodeLaunch.Attributes
case command.Composite != nil:
return command.Composite.Attributes
case command.Custom != nil:
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/workspaces/v1alpha1/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,14 @@ type Command struct {
Apply *ApplyCommand `json:"apply,omitempty"`

// Command providing the definition of a VsCode Task
//
// Deprecated; removed in v1alpha2
// +optional
VscodeTask *VscodeConfigurationCommand `json:"vscodeTask,omitempty"`

// Command providing the definition of a VsCode launch action
//
// Deprecated; removed in v1alpha2
// +optional
VscodeLaunch *VscodeConfigurationCommand `json:"vscodeLaunch,omitempty"`

Expand Down
10 changes: 0 additions & 10 deletions pkg/apis/workspaces/v1alpha1/commands_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ func convertCommandTo_v1alpha2(src *Command, dest *v1alpha2.Command) error {
srcAttributes = src.Exec.Attributes
case src.Apply != nil:
srcAttributes = src.Apply.Attributes
case src.VscodeTask != nil:
srcAttributes = src.VscodeTask.Attributes
case src.VscodeLaunch != nil:
srcAttributes = src.VscodeLaunch.Attributes
case src.Composite != nil:
srcAttributes = src.Composite.Attributes
case src.Custom != nil:
Expand Down Expand Up @@ -76,12 +72,6 @@ func convertCommandFrom_v1alpha2(src *v1alpha2.Command, dest *Command) error {
case dest.Exec != nil:
dest.Exec.Attributes = destAttributes
dest.Exec.Id = id
case dest.VscodeLaunch != nil:
dest.VscodeLaunch.Attributes = destAttributes
dest.VscodeLaunch.Id = id
case dest.VscodeTask != nil:
dest.VscodeTask.Attributes = destAttributes
dest.VscodeTask.Id = id
}
return err
}
18 changes: 2 additions & 16 deletions pkg/apis/workspaces/v1alpha1/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var componentFuzzFunc = func(component *Component, c fuzz.Continue) {
}

var commandFuzzFunc = func(command *Command, c fuzz.Continue) {
switch c.Intn(6) {
switch c.Intn(4) {
case 0:
c.Fuzz(&command.Apply)
case 1:
Expand All @@ -49,10 +49,6 @@ var commandFuzzFunc = func(command *Command, c fuzz.Continue) {
c.Fuzz(&command.Custom)
case 3:
c.Fuzz(&command.Exec)
case 4:
c.Fuzz(&command.VscodeLaunch)
case 5:
c.Fuzz(&command.VscodeTask)
}
}

Expand Down Expand Up @@ -130,7 +126,7 @@ var parentComponentFuzzFunc = func(component *Component, c fuzz.Continue) {
var parentCommandFuzzFunc = func(command *Command, c fuzz.Continue) {
// Do not generate Custom commands for Parents
// Also: commands in Parents cannot have attributes.
switch c.Intn(5) {
switch c.Intn(3) {
case 0:
c.Fuzz(&command.Apply)
if command.Apply != nil {
Expand All @@ -146,16 +142,6 @@ var parentCommandFuzzFunc = func(command *Command, c fuzz.Continue) {
if command.Exec != nil {
command.Exec.Attributes = nil
}
case 3:
c.Fuzz(&command.VscodeLaunch)
if command.VscodeLaunch != nil {
command.VscodeLaunch.Attributes = nil
}
case 4:
c.Fuzz(&command.VscodeTask)
if command.VscodeTask != nil {
command.VscodeTask.Attributes = nil
}
}
}

Expand Down
4 changes: 0 additions & 4 deletions pkg/apis/workspaces/v1alpha1/parent_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,6 @@ func convertParentCommandFrom_v1alpha2(src *v1alpha2.CommandParentOverride, dest
dest.Composite.Id = srcId
case src.Exec != nil:
dest.Exec.Id = srcId
case src.VscodeLaunch != nil:
dest.VscodeLaunch.Id = srcId
case src.VscodeTask != nil:
dest.VscodeTask.Id = srcId
}
return nil
}
Expand Down
4 changes: 0 additions & 4 deletions pkg/apis/workspaces/v1alpha1/plugin_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,6 @@ func convertPluginComponentCommandFrom_v1alpha2(src *v1alpha2.CommandPluginOverr
dest.Composite.Id = srcId
case src.Exec != nil:
dest.Exec.Id = srcId
case src.VscodeLaunch != nil:
dest.VscodeLaunch.Id = srcId
case src.VscodeTask != nil:
dest.VscodeTask.Id = srcId
}
return nil
}
Expand Down
54 changes: 5 additions & 49 deletions pkg/apis/workspaces/v1alpha2/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ import (

// CommandType describes the type of command.
// Only one of the following command type may be specified.
// +kubebuilder:validation:Enum=Exec;Apply;VscodeTask;VscodeLaunch;Composite;Custom
// +kubebuilder:validation:Enum=Exec;Apply;Composite;Custom
type CommandType string

const (
ExecCommandType CommandType = "Exec"
ApplyCommandType CommandType = "Apply"
VscodeTaskCommandType CommandType = "VscodeTask"
VscodeLaunchCommandType CommandType = "VscodeLaunch"
CompositeCommandType CommandType = "Composite"
CustomCommandType CommandType = "Custom"
ExecCommandType CommandType = "Exec"
ApplyCommandType CommandType = "Apply"
CompositeCommandType CommandType = "Composite"
CustomCommandType CommandType = "Custom"
)

// CommandGroupKind describes the kind of command group.
Expand Down Expand Up @@ -92,14 +90,6 @@ type CommandUnion struct {
// +optional
Apply *ApplyCommand `json:"apply,omitempty"`

// Command providing the definition of a VsCode Task
// +optional
VscodeTask *VscodeConfigurationCommand `json:"vscodeTask,omitempty"`

// Command providing the definition of a VsCode launch action
// +optional
VscodeLaunch *VscodeConfigurationCommand `json:"vscodeLaunch,omitempty"`

// Composite command that allows executing several sub-commands
// either sequentially or concurrently
// +optional
Expand Down Expand Up @@ -173,40 +163,6 @@ type CompositeCommand struct {
Parallel bool `json:"parallel,omitempty"`
}

// VscodeConfigurationCommandLocationType describes the type of
// the location the configuration is fetched from.
// Only one of the following component type may be specified.
// +kubebuilder:validation:Enum=Uri;Inlined
type VscodeConfigurationCommandLocationType string

const (
UriVscodeConfigurationCommandLocationType VscodeConfigurationCommandLocationType = "Uri"
InlinedVscodeConfigurationCommandLocationType VscodeConfigurationCommandLocationType = "Inlined"
)

// +union
type VscodeConfigurationCommandLocation struct {
// Type of Vscode configuration command location
// +
// +unionDiscriminator
// +optional
LocationType VscodeConfigurationCommandLocationType `json:"locationType,omitempty"`

// Location as an absolute of relative URI
// the VsCode configuration will be fetched from
// +optional
Uri string `json:"uri,omitempty"`

// Inlined content of the VsCode configuration
// +optional
Inlined string `json:"inlined,omitempty"`
}

type VscodeConfigurationCommand struct {
BaseCommand `json:",inline"`
VscodeConfigurationCommandLocation `json:",inline"`
}

type CustomCommand struct {
LabeledCommand `json:",inline"`

Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/workspaces/v1alpha2/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ type ProjectSource struct {
// +optional
Git *GitProjectSource `json:"git,omitempty"`

// Project's GitHub source
// Project's GitHub source. Deprecated, use `Git` instead
// +optional
Github *GithubProjectSource `json:"github,omitempty"`

Expand Down
Loading