From 4282d1b19321721a03f854b6c6b4d60a67314837 Mon Sep 17 00:00:00 2001 From: Eric Giffon Date: Fri, 29 Dec 2023 14:23:47 +0100 Subject: [PATCH] SONAR-21377 Deprecate param types in issues search/list APIs --- .../src/main/java/org/sonar/server/issue/ws/ListAction.java | 3 +++ .../src/main/java/org/sonar/server/issue/ws/SearchAction.java | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/ListAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/ListAction.java index f8f6cb61149..708f6a0d10f 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/ListAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/ListAction.java @@ -47,6 +47,7 @@ import org.sonarqube.ws.Common; import org.sonarqube.ws.Issues; import static com.google.common.base.Strings.isNullOrEmpty; +import static java.lang.String.format; import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; import static org.sonar.api.server.ws.WebService.Param.PAGE; @@ -96,6 +97,7 @@ public class ListAction implements IssuesWsAction { "
Requires the 'Browse' permission on the specified project. ") .setSince("10.2") .setChangelog( + new Change("10.4", format("Parameter '%s' is deprecated.", PARAM_TYPES)), new Change("10.4", "The response fields 'severity' and 'type' are deprecated. Please use 'impacts' instead."), new Change("10.4", "The response fields 'status' and 'resolution' are deprecated. Please use 'issueStatus' instead."), new Change("10.4", "Add 'issueStatus' field to the response.") @@ -123,6 +125,7 @@ public class ListAction implements IssuesWsAction { action.createParam(PARAM_TYPES) .setDescription("Comma-separated list of issue types") .setExampleValue("BUG, VULNERABILITY") + .setDeprecatedSince("10.4") .setPossibleValues(RuleType.BUG.name(), RuleType.VULNERABILITY.name(), RuleType.CODE_SMELL.name()); action.createParam(PARAM_IN_NEW_CODE_PERIOD) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/SearchAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/SearchAction.java index 3fb55813cad..840dab2aacd 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/SearchAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/SearchAction.java @@ -212,7 +212,8 @@ public class SearchAction implements IssuesWsAction { new Change("10.4", "Possible value '%s' for 'transition' response field has been added".formatted(DefaultTransitions.ACCEPT)), new Change("10.4", format(NEW_PARAM_ADDED_MESSAGE, PARAM_ISSUE_STATUSES)), new Change("10.4", format("Parameters '%s' and '%s' are deprecated in favor of '%s'.", PARAM_RESOLUTIONS, PARAM_STATUSES, PARAM_ISSUE_STATUSES)), - new Change("10.4", format("Parameter '%s' is deprecated.", PARAM_SEVERITIES)), + new Change("10.4", format("Parameters '%s' and '%s' are deprecated, use '%s' and '%s' instead.", PARAM_SEVERITIES, PARAM_TYPES, + PARAM_IMPACT_SEVERITIES, PARAM_IMPACT_SOFTWARE_QUALITIES)), new Change("10.4", format(NEW_FACET_ADDED_MESSAGE, PARAM_ISSUE_STATUSES)), new Change("10.4", format("Facets '%s' and '%s' are deprecated in favor of '%s'", PARAM_RESOLUTIONS, PARAM_STATUSES, PARAM_ISSUE_STATUSES)), new Change("10.4", "Response fields 'severity' and 'type' are deprecated, use 'impacts' instead."), @@ -326,6 +327,7 @@ public class SearchAction implements IssuesWsAction { action.createParam(PARAM_TYPES) .setDescription("Comma-separated list of types.") .setSince("5.5") + .setDeprecatedSince("10.4") .setPossibleValues(ALL_RULE_TYPES_EXCEPT_SECURITY_HOTSPOTS) .setExampleValue(format("%s,%s", RuleType.CODE_SMELL, RuleType.BUG)); action.createParam(PARAM_OWASP_ASVS_LEVEL) -- 2.39.5