From 7ab12e3f9eb0126201c49fe6717a7ed4c618655d Mon Sep 17 00:00:00 2001 From: blva <40155621+blva@users.noreply.github.com> Date: Thu, 8 Jun 2023 20:44:02 +0100 Subject: [PATCH] changelog: request param required flag changed (#288) * Add request param required property update checker * Update breaking changes * Update localizations * Lint * Handle info logs * update examples * Extend check backward compatibility to use levels * Update examples * rm "is not breaking" from changelog comments --------- Co-authored-by: Reuven --- BREAKING-CHANGES-EXAMPLES.md | 25 ++++---- checker/check-api-added_test.go | 4 +- ...quest-parameter-required-value-updated.go} | 15 +++-- checker/checker.go | 15 ++++- checker/checker_deprecation_test.go | 6 +- checker/checker_not_breaking_test.go | 10 ++-- ...t_parameter_required_value_updated_test.go | 58 +++++++++++++++++++ checker/default_checks.go | 2 +- checker/localizations/localizations.go | 4 +- checker/localizations_src/en/messages.yaml | 1 + checker/localizations_src/ru/messages.yaml | 1 + internal/breaking-changes.go | 11 +--- 12 files changed, 113 insertions(+), 39 deletions(-) rename checker/{check-request-parameter-became-required.go => check-request-parameter-required-value-updated.go} (69%) create mode 100644 checker/checker_request_parameter_required_value_updated_test.go diff --git a/BREAKING-CHANGES-EXAMPLES.md b/BREAKING-CHANGES-EXAMPLES.md index a9b49873..51db1fa9 100644 --- a/BREAKING-CHANGES-EXAMPLES.md +++ b/BREAKING-CHANGES-EXAMPLES.md @@ -75,20 +75,19 @@ These examples are automatically generated from unit tests. [setting the default value of an optional request parameter is breaking](checker/checker_breaking_test.go?plain=1#L553) ## Examples of non-breaking changes -[adding a media-type to response is not breaking](checker/checker_not_breaking_test.go?plain=1#L166) +[adding a media-type to response is not breaking](checker/checker_not_breaking_test.go?plain=1#L168) [adding a new required property in response body is not breaking](checker/checker_breaking_property_test.go?plain=1#L402) [adding a new required property under AllOf in response body is not breaking](checker/checker_breaking_property_test.go?plain=1#L432) [adding a new required read-only property in request body is not breaking](checker/checker_breaking_property_test.go?plain=1#L486) [adding a non-existent required property in request body is not breaking](checker/checker_breaking_property_test.go?plain=1#L294) -[adding a tag is not breaking with "api-tag-removed" check](checker/checker_not_breaking_test.go?plain=1#L263) -[adding a tag is not breaking](checker/checker_not_breaking_test.go?plain=1#L248) +[adding a tag is not breaking with "api-tag-removed" check](checker/checker_not_breaking_test.go?plain=1#L265) +[adding a tag is not breaking](checker/checker_not_breaking_test.go?plain=1#L250) [adding an enum value is not breaking](checker/checker_not_breaking_test.go?plain=1#L66) [adding an enum value to request body is not breaking](checker/checker_breaking_property_test.go?plain=1#L138) [adding an optional request body is not breaking](checker/checker_not_breaking_test.go?plain=1#L20) [both max lengths in request are nil is not breaking](checker/checker_breaking_min_max_test.go?plain=1#L178) [both max lengths in response are nil is not breaking](checker/checker_breaking_min_max_test.go?plain=1#L192) -[changing a link to operation ID is not breaking](checker/checker_not_breaking_test.go?plain=1#L157) -[changing an existing header param to optional is not breaking](checker/checker_not_breaking_test.go?plain=1#L116) +[changing a link to operation ID is not breaking](checker/checker_not_breaking_test.go?plain=1#L159) [changing an existing property in request body to optional is not breaking](checker/checker_breaking_property_test.go?plain=1#L322) [changing an existing property in request header to optional is not breaking](checker/checker_breaking_property_test.go?plain=1#L82) [changing an existing property in response body to required is not breaking](checker/checker_breaking_property_test.go?plain=1#L308) @@ -100,20 +99,20 @@ These examples are automatically generated from unit tests. [changing extensions is not breaking](checker/checker_not_breaking_test.go?plain=1#L78) [changing max length in request from any value to nil is not breaking](checker/checker_breaking_min_max_test.go?plain=1#L144) [changing max length in response from nil to any value is not breaking](checker/checker_breaking_min_max_test.go?plain=1#L128) -[changing operation ID is not breaking](checker/checker_not_breaking_test.go?plain=1#L148) +[changing operation ID is not breaking](checker/checker_not_breaking_test.go?plain=1#L150) [changing request's body schema type from integer to number is not breaking](checker/checker_breaking_request_type_changed_test.go?plain=1#L71) [changing response's body schema type from number to integer is not breaking](checker/checker_breaking_response_type_changed_test.go?plain=1#L51) [changing response's body schema type from number/none to integer/int32 is not breaking](checker/checker_breaking_response_type_changed_test.go?plain=1#L89) -[changing servers is not breaking](checker/checker_not_breaking_test.go?plain=1#L234) +[changing servers is not breaking](checker/checker_not_breaking_test.go?plain=1#L236) [deleting a non-required non-write-only property in response body is not breaking](checker/checker_breaking_property_test.go?plain=1#L531) [deleting a path after sunset date of all contained operations is not breaking](checker/checker_deprecation_test.go?plain=1#L258) [deleting a pattern from a schema is not breaking](checker/checker_breaking_test.go?plain=1#L443) [deleting a required write-only property in response body is not breaking](checker/checker_breaking_property_test.go?plain=1#L514) [deleting a tag is not breaking](checker/checker_not_breaking_test.go?plain=1#L54) [deleting an operation after sunset date is not breaking](checker/checker_deprecation_test.go?plain=1#L69) -[deprecating a header is not breaking](checker/checker_not_breaking_test.go?plain=1#L208) -[deprecating a parameter is not breaking](checker/checker_not_breaking_test.go?plain=1#L195) -[deprecating a schema is not breaking](checker/checker_not_breaking_test.go?plain=1#L221) +[deprecating a header is not breaking](checker/checker_not_breaking_test.go?plain=1#L210) +[deprecating a parameter is not breaking](checker/checker_not_breaking_test.go?plain=1#L197) +[deprecating a schema is not breaking](checker/checker_not_breaking_test.go?plain=1#L223) [deprecating an operation with a deprecation policy and sunset date after required deprecation period is not breaking](checker/checker_deprecation_test.go?plain=1#L237) [deprecating an operation without a deprecation policy and without specifying sunset date is not breaking for draft level](checker/checker_deprecation_test.go?plain=1#L155) [deprecating an operation without a deprecation policy and without specifying sunset date is not breaking](checker/checker_deprecation_test.go?plain=1#L103) @@ -123,7 +122,7 @@ These examples are automatically generated from unit tests. [modifying the default value of a required request parameter is not breaking](checker/checker_breaking_test.go?plain=1#L571) [new optional header param is not breaking](checker/checker_not_breaking_test.go?plain=1#L102) [new optional property in request header is not breaking](checker/checker_breaking_property_test.go?plain=1#L38) -[new required response header param is not breaking](checker/checker_not_breaking_test.go?plain=1#L134) +[new required response header param is not breaking](checker/checker_not_breaking_test.go?plain=1#L136) [no change is not breaking](checker/checker_not_breaking_test.go?plain=1#L15) [reducing max in response is not breaking](checker/checker_breaking_min_max_test.go?plain=1#L281) [reducing max length in response is not breaking](checker/checker_breaking_min_max_test.go?plain=1#L31) @@ -136,7 +135,9 @@ These examples are automatically generated from unit tests. [renaming a path parameter is not breaking](checker/checker_breaking_test.go?plain=1#L135) ## Examples of info-level changes for changelog -[deprecating an operation with sunset greater than min](checker/checker_not_breaking_test.go?plain=1#L180) +[changing an existing header param from required to optional](checker/checker_request_parameter_required_value_updated_test.go?plain=1#L36) +[changing an existing header param to optional](checker/checker_not_breaking_test.go?plain=1#L116) +[deprecating an operation with sunset greater than min](checker/checker_not_breaking_test.go?plain=1#L182) [new paths or path operations](checker/check-api-added_test.go?plain=1#L11) [path operations that became deprecated](checker/checker_deprecation_test.go?plain=1#L324) [path operations that were re-activated](checker/checker_deprecation_test.go?plain=1#L344) diff --git a/checker/check-api-added_test.go b/checker/check-api-added_test.go index da56dfdd..b52135d7 100644 --- a/checker/check-api-added_test.go +++ b/checker/check-api-added_test.go @@ -19,7 +19,7 @@ func TestApiAdded_DetectsNewPathsAndNewOperations(t *testing.T) { d, osm, err := diff.GetWithOperationsSourcesMap(getConfig(), s1, s2) require.NoError(t, err) - errs := checker.CheckBackwardCompatibility(checker.GetAllChecks(), d, osm) + errs := checker.CheckBackwardCompatibilityUntilLevel(singleCheckConfig(checker.APIAddedCheck), d, osm, checker.INFO) require.NotEmpty(t, errs) require.Len(t, errs, 2) @@ -43,7 +43,7 @@ func TestApiAdded_DetectsModifiedPathsWithPathParam(t *testing.T) { d, osm, err := diff.GetWithOperationsSourcesMap(getConfig(), s1, s2) require.NoError(t, err) - errs := checker.CheckBackwardCompatibility(checker.GetAllChecks(), d, osm) + errs := checker.CheckBackwardCompatibilityUntilLevel(singleCheckConfig(checker.APIAddedCheck), d, osm, checker.INFO) require.NotEmpty(t, errs) require.Len(t, errs, 1) diff --git a/checker/check-request-parameter-became-required.go b/checker/check-request-parameter-required-value-updated.go similarity index 69% rename from checker/check-request-parameter-became-required.go rename to checker/check-request-parameter-required-value-updated.go index bf452f31..9ed7f2c6 100644 --- a/checker/check-request-parameter-became-required.go +++ b/checker/check-request-parameter-required-value-updated.go @@ -6,7 +6,7 @@ import ( "github.com/tufin/oasdiff/diff" ) -func RequestParameterBecameRequiredCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config BackwardCompatibilityCheckConfig) []BackwardCompatibilityError { +func RequestParameterRequiredValueUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config BackwardCompatibilityCheckConfig) []BackwardCompatibilityError { result := make([]BackwardCompatibilityError, 0) if diffReport.PathsDiff == nil { return result @@ -28,15 +28,20 @@ func RequestParameterBecameRequiredCheck(diffReport *diff.Diff, operationsSource if requiredDiff == nil { continue } + + id := "request-parameter-became-required" + level := ERR + if requiredDiff.To != true { - continue + id = "request-parameter-became-optional" + level = INFO } source := (*operationsSources)[operationItem.Revision] result = append(result, BackwardCompatibilityError{ - Id: "request-parameter-became-required", - Level: ERR, - Text: fmt.Sprintf(config.i18n("request-parameter-became-required"), ColorizedValue(paramLocation), ColorizedValue(paramName)), + Id: id, + Level: level, + Text: fmt.Sprintf(config.i18n(id), ColorizedValue(paramLocation), ColorizedValue(paramName)), Operation: operation, OperationId: operationItem.Revision.OperationID, Path: path, diff --git a/checker/checker.go b/checker/checker.go index d3b8db3f..3a633b8c 100644 --- a/checker/checker.go +++ b/checker/checker.go @@ -158,6 +158,10 @@ func (c *BackwardCompatibilityCheckConfig) i18n(messageID string) string { } func CheckBackwardCompatibility(config BackwardCompatibilityCheckConfig, diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap) BackwardCompatibilityErrors { + return CheckBackwardCompatibilityUntilLevel(config, diffReport, operationsSources, WARN) +} + +func CheckBackwardCompatibilityUntilLevel(config BackwardCompatibilityCheckConfig, diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, level Level) BackwardCompatibilityErrors { result := make(BackwardCompatibilityErrors, 0) if diffReport == nil { @@ -171,8 +175,15 @@ func CheckBackwardCompatibility(config BackwardCompatibilityCheckConfig, diffRep result = append(result, errs...) } - sort.Sort(result) - return result + filteredResult := make(BackwardCompatibilityErrors, 0) + for _, change := range result { + if change.Level <= level { + filteredResult = append(filteredResult, change) + } + } + + sort.Sort(filteredResult) + return filteredResult } func removeDraftAndAlphaOperationsDiffs(diffReport *diff.Diff, result []BackwardCompatibilityError, operationsSources *diff.OperationsSourcesMap) []BackwardCompatibilityError { diff --git a/checker/checker_deprecation_test.go b/checker/checker_deprecation_test.go index e32ccfad..cbf57bd8 100644 --- a/checker/checker_deprecation_test.go +++ b/checker/checker_deprecation_test.go @@ -249,7 +249,7 @@ func TestBreaking_DeprecationWithProperSunset(t *testing.T) { require.NoError(t, err) c := singleCheckConfig(checker.APIDeprecationCheck) c.MinSunsetStableDays = 10 - errs := checker.CheckBackwardCompatibility(c, d, osm) + errs := checker.CheckBackwardCompatibilityUntilLevel(c, d, osm, checker.INFO) require.Len(t, errs, 1) // only a non-breaking change detected require.Equal(t, errs[0].Level, checker.INFO) @@ -332,7 +332,7 @@ func TestApiDeprecated_DetectsDeprecatedOperations(t *testing.T) { d, osm, err := diff.GetWithOperationsSourcesMap(getConfig(), s1, s2) require.NoError(t, err) - errs := checker.CheckBackwardCompatibility(singleCheckConfig(checker.APIDeprecationCheck), d, osm) + errs := checker.CheckBackwardCompatibilityUntilLevel(singleCheckConfig(checker.APIDeprecationCheck), d, osm, checker.INFO) require.NotEmpty(t, errs) require.Len(t, errs, 1) @@ -352,7 +352,7 @@ func TestApiDeprecated_DetectsReactivatedOperations(t *testing.T) { d, osm, err := diff.GetWithOperationsSourcesMap(getConfig(), s1, s2) require.NoError(t, err) - errs := checker.CheckBackwardCompatibility(singleCheckConfig(checker.APIDeprecationCheck), d, osm) + errs := checker.CheckBackwardCompatibilityUntilLevel(singleCheckConfig(checker.APIDeprecationCheck), d, osm, checker.INFO) require.NotEmpty(t, errs) require.Len(t, errs, 1) diff --git a/checker/checker_not_breaking_test.go b/checker/checker_not_breaking_test.go index 92eed10e..579c4467 100644 --- a/checker/checker_not_breaking_test.go +++ b/checker/checker_not_breaking_test.go @@ -113,7 +113,7 @@ func TestBreaking_NewOptionalHeaderParam(t *testing.T) { require.Empty(t, errs) } -// BC: changing an existing header param to optional is not breaking +// CL: changing an existing header param to optional func TestBreaking_HeaderParamRequiredDisabled(t *testing.T) { s1 := l(t, 1) s2 := l(t, 1) @@ -123,8 +123,10 @@ func TestBreaking_HeaderParamRequiredDisabled(t *testing.T) { d, osm, err := diff.GetWithOperationsSourcesMap(getConfig(), &s1, &s2) require.NoError(t, err) - errs := checker.CheckBackwardCompatibility(checker.GetDefaultChecks(), d, osm) - require.Empty(t, errs) + changes := checker.CheckBackwardCompatibilityUntilLevel(checker.GetDefaultChecks(), d, osm, checker.INFO) + require.NotEmpty(t, changes) + require.Equal(t, "request-parameter-became-optional", changes[0].Id) + require.Len(t, changes, 1) } func deleteResponseHeader(response *openapi3.Response, name string) { @@ -187,7 +189,7 @@ func TestBreaking_DeprecatedOperation(t *testing.T) { d, osm, err := diff.GetWithOperationsSourcesMap(getConfig(), &s1, &s2) require.NoError(t, err) - errs := checker.CheckBackwardCompatibility(checker.GetDefaultChecks(), d, osm) + errs := checker.CheckBackwardCompatibilityUntilLevel(checker.GetDefaultChecks(), d, osm, checker.INFO) require.Len(t, errs, 1) require.Equal(t, errs[0].Level, checker.INFO) } diff --git a/checker/checker_request_parameter_required_value_updated_test.go b/checker/checker_request_parameter_required_value_updated_test.go new file mode 100644 index 00000000..e4efb677 --- /dev/null +++ b/checker/checker_request_parameter_required_value_updated_test.go @@ -0,0 +1,58 @@ +package checker_test + +import ( + "testing" + + "github.com/getkin/kin-openapi/openapi3" + "github.com/stretchr/testify/require" + "github.com/tufin/oasdiff/checker" + "github.com/tufin/oasdiff/diff" +) + +// BC: changing an existing header param from optional to required is breaking +func TestBreaking_HeaderParamBecameRequired(t *testing.T) { + s1 := l(t, 1) + s2 := l(t, 1) + + s1.Spec.Paths[installCommandPath].Get.Parameters.GetByInAndName(openapi3.ParameterInHeader, "network-policies").Required = false + s2.Spec.Paths[installCommandPath].Get.Parameters.GetByInAndName(openapi3.ParameterInHeader, "network-policies").Required = true + + d, osm, err := diff.GetWithOperationsSourcesMap(getConfig(), &s1, &s2) + require.NoError(t, err) + errs := checker.CheckBackwardCompatibility(singleCheckConfig(checker.RequestParameterRequiredValueUpdatedCheck), d, osm) + require.NotEmpty(t, errs) + require.Equal(t, checker.BackwardCompatibilityErrors{ + { + Id: "request-parameter-became-required", + Text: "the 'header' request parameter 'network-policies' became required", + Comment: "", + Level: checker.ERR, + Operation: "GET", + Path: "/api/{domain}/{project}/install-command", + Source: "../data/openapi-test1.yaml", + }}, errs) +} + +// CL: changing an existing header param from required to optional +func TestBreaking_HeaderParamBecameOptional(t *testing.T) { + s1 := l(t, 1) + s2 := l(t, 1) + + s1.Spec.Paths[installCommandPath].Get.Parameters.GetByInAndName(openapi3.ParameterInHeader, "network-policies").Required = true + s2.Spec.Paths[installCommandPath].Get.Parameters.GetByInAndName(openapi3.ParameterInHeader, "network-policies").Required = false + + d, osm, err := diff.GetWithOperationsSourcesMap(getConfig(), &s1, &s2) + require.NoError(t, err) + errs := checker.CheckBackwardCompatibilityUntilLevel(singleCheckConfig(checker.RequestParameterRequiredValueUpdatedCheck), d, osm, checker.INFO) + require.NotEmpty(t, errs) + require.Equal(t, checker.BackwardCompatibilityErrors{ + { + Id: "request-parameter-became-optional", + Text: "the 'header' request parameter 'network-policies' became optional", + Comment: "", + Level: checker.INFO, + Operation: "GET", + Path: "/api/{domain}/{project}/install-command", + Source: "../data/openapi-test1.yaml", + }}, errs) +} diff --git a/checker/default_checks.go b/checker/default_checks.go index dfac74f7..75767692 100644 --- a/checker/default_checks.go +++ b/checker/default_checks.go @@ -62,7 +62,7 @@ func defaultChecks() []BackwardCompatibilityCheck { RequestParameterPatternAddedOrChangedCheck, RequestPropertyPatternAddedOrChangedCheck, AddedRequiredRequestBodyCheck, - RequestParameterBecameRequiredCheck, + RequestParameterRequiredValueUpdatedCheck, RequestParameterBecameEnumCheck, RequestPropertyBecameRequiredCheck, RequestPropertyBecameEnumCheck, diff --git a/checker/localizations/localizations.go b/checker/localizations/localizations.go index 8d75e018..c2113dac 100644 --- a/checker/localizations/localizations.go +++ b/checker/localizations/localizations.go @@ -1,6 +1,6 @@ // Code generated by go-localize; DO NOT EDIT. // This file was generated by robots at -// 2023-06-02 17:15:07.730603 +0300 IDT m=+0.002427655 +// 2023-06-08 10:29:39.819262 +0100 IST m=+0.001862709 package localizations @@ -56,6 +56,7 @@ var localizations = map[string]string{ "en.messages.request-header-property-became-enum": "the %s request header's property %s was restricted to a list of enum values", "en.messages.request-header-property-became-required": "the %s request header's property %s became required", "en.messages.request-parameter-became-enum": "the %s request parameter %s was restricted to a list of enum values", + "en.messages.request-parameter-became-optional": "the %s request parameter %s became optional", "en.messages.request-parameter-became-required": "the %s request parameter %s became required", "en.messages.request-parameter-default-value-changed": "for the %s request parameter %s, default value was changed from %s to %s", "en.messages.request-parameter-enum-value-removed": "removed the enum value %s for the %s request parameter %s", @@ -175,6 +176,7 @@ var localizations = map[string]string{ "ru.messages.request-header-property-became-enum": "свойство %s заголовка запроса %s было ограничено списком значений перечисления", "ru.messages.request-header-property-became-required": "в заголовке запроса %s поле %s стало обязательным", "ru.messages.request-parameter-became-enum": "заголовок запроса %s поле %s было ограничено списком значений перечисления", + "ru.messages.request-parameter-became-optional": "ранее необязательный параметр запроса %s %s теперь является необязательным", "ru.messages.request-parameter-became-required": "ранее необязательный %s параметр запроса %s стал обязательным", "ru.messages.request-parameter-default-value-changed": "в %s параметре запроса %s, значение по умолчанию изменено с %s на %s", "ru.messages.request-parameter-enum-value-removed": "удалено значение enum %s у %s параметра запроса %s", diff --git a/checker/localizations_src/en/messages.yaml b/checker/localizations_src/en/messages.yaml index 01e85730..bbbd4101 100644 --- a/checker/localizations_src/en/messages.yaml +++ b/checker/localizations_src/en/messages.yaml @@ -31,6 +31,7 @@ response-mediatype-enum-value-removed: response schema %s enum value removed %s request-header-property-became-required: the %s request header's property %s became required request-header-property-became-enum: the %s request header's property %s was restricted to a list of enum values request-parameter-became-required: the %s request parameter %s became required +request-parameter-became-optional: the %s request parameter %s became optional request-parameter-became-enum: the %s request parameter %s was restricted to a list of enum values request-parameter-enum-value-removed: removed the enum value %s for the %s request parameter %s pattern-changed-warn-comment: "This is a warning because it is difficult to automatically analyze if the new pattern is a superset of the previous pattern(e.g. changed from '[0-9]+' to '[0-9]*')" diff --git a/checker/localizations_src/ru/messages.yaml b/checker/localizations_src/ru/messages.yaml index 70275663..cb2f11a6 100644 --- a/checker/localizations_src/ru/messages.yaml +++ b/checker/localizations_src/ru/messages.yaml @@ -31,6 +31,7 @@ response-mediatype-enum-value-removed: значение перечисления request-header-property-became-required: в заголовке запроса %s поле %s стало обязательным request-header-property-became-enum: свойство %s заголовка запроса %s было ограничено списком значений перечисления request-parameter-became-required: ранее необязательный %s параметр запроса %s стал обязательным +request-parameter-became-optional: ранее необязательный параметр запроса %s %s теперь является необязательным request-parameter-became-enum: заголовок запроса %s поле %s было ограничено списком значений перечисления request-parameter-enum-value-removed: удалено значение enum %s у %s параметра запроса %s pattern-changed-warn-comment: Это предупреждение, потому что сложно автоматически проанализировать, является ли новый шаблон надмножеством предыдущего шаблона (например, изменен с '[0-9]+' на '[0-9]*'). diff --git a/internal/breaking-changes.go b/internal/breaking-changes.go index 24fafa11..7853a6eb 100644 --- a/internal/breaking-changes.go +++ b/internal/breaking-changes.go @@ -53,7 +53,7 @@ func handleBreakingChanges(stdout io.Writer, diffReport *diff.Diff, operationsSo func getBreakingChanges(c checker.BackwardCompatibilityCheckConfig, diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, warnIgnoreFile string, errIgnoreFile string, level checker.Level) (checker.BackwardCompatibilityErrors, *ReturnError) { - errs := checker.CheckBackwardCompatibility(c, diffReport, operationsSources) + errs := checker.CheckBackwardCompatibilityUntilLevel(c, diffReport, operationsSources, level) if warnIgnoreFile != "" { var err error @@ -71,12 +71,5 @@ func getBreakingChanges(c checker.BackwardCompatibilityCheckConfig, diffReport * } } - levelFilteredErrs := make(checker.BackwardCompatibilityErrors, 0) - for _, err := range errs { - if err.Level <= level { - levelFilteredErrs = append(levelFilteredErrs, err) - } - } - - return levelFilteredErrs, nil + return errs, nil }