From 2bfe0518401cbc7cc101fdbc42d8b1aa665cccdf Mon Sep 17 00:00:00 2001 From: =?utf8?q?L=C3=A9o=20Geoffroy?= Date: Tue, 12 Nov 2024 15:14:27 +0100 Subject: [PATCH] SONAR-23566 Remove deprecation on rule 'type' and 'severity' --- .../java/org/sonar/db/issue/IndexedIssueDto.java | 12 ++---------- .../org/sonar/server/issue/index/IssueDoc.java | 13 ++----------- .../server/common/rule/service/NewCustomRule.java | 2 -- .../sonar/server/issue/ws/AddCommentAction.java | 1 + .../org/sonar/server/issue/ws/AssignAction.java | 1 + .../sonar/server/issue/ws/BulkChangeAction.java | 3 +-- .../org/sonar/server/issue/ws/ChangelogAction.java | 3 ++- .../sonar/server/issue/ws/DeleteCommentAction.java | 1 + .../sonar/server/issue/ws/DoTransitionAction.java | 1 + .../sonar/server/issue/ws/EditCommentAction.java | 1 + .../java/org/sonar/server/issue/ws/ListAction.java | 12 ++++++------ .../org/sonar/server/issue/ws/SearchAction.java | 10 +++++----- .../org/sonar/server/issue/ws/SetTagsAction.java | 1 + .../qualityprofile/ws/ActivateRuleAction.java | 2 +- .../qualityprofile/ws/ActivateRulesAction.java | 4 ++-- .../server/qualityprofile/ws/BackupAction.java | 4 +++- .../qualityprofile/ws/DeactivateRulesAction.java | 1 + .../server/qualityprofile/ws/RestoreAction.java | 4 +++- .../org/sonar/server/rule/ws/CreateAction.java | 14 ++++++-------- .../org/sonar/server/rule/ws/RuleWsSupport.java | 13 +++++-------- .../org/sonar/server/rule/ws/SearchAction.java | 14 +++++++++----- .../java/org/sonar/server/rule/ws/ShowAction.java | 5 ++--- .../org/sonar/server/rule/ws/UpdateAction.java | 5 ++--- sonar-ws/src/main/protobuf/ws-rules.proto | 6 ++---- 24 files changed, 60 insertions(+), 73 deletions(-) diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IndexedIssueDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IndexedIssueDto.java index 530e1718113..c705188b983 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IndexedIssueDto.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/issue/IndexedIssueDto.java @@ -252,18 +252,10 @@ public final class IndexedIssueDto { return this; } - /** - * @deprecated since 10.2 - */ - @Deprecated(since = "10.2") public Integer getIssueType() { return issueType; } - /** - * @deprecated since 10.2 - */ - @Deprecated(since = "10.2") public IndexedIssueDto setIssueType(Integer issueType) { this.issueType = issueType; return this; @@ -341,11 +333,11 @@ public final class IndexedIssueDto { return this; } - public boolean isPrioritizedRule(){ + public boolean isPrioritizedRule() { return prioritizedRule; } - public IndexedIssueDto setPrioritizedRule(boolean prioritizedRule){ + public IndexedIssueDto setPrioritizedRule(boolean prioritizedRule) { this.prioritizedRule = prioritizedRule; return this; } diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/issue/index/IssueDoc.java b/server/sonar-server-common/src/main/java/org/sonar/server/issue/index/IssueDoc.java index b599943e999..58ba0b712f2 100644 --- a/server/sonar-server-common/src/main/java/org/sonar/server/issue/index/IssueDoc.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/issue/index/IssueDoc.java @@ -146,10 +146,6 @@ public class IssueDoc extends BaseDoc { return getNullableField(IssueIndexDefinition.FIELD_ISSUE_AUTHOR_LOGIN); } - /** - * @deprecated since 10.2 - */ - @Deprecated(since = "10.2") public RuleType type() { return RuleType.valueOf(getField(IssueIndexDefinition.FIELD_ISSUE_TYPE)); } @@ -211,10 +207,6 @@ public class IssueDoc extends BaseDoc { return this; } - /** - * @deprecated since 10.2 - */ - @Deprecated(since = "10.2") public IssueDoc setSeverity(@Nullable String s) { setField(IssueIndexDefinition.FIELD_ISSUE_SEVERITY, s); setField(IssueIndexDefinition.FIELD_ISSUE_SEVERITY_VALUE, Severity.ALL.indexOf(s)); @@ -296,7 +288,6 @@ public class IssueDoc extends BaseDoc { return this; } - @Deprecated(since = "10.2") public IssueDoc setType(RuleType type) { setField(IssueIndexDefinition.FIELD_ISSUE_TYPE, type.toString()); return this; @@ -445,11 +436,11 @@ public class IssueDoc extends BaseDoc { return this; } - public boolean isPrioritizedRule(){ + public boolean isPrioritizedRule() { return getField(IssueIndexDefinition.FIELD_PRIORITIZED_RULE); } - public IssueDoc setPrioritizedRule(boolean prioritizedRule){ + public IssueDoc setPrioritizedRule(boolean prioritizedRule) { setField(IssueIndexDefinition.FIELD_PRIORITIZED_RULE, prioritizedRule); return this; } diff --git a/server/sonar-webserver-common/src/main/java/org/sonar/server/common/rule/service/NewCustomRule.java b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/rule/service/NewCustomRule.java index f67a6420696..e7ce730c839 100644 --- a/server/sonar-webserver-common/src/main/java/org/sonar/server/common/rule/service/NewCustomRule.java +++ b/server/sonar-webserver-common/src/main/java/org/sonar/server/common/rule/service/NewCustomRule.java @@ -84,7 +84,6 @@ public class NewCustomRule { return severity; } - @Deprecated(since = "10.4") public NewCustomRule setSeverity(@Nullable String severity) { this.severity = severity; return this; @@ -105,7 +104,6 @@ public class NewCustomRule { return type; } - @Deprecated(since = "10.4") public NewCustomRule setType(@Nullable RuleType type) { this.type = type; return this; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/AddCommentAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/AddCommentAction.java index 7ac5031d4b8..a6cefc0bfdb 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/AddCommentAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/AddCommentAction.java @@ -74,6 +74,7 @@ public class AddCommentAction implements IssuesWsAction { "Requires authentication and the following permission: 'Browse' on the project of the specified issue.") .setSince("3.6") .setChangelog( + new Change("10.8", "The response fields 'severity' and 'type' are not deprecated anymore."), new Change("10.8", format("Possible values '%s' and '%s' for response field 'severity' of 'impacts' have been added.", Severity.INFO.name(), Severity.BLOCKER.name())), 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."), diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/AssignAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/AssignAction.java index 6a8ea531005..9493dc5bd90 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/AssignAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/AssignAction.java @@ -77,6 +77,7 @@ public class AssignAction implements IssuesWsAction { .setDescription("Assign/Unassign an issue. Requires authentication and Browse permission on project") .setSince("3.6") .setChangelog( + new Change("10.8", "The response fields 'severity' and 'type' are not deprecated anymore."), new Change("10.8", format("Possible values '%s' and '%s' for response field 'severity' of 'impacts' have been added.", Severity.INFO.name(), Severity.BLOCKER.name())), 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."), diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/BulkChangeAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/BulkChangeAction.java index 08d673ba893..977b651f7b2 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/BulkChangeAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/BulkChangeAction.java @@ -154,6 +154,7 @@ public class BulkChangeAction implements IssuesWsAction { "Requires authentication.") .setSince("3.7") .setChangelog( + new Change("10.8", format("The parameters '%s' and '%s' are not deprecated anymore.", PARAM_SET_SEVERITY, PARAM_SET_TYPE)), new Change("10.4", ("Transitions '%s' and '%s' are now deprecated. Use transition '%s' instead. " + "The transition '%s' is deprecated too.").formatted(WONT_FIX, CONFIRM, ACCEPT, UNCONFIRM)), new Change("10.4", "Transition '%s' is now supported.".formatted(ACCEPT)), @@ -174,12 +175,10 @@ 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"); diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/ChangelogAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/ChangelogAction.java index d8ce1413c9b..fcf9d57f0be 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/ChangelogAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/ChangelogAction.java @@ -53,9 +53,10 @@ public class ChangelogAction implements IssuesWsAction { public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION_CHANGELOG) .setDescription("Display changelog of an issue.
" + - "Requires the 'Browse' permission on the project of the specified issue.") + "Requires the 'Browse' permission on the project of the specified issue.") .setSince("4.1") .setChangelog( + new Change("10.8", "'severity' and 'type' keys are not deprecated anymore."), new Change("10.4", "'issueStatus' key is added in the differences"), new Change("10.4", "'status', 'resolution', 'severity' and 'type' keys are now deprecated in the differences"), new Change("9.7", "'externalUser' and 'webhookSource' information added to the answer"), diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/DeleteCommentAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/DeleteCommentAction.java index 7d8ffca8cc8..bb1ddbcd051 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/DeleteCommentAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/DeleteCommentAction.java @@ -60,6 +60,7 @@ public class DeleteCommentAction implements IssuesWsAction { "Requires authentication and the following permission: 'Browse' on the project of the specified issue.") .setSince("3.6") .setChangelog( + new Change("10.8", "The response fields 'severity' and 'type' are not deprecated anymore."), 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."), diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/DoTransitionAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/DoTransitionAction.java index 9fc2b63e97c..d0b1e2e4d2c 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/DoTransitionAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/DoTransitionAction.java @@ -86,6 +86,7 @@ public class DoTransitionAction implements IssuesWsAction { """.formatted(DefaultTransitions.ACCEPT, DefaultTransitions.WONT_FIX, DefaultTransitions.FALSE_POSITIVE)) .setSince("3.6") .setChangelog( + new Change("10.8", "The response fields 'severity' and 'type' are not deprecated anymore."), new Change("10.8", format("Possible values '%s' and '%s' for response field 'severity' of 'impacts' have been added.", Severity.INFO.name(), Severity.BLOCKER.name())), new Change("10.4", "The transitions '%s' and '%s' are deprecated. Please use '%s' instead. The transition '%s' is deprecated too. " .formatted(DefaultTransitions.WONT_FIX, DefaultTransitions.CONFIRM, DefaultTransitions.ACCEPT, DefaultTransitions.UNCONFIRM)), diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/EditCommentAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/EditCommentAction.java index b225c475d1b..cdec79cf6fa 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/EditCommentAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/EditCommentAction.java @@ -67,6 +67,7 @@ public class EditCommentAction implements IssuesWsAction { "Requires authentication and the following permission: 'Browse' on the project of the specified issue.") .setSince("3.6") .setChangelog( + new Change("10.8", "The response fields 'severity' and 'type' are not deprecated anymore."), new Change("10.8", format("Possible values '%s' and '%s' for response field 'severity' of 'impacts' have been added.", Severity.INFO.name(), Severity.BLOCKER.name())), 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."), 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 59f9c72d270..f78fe4aabe4 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 @@ -92,16 +92,17 @@ public class ListAction implements IssuesWsAction { .setHandler(this) .setInternal(true) .setDescription("List issues. This endpoint is used in degraded mode, when issue indexing is running." + - "
Either 'project' or 'component' parameter is required." + - "
Total number of issues will be always equal to a page size, as this counting all issues is not supported. " + - "
Requires the 'Browse' permission on the specified project. ") + "
Either 'project' or 'component' parameter is required." + + "
Total number of issues will be always equal to a page size, as this counting all issues is not supported. " + + "
Requires the 'Browse' permission on the specified project. ") .setSince("10.2") .setChangelog( + new Change("10.8", format("The parameter '%s' are not deprecated anymore.", PARAM_TYPES)), + new Change("10.8", "The response fields 'severity' and 'type' are not deprecated anymore."), 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.") - ) + new Change("10.4", "Add 'issueStatus' field to the response.")) .setResponseExample(getClass().getResource("list-example.json")); action.addPagingParams(100, MAX_PAGE_SIZE); @@ -125,7 +126,6 @@ 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 a076f62ab04..86bd5d586b2 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 @@ -222,6 +222,9 @@ public class SearchAction implements IssuesWsAction { + "
When issue indexing is in progress returns 503 service unavailable HTTP code.") .setSince("3.6") .setChangelog( + new Change("10.8", "The response fields 'severity' and 'type' are not deprecated anymore.."), + new Change("10.8", "The fields 'severity' and 'type' are not deprecated anymore."), + new Change("10.8", format("The parameters '%s' and '%s' are not deprecated anymore.", PARAM_SEVERITIES, PARAM_TYPES)), new Change("10.8", format("Possible values '%s' and '%s' for response field 'impactSeverities' of 'facets' have been added.", INFO.name(), BLOCKER.name())), new Change("10.8", format("Possible values '%s' and '%s' for response field 'severity' of 'impacts' have been added.", INFO.name(), BLOCKER.name())), new Change("10.8", format("Parameter '%s' now supports values: '%s','%s'.", PARAM_SEVERITIES, INFO.name(), BLOCKER.name())), @@ -318,8 +321,7 @@ public class SearchAction implements IssuesWsAction { action.createParam(PARAM_SEVERITIES) .setDescription("Comma-separated list of severities") .setExampleValue(Severity.BLOCKER + "," + Severity.CRITICAL) - .setPossibleValues(Severity.ALL) - .setDeprecatedSince("10.4"); + .setPossibleValues(Severity.ALL); action.createParam(PARAM_IMPACT_SOFTWARE_QUALITIES) .setSince("10.2") .setDescription("Comma-separated list of Software Qualities") @@ -343,8 +345,7 @@ public class SearchAction implements IssuesWsAction { action.createParam(PARAM_RESOLUTIONS) .setDescription("Comma-separated list of resolutions") .setExampleValue(RESOLUTION_FIXED + "," + RESOLUTION_REMOVED) - .setPossibleValues(RESOLUTIONS) - .setDeprecatedSince("10.4"); + .setPossibleValues(RESOLUTIONS); action.createParam(PARAM_RESOLVED) .setDescription("To match resolved or unresolved issues") .setBooleanPossibleValues(); @@ -360,7 +361,6 @@ 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) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/SetTagsAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/SetTagsAction.java index 294a09b9b09..66fbd1cca05 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/SetTagsAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/SetTagsAction.java @@ -76,6 +76,7 @@ public class SetTagsAction implements IssuesWsAction { .setDescription("Set tags on an issue.
" + "Requires authentication and Browse permission on project") .setChangelog( + new Change("10.8", "The response fields 'severity' and 'type' are not deprecated anymore."), new Change("10.8", format("Possible values '%s' and '%s' for response field 'severity' of 'impacts' have been added.", Severity.INFO.name(), Severity.BLOCKER.name())), 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."), diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/ActivateRuleAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/ActivateRuleAction.java index 39dee38f0d5..a0a627dbd98 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/ActivateRuleAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/ActivateRuleAction.java @@ -77,6 +77,7 @@ public class ActivateRuleAction implements QProfileWsAction { "
  • Edit right on the specified quality profile
  • " + "") .setChangelog( + new Change("10.8", format("The parameter '%s' is not deprecated anymore.", PARAM_SEVERITY)), new Change("10.8", format("Add new parameter '%s'", PARAM_IMPACTS)), new Change("10.6", format("Add parameter '%s'.", PARAM_PRIORITIZED_RULE)), new Change("10.2", format("Parameter '%s' is now deprecated.", PARAM_SEVERITY))) @@ -96,7 +97,6 @@ public class ActivateRuleAction implements QProfileWsAction { activate.createParam(PARAM_SEVERITY) .setDescription(format("Severity. Cannot be used as the same time as '%s'.Ignored if parameter %s is true.", PARAM_IMPACTS, PARAM_RESET)) - .setDeprecatedSince("10.2") .setPossibleValues(Severity.ALL); activate.createParam(PARAM_IMPACTS) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/ActivateRulesAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/ActivateRulesAction.java index d16e257e486..1d9822c1982 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/ActivateRulesAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/ActivateRulesAction.java @@ -33,7 +33,6 @@ import org.sonar.server.rule.index.RuleQuery; import org.sonar.server.rule.ws.RuleQueryFactory; import org.sonar.server.user.UserSession; -import static java.lang.Boolean.TRUE; 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; @@ -75,6 +74,8 @@ public class ActivateRulesAction implements QProfileWsAction { .setPost(true) .setSince("4.4") .setChangelog( + new Change("10.8", + format("The parameters '%s', '%s', '%s', and '%s' are not deprecated anymore.", PARAM_SEVERITIES, PARAM_TARGET_SEVERITY, PARAM_ACTIVE_SEVERITIES, PARAM_TYPES)), new Change("10.6", format("Add parameter '%s'.", PARAM_PRIORITIZED_RULE)), 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")) @@ -89,7 +90,6 @@ public class ActivateRulesAction implements QProfileWsAction { activate.createParam(PARAM_TARGET_SEVERITY) .setDescription("Severity to set on the activated rules") - .setDeprecatedSince("10.2") .setPossibleValues(Severity.ALL); activate.createParam(PARAM_PRIORITIZED_RULE) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/BackupAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/BackupAction.java index bb67238d570..c6a843fe050 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/BackupAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/BackupAction.java @@ -56,7 +56,9 @@ public class BackupAction implements QProfileWsAction { .setDescription("Backup a quality profile in XML form. The exported profile can be restored through api/qualityprofiles/restore.") .setResponseExample(getClass().getResource("backup-example.xml")) .setHandler(this) - .setChangelog(new Change("10.3", "The 'priority' and 'type' fields of the rule XML object are deprecated.")); + .setChangelog( + new Change("10.8", "The 'priority' and 'type' fields of the rule XML object are not deprecated anymore."), + new Change("10.3", "The 'priority' and 'type' fields of the rule XML object are deprecated.")); QProfileReference.defineParams(action, languages); } diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/DeactivateRulesAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/DeactivateRulesAction.java index 6a894040b2a..40e0a5e9522 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/DeactivateRulesAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/DeactivateRulesAction.java @@ -70,6 +70,7 @@ public class DeactivateRulesAction implements QProfileWsAction { .setPost(true) .setSince("4.4") .setChangelog( + new Change("10.8", format("Parameters '%s', '%s', and '%s' are not deprecated anymore.", PARAM_SEVERITIES, PARAM_ACTIVE_SEVERITIES, PARAM_TYPES)), new Change("10.3", "Inherited rules can be deactivated (if the global admin setting is enabled)"), 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")) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/RestoreAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/RestoreAction.java index 4b6a50521da..20409fbbf9b 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/RestoreAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualityprofile/ws/RestoreAction.java @@ -65,7 +65,9 @@ public class RestoreAction implements QProfileWsAction { "Requires to be logged in and the 'Administer Quality Profiles' permission.") .setPost(true) .setHandler(this) - .setChangelog(new Change("10.3", "The 'priority' and 'type' fields of the rule XML object are deprecated.")); + .setChangelog( + new Change("10.8", "The 'priority' and 'type' fields of the rule XML object are not deprecated anymore."), + new Change("10.3", "The 'priority' and 'type' fields of the rule XML object are deprecated.")); action.createParam(PARAM_BACKUP) .setDescription("A profile backup file in XML format, as generated by api/qualityprofiles/backup " + 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 2c796b0e741..1eb9ee58b3e 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 @@ -97,12 +97,13 @@ public class CreateAction implements RulesWsAction { .setSince("4.4") .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.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", "Fields 'type' and 'severity' are deprecated in the response. Use 'impacts' instead."), new Change("10.4", String.format("Add '%s' and '%s' parameters to the request", PARAM_IMPACTS, PARAM_CLEAN_CODE_ATTRIBUTE)), new Change("10.4", String.format("Parameters '%s' and '%s' are deprecated. Use '%s' instead.", PARAM_TYPE, PARAM_SEVERITY, PARAM_IMPACTS)), - new Change("10.4", String.format("Parameter '%s' is deprecated. Use api/rules/update endpoint instead.", PARAM_PREVENT_REACTIVATION))) + new Change("10.4", String.format("Parameter '%s' is deprecated. Use api/rules/update endpoint instead.", PARAM_PREVENT_REACTIVATION)), + new Change("10.8", String.format("The parameters '%s' and '%s' are not deprecated anymore.", PARAM_TYPE, PARAM_SEVERITY))) .setHandler(this); action @@ -134,9 +135,7 @@ public class CreateAction implements RulesWsAction { action .createParam(PARAM_SEVERITY) .setPossibleValues(Severity.ALL) - .setDescription("Rule severity") - .setDeprecatedSince("10.4"); - + .setDescription("Rule severity"); action .createParam(PARAM_STATUS) .setPossibleValues( @@ -160,8 +159,7 @@ public class CreateAction implements RulesWsAction { action.createParam(PARAM_TYPE) .setPossibleValues(RuleType.names()) .setDescription("Rule type") - .setSince("6.7") - .setDeprecatedSince("10.4"); + .setSince("6.7"); action.createParam(PARAM_CLEAN_CODE_ATTRIBUTE) .setDescription("Clean code attribute") @@ -192,7 +190,7 @@ public class CreateAction implements RulesWsAction { private static NewCustomRule toNewCustomRule(Request request) { RuleKey templateKey = RuleKey.parse(request.mandatoryParam(PARAM_TEMPLATE_KEY)); NewCustomRule newRule = NewCustomRule.createForCustomRule( - RuleKey.of(templateKey.repository(), request.mandatoryParam(PARAM_CUSTOM_KEY)), templateKey) + RuleKey.of(templateKey.repository(), request.mandatoryParam(PARAM_CUSTOM_KEY)), templateKey) .setName(request.mandatoryParam(PARAM_NAME)) .setMarkdownDescription(request.mandatoryParam(PARAM_DESCRIPTION)) .setStatus(RuleStatus.valueOf(request.mandatoryParam(PARAM_STATUS))) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/RuleWsSupport.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/RuleWsSupport.java index 6667116ef4e..d69811a23ce 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/RuleWsSupport.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/RuleWsSupport.java @@ -119,7 +119,6 @@ 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 @@ -146,7 +145,7 @@ public class RuleWsSupport { action .createParam(PARAM_SONARSOURCE_SECURITY) .setDescription("Comma-separated list of SonarSource security categories. Use '" + SQCategory.OTHERS.getKey() + "' to select rules not associated" + - " with any category") + " with any category") .setSince("7.8") .setPossibleValues(Arrays.stream(SQCategory.values()).map(SQCategory::getKey).toList()) .setExampleValue("sql-injection,command-injection,others"); @@ -177,7 +176,6 @@ 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.createParam(PARAM_IMPACT_SOFTWARE_QUALITIES) @@ -201,13 +199,13 @@ public class RuleWsSupport { action .createParam(PARAM_ACTIVATION) .setDescription("Filter rules that are activated or deactivated on the selected Quality profile. Ignored if " + - "the parameter '" + PARAM_QPROFILE + "' is not set.") + "the parameter '" + PARAM_QPROFILE + "' is not set.") .setBooleanPossibleValues(); action .createParam(PARAM_QPROFILE) .setDescription("Quality profile key to filter on. Used only if the parameter '" + - PARAM_ACTIVATION + "' is set.") + PARAM_ACTIVATION + "' is set.") .setExampleValue(UUID_EXAMPLE_01); action.createParam(PARAM_COMPARE_TO_PROFILE) @@ -219,18 +217,17 @@ public class RuleWsSupport { action .createParam(PARAM_INHERITANCE) .setDescription("Comma-separated list of values of inheritance for a rule within a quality profile. Used only if the parameter '" + - PARAM_ACTIVATION + "' is set.") + PARAM_ACTIVATION + "' is set.") .setPossibleValues(ActiveRuleInheritance.NONE.name(), ActiveRuleInheritance.INHERITED.name(), ActiveRuleInheritance.OVERRIDES.name()) .setExampleValue(ActiveRuleInheritance.INHERITED.name() + "," + - ActiveRuleInheritance.OVERRIDES.name()); + ActiveRuleInheritance.OVERRIDES.name()); action .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 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 de20a019288..1562c3ad6f5 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 @@ -144,10 +144,6 @@ public class SearchAction implements RulesWsAction { .addPagingParams(100, MAX_PAGE_SIZE) .setHandler(this) .setChangelog( - new Change("10.8", format("Possible values '%s' and '%s' for response field 'impactSeverities' of 'facets' have been added", INFO.name(), BLOCKER.name())), - new Change("10.8", format("Possible values '%s' and '%s' for response field 'severity' of 'impacts' have been added", INFO.name(), BLOCKER.name())), - new Change("10.8", format("Parameter '%s' now supports values: '%s','%s'", IssuesWsParameters.PARAM_SEVERITIES, INFO.name(), BLOCKER.name())), - new Change("10.6", format("Parameter '%s has been added", PARAM_PRIORITIZED_RULE)), new Change("5.5", "The field 'effortToFixDescription' has been deprecated, use 'gapDescription' instead"), new Change("5.5", "The field 'debtRemFnCoeff' has been deprecated, use 'remFnGapMultiplier' instead"), new Change("5.5", "The field 'defaultDebtRemFnCoeff' has been deprecated, use 'defaultRemFnGapMultiplier' instead"), @@ -190,7 +186,15 @@ public class SearchAction implements RulesWsAction { new Change("10.2", format("Parameters '%s', '%s', and '%s' are now deprecated. Use '%s' and '%s' instead.", PARAM_SEVERITIES, PARAM_TYPES, PARAM_ACTIVE_SEVERITIES, PARAM_IMPACT_SOFTWARE_QUALITIES, PARAM_IMPACT_SEVERITIES)), - new Change("10.8", "The field 'impacts' has been added to the response")); + new Change("10.6", format("Parameter '%s has been added", PARAM_PRIORITIZED_RULE)), + new Change("10.8", format("Possible values '%s' and '%s' for response field 'impactSeverities' of 'facets' have been added", INFO.name(), BLOCKER.name())), + new Change("10.8", format("Possible values '%s' and '%s' for response field 'severity' of 'impacts' have been added", INFO.name(), BLOCKER.name())), + new Change("10.8", format("Parameter '%s' now supports values: '%s','%s'", IssuesWsParameters.PARAM_SEVERITIES, INFO.name(), BLOCKER.name())), + new Change("10.8", "The field 'impacts' has been added to the response"), + new Change("10.8", format("The parameters '%s','%s and '%s' are not deprecated anymore.", PARAM_SEVERITIES, PARAM_TYPES, PARAM_ACTIVE_SEVERITIES)), + new Change("10.8", "The values 'severity' and 'types' for the 'facets' parameter are not deprecated anymore."), + new Change("10.8", "The fields 'type' and 'severity' in the response are not deprecated anymore."), + new Change("10.8", "The value 'severity' for the 'f' parameter is not deprecated anymore.")); action.createParam(FACETS) .setDescription("Comma-separated list of the facets to be computed. No facet is computed by default.") 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 3ce3d1c7186..41e5be91c2f 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 @@ -87,9 +87,8 @@ public class ShowAction implements RulesWsAction { 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", "The field 'severity' and 'type' in the response have been deprecated, use 'impacts' instead."), - new Change("10.8", format("Possible values '%s' and '%s' for response field 'severity' of 'impacts' have been added.", INFO.name(), BLOCKER.name())) - - ); + new Change("10.8", format("Possible values '%s' and '%s' for response field 'severity' of 'impacts' have been added.", INFO.name(), BLOCKER.name())), + new Change("10.8", "The field 'severity' and 'type' in the response are not deprecated anymore.")); 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 b08473e3b89..1f289d2e169 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 @@ -93,8 +93,8 @@ public class UpdateAction implements RulesWsAction { .setChangelog( new Change("10.2", "The field 'severity' and 'type' in the response have been deprecated, use 'impacts' instead."), new Change("10.4", String.format("The parameter '%s' is deprecated.", PARAM_SEVERITY)), - new Change("10.4", "Updating a removed rule is now possible.") - ) + new Change("10.4", "Updating a removed rule is now possible."), + new Change("10.8", String.format("The parameter '%s' is not deprecated anymore.", PARAM_SEVERITY))) .setSince("4.4") .setChangelog( new Change("10.2", "Add 'impacts', 'cleanCodeAttribute', 'cleanCodeAttributeCategory' fields to the response")) @@ -146,7 +146,6 @@ public class UpdateAction implements RulesWsAction { action .createParam(PARAM_SEVERITY) .setDescription("Rule severity (Only when updating a custom rule)") - .setDeprecatedSince("10.4") .setPossibleValues(Severity.ALL); action diff --git a/sonar-ws/src/main/protobuf/ws-rules.proto b/sonar-ws/src/main/protobuf/ws-rules.proto index 43987d7974c..d0e62066763 100644 --- a/sonar-ws/src/main/protobuf/ws-rules.proto +++ b/sonar-ws/src/main/protobuf/ws-rules.proto @@ -78,8 +78,7 @@ message Rule { optional string mdDesc = 7; optional string mdNote = 8; optional string noteLogin = 9; - // Deprecated since 10.2, replace by impacts - optional string severity = 10 [deprecated = true]; + optional string severity = 10; optional sonarqube.ws.commons.RuleStatus status = 11; optional string internalKey = 12; optional bool isTemplate = 13; @@ -107,8 +106,7 @@ message Rule { optional string debtRemFnType = 34 [deprecated = true]; reserved 35; reserved 36; - // Deprecated since 10.2, replace by impacts - optional sonarqube.ws.commons.RuleType type = 37 [deprecated = true]; + optional sonarqube.ws.commons.RuleType type = 37; optional string defaultRemFnType = 38; optional string defaultRemFnGapMultiplier = 39; optional string defaultRemFnBaseEffort = 40; -- 2.39.5