]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-20047 Deprecate endpoints and params related to rule or issue type and severity
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Tue, 15 Aug 2023 13:24:53 +0000 (15:24 +0200)
committersonartech <sonartech@sonarsource.com>
Fri, 18 Aug 2023 20:02:49 +0000 (20:02 +0000)
server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/BulkChangeAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/SetSeverityAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/SetTypeAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/ActivateRuleAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/ActivateRulesAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/DeactivateRulesAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/RuleWsSupport.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/SearchAction.java

index 7f37b26e90f49a53f00f4d5e29f965e0acbfd9e4..e06368caf2f1783c3d030c7df14b5ab38f7dde6e 100644 (file)
@@ -150,6 +150,7 @@ public class BulkChangeAction implements IssuesWsAction {
         "Requires authentication.")
       .setSince("3.7")
       .setChangelog(
+        new Change("10.2", format("Parameters '%s' and '%s' are now deprecated.", PARAM_SET_SEVERITY, PARAM_SET_TYPE)),
         new Change("8.2", "Security hotspots are no longer supported and will be ignored."),
         new Change("8.2", format("transitions '%s', '%s' and '%s' are no more supported", SET_AS_IN_REVIEW, RESOLVE_AS_REVIEWED, OPEN_AS_VULNERABILITY)),
         new Change("6.3", "'actions' parameter is ignored"))
@@ -166,10 +167,12 @@ public class BulkChangeAction implements IssuesWsAction {
       .setExampleValue("john.smith");
     action.createParam(PARAM_SET_SEVERITY)
       .setDescription("To change the severity of the list of issues")
+      .setDeprecatedSince("10.2")
       .setExampleValue(BLOCKER)
       .setPossibleValues(Severity.ALL);
     action.createParam(PARAM_SET_TYPE)
       .setDescription("To change the type of the list of issues")
+      .setDeprecatedSince("10.2")
       .setExampleValue(BUG)
       .setPossibleValues(RuleType.names())
       .setSince("5.5");
index d5ce9ebe9e1ee9ba4f05770e0071c1e56b9cc1b9..485d500773acc8ef70cd97f604790ad844d4e0f2 100644 (file)
@@ -79,11 +79,13 @@ public class SetSeverityAction implements IssuesWsAction {
         "</ul>")
       .setSince("3.6")
       .setChangelog(
+        new Change("10.2", "This endpoint is now deprecated."),
         new Change("9.6", "Response field 'ruleDescriptionContextKey' added"),
         new Change("8.8", "The response field components.uuid is removed"),
         new Change("6.5", "the database ids of the components are removed from the response"),
         new Change("6.5", "the response field components.uuid is deprecated. Use components.key instead."))
       .setHandler(this)
+      .setDeprecatedSince("10.2")
       .setResponseExample(Resources.getResource(this.getClass(), "set_severity-example.json"))
       .setPost(true);
 
index dbaf40cfd1f62c0e5b59b4bf6b121165d5232665..bf49aa4d89558db8da7b2e9f95faeb20de69eaf6 100644 (file)
@@ -83,11 +83,13 @@ public class SetTypeAction implements IssuesWsAction {
         "</ul>")
       .setSince("5.5")
       .setChangelog(
+        new Change("10.2", "This endpoint is now deprecated."),
         new Change("9.6", "Response field 'ruleDescriptionContextKey' added"),
         new Change("8.8", "The response field components.uuid is removed"),
         new Change("6.5", "the database ids of the components are removed from the response"),
         new Change("6.5", "the response field components.uuid is deprecated. Use components.key instead."))
       .setHandler(this)
+      .setDeprecatedSince("10.2")
       .setResponseExample(Resources.getResource(this.getClass(), "set_type-example.json"))
       .setPost(true);
 
index 29c84a7ca9487a252bf1c694e338a45f795d5062..cf4bd2960ee0f9d763a57982580d6d05ca093b04 100644 (file)
@@ -22,6 +22,7 @@ package org.sonar.server.qualityprofile.ws;
 import java.util.Map;
 import org.sonar.api.rule.RuleKey;
 import org.sonar.api.rule.Severity;
+import org.sonar.api.server.ws.Change;
 import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
@@ -67,6 +68,8 @@ public class ActivateRuleAction implements QProfileWsAction {
         "  <li>'Administer Quality Profiles'</li>" +
         "  <li>Edit right on the specified quality profile</li>" +
         "</ul>")
+      .setChangelog(
+        new Change("10.2", format("Parameter '%s' is now deprecated.", PARAM_SEVERITY)))
       .setHandler(this)
       .setPost(true)
       .setSince("4.4");
@@ -83,6 +86,7 @@ public class ActivateRuleAction implements QProfileWsAction {
 
     activate.createParam(PARAM_SEVERITY)
       .setDescription(format("Severity. Ignored if parameter %s is true.", PARAM_RESET))
+      .setDeprecatedSince("10.2")
       .setPossibleValues(Severity.ALL);
 
     activate.createParam(PARAM_PARAMS)
index 13c76798138a4cf1981ce7fe2c6c1d3bc261cf3d..e3b549f85542f15908d65f107c42d46ead8cb2b3 100644 (file)
@@ -33,10 +33,14 @@ import org.sonar.server.rule.index.RuleQuery;
 import org.sonar.server.rule.ws.RuleQueryFactory;
 import org.sonar.server.user.UserSession;
 
+import static java.lang.String.format;
 import static org.sonar.core.util.Uuids.UUID_EXAMPLE_03;
 import static org.sonar.server.qualityprofile.ws.BulkChangeWsResponse.writeResponse;
 import static org.sonar.server.qualityprofile.ws.QProfileReference.fromKey;
 import static org.sonar.server.rule.ws.RuleWsSupport.defineGenericRuleSearchParameters;
+import static org.sonar.server.rule.ws.RulesWsParameters.PARAM_ACTIVE_SEVERITIES;
+import static org.sonar.server.rule.ws.RulesWsParameters.PARAM_SEVERITIES;
+import static org.sonar.server.rule.ws.RulesWsParameters.PARAM_TYPES;
 import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_ACTIVATE_RULES;
 import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_TARGET_KEY;
 import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_TARGET_SEVERITY;
@@ -68,7 +72,9 @@ public class ActivateRulesAction implements QProfileWsAction {
         "</ul>")
       .setPost(true)
       .setSince("4.4")
-      .setChangelog(new Change("10.0", "Parameter 'sansTop25' is deprecated"))
+      .setChangelog(
+        new Change("10.2", format("Parameters '%s', '%s', '%s', and '%s' are now deprecated.", PARAM_SEVERITIES, PARAM_TARGET_SEVERITY, PARAM_ACTIVE_SEVERITIES, PARAM_TYPES)),
+        new Change("10.0", "Parameter 'sansTop25' is deprecated"))
       .setHandler(this);
 
     defineGenericRuleSearchParameters(activate);
@@ -80,6 +86,7 @@ public class ActivateRulesAction implements QProfileWsAction {
 
     activate.createParam(PARAM_TARGET_SEVERITY)
       .setDescription("Severity to set on the activated rules")
+      .setDeprecatedSince("10.2")
       .setPossibleValues(Severity.ALL);
   }
 
index 3d284ccb4d42cb96cc6caef3ebb794f6fd1bb65e..04dfb30bc556d3fb99adabf67349c1125f471d6f 100644 (file)
@@ -32,9 +32,13 @@ import org.sonar.server.rule.index.RuleQuery;
 import org.sonar.server.rule.ws.RuleQueryFactory;
 import org.sonar.server.user.UserSession;
 
+import static java.lang.String.format;
 import static org.sonar.core.util.Uuids.UUID_EXAMPLE_04;
 import static org.sonar.server.qualityprofile.ws.BulkChangeWsResponse.writeResponse;
 import static org.sonar.server.rule.ws.RuleWsSupport.defineGenericRuleSearchParameters;
+import static org.sonar.server.rule.ws.RulesWsParameters.PARAM_ACTIVE_SEVERITIES;
+import static org.sonar.server.rule.ws.RulesWsParameters.PARAM_SEVERITIES;
+import static org.sonar.server.rule.ws.RulesWsParameters.PARAM_TYPES;
 import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_DEACTIVATE_RULES;
 import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_TARGET_KEY;
 
@@ -65,7 +69,9 @@ public class DeactivateRulesAction implements QProfileWsAction {
         "</ul>")
       .setPost(true)
       .setSince("4.4")
-      .setChangelog(new Change("10.0", "Parameter 'sansTop25' is deprecated"))
+      .setChangelog(
+        new Change("10.2", format("Parameters '%s', '%s', and '%s' are now deprecated.", PARAM_SEVERITIES, PARAM_ACTIVE_SEVERITIES, PARAM_TYPES)),
+        new Change("10.0", "Parameter 'sansTop25' is deprecated"))
       .setHandler(this);
 
     defineGenericRuleSearchParameters(deactivate);
index 58702cedae127aa56fad2276e7bd93719b0ee295..8709adf771e2769c98e004408ae6b0891d6fdae4 100644 (file)
@@ -112,6 +112,7 @@ public class RuleWsSupport {
       .createParam(PARAM_SEVERITIES)
       .setDescription("Comma-separated list of default severities. Not the same than severity of rules in Quality profiles.")
       .setPossibleValues(Severity.ALL)
+      .setDeprecatedSince("10.2")
       .setExampleValue("CRITICAL,BLOCKER");
 
     action
@@ -169,6 +170,7 @@ public class RuleWsSupport {
       .setSince("5.5")
       .setDescription("Comma-separated list of types. Returned rules match any of the tags (OR operator)")
       .setPossibleValues(RuleType.values())
+      .setDeprecatedSince("10.2")
       .setExampleValue(RuleType.BUG);
 
     action
@@ -203,6 +205,7 @@ public class RuleWsSupport {
       .createParam(PARAM_ACTIVE_SEVERITIES)
       .setDescription("Comma-separated list of activation severities, i.e the severity of rules in Quality profiles.")
       .setPossibleValues(Severity.ALL)
+      .setDeprecatedSince("10.2")
       .setExampleValue("CRITICAL,BLOCKER");
 
     action
index 8f52faa0822dbadc2b47ddb4be3eddab52c6c439..f4cf74b5b2a624bc622879b12d13031ffd85c826 100644 (file)
@@ -165,8 +165,8 @@ public class SearchAction implements RulesWsAction {
         new Change("10.0", "The value 'debtRemFn' for the 'f' parameter has been deprecated, use 'remFn' instead"),
         new Change("10.0", "The value 'defaultDebtRemFn' for the 'f' parameter has been deprecated, use 'defaultRemFn' instead"),
         new Change("10.0", "The value 'sansTop25' for the parameter 'facets' has been deprecated"),
-        new Change("10.0", "Parameter 'sansTop25' is deprecated")
-      );
+        new Change("10.0", "Parameter 'sansTop25' is deprecated"),
+        new Change("10.2", format("Parameters '%s', '%s', and '%s' are now deprecated.", PARAM_SEVERITIES, PARAM_TYPES, PARAM_ACTIVE_SEVERITIES)));
 
     action.createParam(FACETS)
       .setDescription("Comma-separated list of the facets to be computed. No facet is computed by default.")