diff --git a/pkg/lint/rules.go b/pkg/lint/rules.go index 834c3dd7..b6306862 100644 --- a/pkg/lint/rules.go +++ b/pkg/lint/rules.go @@ -471,7 +471,7 @@ var AllRules = func(l *Linter) Rules { //nolint:gocyclo { Name: "valid-version-stream", Description: "check the provides and tag filter if version stream suffix is passed to package name", - Severity: SeverityError, + Severity: SeverityWarning, LintFunc: func(c config.Configuration) error { // This regex captures a string that ends with a semantic version (semver) suffix. // It returns two groups: diff --git a/pkg/lint/rules_test.go b/pkg/lint/rules_test.go index eea335d9..99c3da41 100644 --- a/pkg/lint/rules_test.go +++ b/pkg/lint/rules_test.go @@ -412,19 +412,21 @@ func TestLinter_Rules(t *testing.T) { }, }, }, + wantErr: false, + matches: 1, }, { file: "version-stream-missing-provides-1.2.yaml", - minSeverity: SeverityError, + minSeverity: SeverityWarning, want: EvalResult{ File: "version-stream-missing-provides-1.2", Errors: EvalRuleErrors{ { Rule: Rule{ Name: "valid-version-stream", - Severity: SeverityError, + Severity: SeverityWarning, }, - Error: fmt.Errorf("[valid-version-stream]: package is version streamed but version-stream-missing-provides=${{package.full-version}} is missing on dependencies.provides (ERROR)"), + Error: fmt.Errorf("[valid-version-stream]: package is version streamed but version-stream-missing-provides=${{package.full-version}} is missing on dependencies.provides (WARNING)"), }, }, }, @@ -433,16 +435,16 @@ func TestLinter_Rules(t *testing.T) { }, { file: "version-stream-missing-update-tagfilter-1.2.yaml", - minSeverity: SeverityError, + minSeverity: SeverityWarning, want: EvalResult{ File: "version-stream-missing-update-tagfilter-1.2", Errors: EvalRuleErrors{ { Rule: Rule{ Name: "valid-version-stream", - Severity: SeverityError, + Severity: SeverityWarning, }, - Error: fmt.Errorf("[valid-version-stream]: package is version streamed but tag filter 1.2 is mismatch on update.github (ERROR)"), + Error: fmt.Errorf("[valid-version-stream]: package is version streamed but tag filter 1.2 is mismatch on update.github (WARNING)"), }, }, }, @@ -451,16 +453,16 @@ func TestLinter_Rules(t *testing.T) { }, { file: "version-stream-missing-update-tagfilter-1.2-999.yaml", - minSeverity: SeverityError, + minSeverity: SeverityWarning, want: EvalResult{ File: "version-stream-missing-update-tagfilter-1.2", Errors: EvalRuleErrors{ { Rule: Rule{ Name: "valid-version-stream", - Severity: SeverityError, + Severity: SeverityWarning, }, - Error: fmt.Errorf("[valid-version-stream]: package is version streamed but tag filter 1.2 is mismatch on update.github (ERROR)"), + Error: fmt.Errorf("[valid-version-stream]: package is version streamed but tag filter 1.2 is mismatch on update.github (WARNING)"), }, }, }, @@ -485,16 +487,16 @@ func TestLinter_Rules(t *testing.T) { }, { file: "version-stream-mismatch-version-1.2.yaml", - minSeverity: SeverityError, + minSeverity: SeverityWarning, want: EvalResult{ File: "version-stream-mismatch-version-1.2", Errors: EvalRuleErrors{ { Rule: Rule{ Name: "valid-version-stream", - Severity: SeverityError, + Severity: SeverityWarning, }, - Error: fmt.Errorf("[valid-version-stream]: package is version streamed but package.version 1.7 starts with different than given version stream 1.2 (ERROR)"), + Error: fmt.Errorf("[valid-version-stream]: package is version streamed but package.version 1.7 starts with different than given version stream 1.2 (WARNING)"), }, }, }, diff --git a/pkg/lint/testdata/files/version-stream-mismatch-version-1.2.yaml b/pkg/lint/testdata/files/version-stream-mismatch-version-1.2.yaml index 5164d335..3a495d13 100644 --- a/pkg/lint/testdata/files/version-stream-mismatch-version-1.2.yaml +++ b/pkg/lint/testdata/files/version-stream-mismatch-version-1.2.yaml @@ -13,3 +13,6 @@ pipeline: test: pipeline: - runs: "echo 'test'" + +update: + enabled: true diff --git a/pkg/lint/testdata/files/version-stream-missing-provides-1.2.yaml b/pkg/lint/testdata/files/version-stream-missing-provides-1.2.yaml index 19c81da5..31c1a5f4 100644 --- a/pkg/lint/testdata/files/version-stream-missing-provides-1.2.yaml +++ b/pkg/lint/testdata/files/version-stream-missing-provides-1.2.yaml @@ -13,3 +13,6 @@ pipeline: test: pipeline: - runs: "echo 'test'" + +update: + enabled: true