diff --git a/pipeline/frontend/yaml/parse.go b/pipeline/frontend/yaml/parse.go index 78457dad7..eaba5946d 100644 --- a/pipeline/frontend/yaml/parse.go +++ b/pipeline/frontend/yaml/parse.go @@ -15,12 +15,9 @@ package yaml import ( - "fmt" - "codeberg.org/6543/xyaml" "github.com/woodpecker-ci/woodpecker/pipeline/frontend/yaml/types" - "github.com/woodpecker-ci/woodpecker/pipeline/frontend/yaml/types/base" ) // ParseBytes parses the configuration from bytes b. @@ -31,27 +28,6 @@ func ParseBytes(b []byte) (*types.Workflow, error) { return nil, err } - // fail hard on deprecated branch filter - if out.BranchesDontUseIt != nil { - return nil, fmt.Errorf("\"branches:\" filter got removed, use \"branch\" in global when filter instead") - } - - // fail hard on deprecated pipeline keyword - if len(out.PipelineDontUseIt.ContainerList) != 0 { - return nil, fmt.Errorf("\"pipeline:\" got removed, use \"steps:\" instead") - } - - // support deprecated platform filter - if out.PlatformDontUseIt != "" { - if out.Labels == nil { - out.Labels = make(base.SliceOrMap) - } - if _, set := out.Labels["platform"]; !set { - out.Labels["platform"] = out.PlatformDontUseIt - } - out.PlatformDontUseIt = "" - } - return out, nil } diff --git a/pipeline/frontend/yaml/parse_test.go b/pipeline/frontend/yaml/parse_test.go index da5d75821..cdb18e7e8 100644 --- a/pipeline/frontend/yaml/parse_test.go +++ b/pipeline/frontend/yaml/parse_test.go @@ -18,7 +18,6 @@ import ( "testing" "github.com/franela/goblin" - "github.com/stretchr/testify/assert" "github.com/woodpecker-ci/woodpecker/pipeline/frontend/metadata" yaml_base_types "github.com/woodpecker-ci/woodpecker/pipeline/frontend/yaml/types/base" @@ -138,42 +137,6 @@ func TestParse(t *testing.T) { }) } -func TestParseLegacy(t *testing.T) { - sampleYamlPipelineLegacy := ` -platform: linux/amd64 - -steps: - say hello: - image: bash - commands: echo hello -` - - sampleYamlPipelineLegacyIgnore := ` -platform: windows/amd64 -labels: - platform: linux/amd64 - -steps: - say hello: - image: bash - commands: echo hello -` - - workflow1, err := ParseString(sampleYamlPipelineLegacy) - if !assert.NoError(t, err) { - t.Fail() - } - - workflow2, err := ParseString(sampleYamlPipelineLegacyIgnore) - if !assert.NoError(t, err) { - t.Fail() - } - - assert.EqualValues(t, workflow1, workflow2) - assert.Len(t, workflow1.Steps.ContainerList, 1) - assert.EqualValues(t, "say hello", workflow1.Steps.ContainerList[0].Name) -} - var sampleYaml = ` image: hello-world when: diff --git a/pipeline/frontend/yaml/types/workflow.go b/pipeline/frontend/yaml/types/workflow.go index fd3afcf92..eda777df8 100644 --- a/pipeline/frontend/yaml/types/workflow.go +++ b/pipeline/frontend/yaml/types/workflow.go @@ -36,13 +36,6 @@ type ( Cache base.StringOrSlice `yaml:"cache,omitempty"` Networks WorkflowNetworks `yaml:"networks,omitempty"` Volumes WorkflowVolumes `yaml:"volumes,omitempty"` - - // Deprecated - PlatformDontUseIt string `yaml:"platform,omitempty"` // TODO: remove after v1.2.x version - // Deprecated - BranchesDontUseIt *constraint.List `yaml:"branches,omitempty"` // TODO: remove after v1.1.x version - // Deprecated - PipelineDontUseIt ContainerList `yaml:"pipeline,omitempty"` // TODO: remove after v1.1.x version } // Workspace defines a pipeline workspace.