From 64fcb1ffd299b7c0530989b29b8a26c31284e5d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?L=C3=A9o=20Geoffroy?= Date: Tue, 22 Aug 2023 13:35:49 +0200 Subject: [PATCH] SONAR-20198 Deprecate severity and type from response and parameters in rules endpoints --- .../main/java/org/sonar/server/rule/ws/CreateAction.java | 3 ++- .../main/java/org/sonar/server/rule/ws/SearchAction.java | 6 ++++-- .../src/main/java/org/sonar/server/rule/ws/ShowAction.java | 3 ++- .../main/java/org/sonar/server/rule/ws/UpdateAction.java | 3 +++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/CreateAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/CreateAction.java index 2c51ecfcd97..51c10c3b275 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/CreateAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/CreateAction.java @@ -88,7 +88,8 @@ public class CreateAction implements RulesWsAction { .setChangelog( new Change("5.5", "Creating manual rule is not more possible"), new Change("10.0","Drop deprecated keys: 'custom_key', 'template_key', 'markdown_description', 'prevent_reactivation'"), - new Change("10.2", "Add 'impacts', 'cleanCodeAttribute', 'cleanCodeAttributeCategory' fields to the response") + new Change("10.2", "Add 'impacts', 'cleanCodeAttribute', 'cleanCodeAttributeCategory' fields to the response"), + new Change("10.2", "Fields 'type' and 'severity' are deprecated in the response. Use 'impacts' instead.") ) .setHandler(this); diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/SearchAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/SearchAction.java index 7ddee24e87b..1eef18c3619 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/SearchAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/SearchAction.java @@ -176,9 +176,11 @@ public class SearchAction implements RulesWsAction { new Change("10.2", format("Parameters '%s', '%s', and '%s' are now deprecated.", PARAM_SEVERITIES, PARAM_TYPES, PARAM_ACTIVE_SEVERITIES)), new Change("10.2", "Add 'impacts', 'cleanCodeAttribute', 'cleanCodeAttributeCategory' fields to the response"), new Change("10.2", "The field 'cleanCodeAttribute' has been added to the 'f' parameter"), - new Change("10.2", format("add '%s', '%s' and '%s' to the 'facets' parameter.",FACET_CLEAN_CODE_ATTRIBUTE_CATEGORY, FACET_IMPACT_SOFTWARE_QUALITY, FACET_IMPACT_SEVERITY)) + new Change("10.2", format("add '%s', '%s' and '%s' to the 'facets' parameter.", FACET_CLEAN_CODE_ATTRIBUTE_CATEGORY, FACET_IMPACT_SOFTWARE_QUALITY, FACET_IMPACT_SEVERITY)), + new Change("10.2", format("Parameters '%s', '%s', and '%s' are now deprecated, use '%s' instead.", PARAM_SEVERITIES, PARAM_TYPES, PARAM_ACTIVE_SEVERITIES, "impacts")), + new Change("10.2", "The fields 'type' and 'severity' are deprecated in the response. Use 'impacts' instead."), + new Change("10.2", "The values 'severity' and 'types' for the parameter 'facets' has been deprecated. Use 'impact' instead.") ); - action.createParam(FACETS) .setDescription("Comma-separated list of the facets to be computed. No facet is computed by default.") .setPossibleValues(POSSIBLE_FACETS) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/ShowAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/ShowAction.java index 83b7fac4744..967ab4ac874 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/ShowAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/ShowAction.java @@ -88,7 +88,8 @@ public class ShowAction implements RulesWsAction { new Change("10.0", "The deprecated field 'debtOverloaded' has been removed, use 'remFnOverloaded' instead."), new Change("10.0", "The field 'defaultDebtRemFnType' has been deprecated, use 'defaultRemFnType' instead"), new Change("10.0", "The field 'debtRemFnType' has been deprecated, use 'remFnType' instead"), - new Change("10.2", "Add 'impacts', 'cleanCodeAttribute', 'cleanCodeAttributeCategory' fields to the response")); + new Change("10.2", "Add 'impacts', 'cleanCodeAttribute', 'cleanCodeAttributeCategory' fields to the response"), + new Change("10.2", "The field 'severity' and 'type' in the response have been deprecated, use 'impacts' instead.")); action .createParam(PARAM_KEY) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/UpdateAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/UpdateAction.java index a00da292edf..b023adf7a96 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/UpdateAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/UpdateAction.java @@ -90,6 +90,9 @@ public class UpdateAction implements RulesWsAction { .setResponseExample(Resources.getResource(getClass(), "update-example.json")) .setDescription("Update an existing rule.
" + "Requires the 'Administer Quality Profiles' permission") + .setChangelog( + new Change("10.2", "The field 'severity' and 'type' in the response have been deprecated, use 'impacts' instead.") + ) .setSince("4.4") .setChangelog( new Change("10.2", "Add 'impacts', 'cleanCodeAttribute', 'cleanCodeAttributeCategory' fields to the response")) -- 2.39.5