]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-18638 Drop deprecated fields in Rules WS API.
authorDimitris Kavvathas <dimitris.kavvathas@sonarsource.com>
Thu, 9 Mar 2023 16:19:37 +0000 (17:19 +0100)
committersonartech <sonartech@sonarsource.com>
Mon, 13 Mar 2023 20:02:45 +0000 (20:02 +0000)
Drop "effortToFixDescription" and replace with "gapDescription".
Drop "debtRemFnCoeff" and replace with "remFnGapMultiplier".
Drop "defaultDebtRemFnCoeff" and replace with "defaultRemFnGapMultiplier".
Drop "debtRemFnOffset" and replace with "remFnBaseEffort".
Drop "defaultDebtRemFnOffset" and replace with "defaultRemFnBaseEffort".
Correct the version when the field 'scope' was added.
Drop "debtOverloaded" and replace with "remFnOverloaded".
Deprecate "defaultDebtRemFnType" and "debtRemFnType" and replace with "defaultRemFnType" and "remFnType" accordingly.
Deprecate "defaultDebtRemFn" and "debtRemFn" and replace with "defaultRemFn" and "remFn" accordingly.

32 files changed:
server/sonar-webserver-core/src/main/java/org/sonar/server/rule/RegisterRules.java
server/sonar-webserver-core/src/main/java/org/sonar/server/rule/Rule.java [deleted file]
server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/RuleMapper.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/RulesWsParameters.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/SearchAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/ShowAction.java
server/sonar-webserver-webapi/src/main/resources/org/sonar/server/rule/ws/update-example.json
server/sonar-webserver-webapi/src/test/java/org/sonar/server/rule/ws/SearchActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/rule/ws/ShowActionTest.java
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/filter_by_tags.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/get_note_as_markdown_and_html.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/return_mandatory_fields_even_when_setting_f_param.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_2_rules.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_2_rules_fields.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_active_rules.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_active_rules_params.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_debt_rules_with_default_and_overridden_debt_values.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_debt_rules_with_default_linear_offset_and_overridden_constant_debt.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_debt_rules_with_default_linear_offset_and_overridden_linear_debt.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_no_rules.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_profile_active_rules.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_profile_active_rules_inheritance.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_rules_from_template_key.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_rules_with_deprecated_fields.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_template_rules.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/severities_facet.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/statuses_facet.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/statuses_facet_sticky.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/UpdateActionMediumTest/deprecated_remediation_function.json [deleted file]
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/UpdateActionMediumTest/update_custom_rule.json [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/rules/SearchRequest.java
sonar-ws/src/main/protobuf/ws-rules.proto

index 2ef6a85b902496ae19feaa0b38037fd54afdb6ae..6dfc0e417fa611029621f5132cb6d70418ef1ff5 100644 (file)
@@ -547,7 +547,7 @@ public class RegisterRules implements Startable {
   }
 
   private static boolean mergeDebtDefinitions(RuleDto dto, @Nullable String remediationFunction,
-    @Nullable String remediationCoefficient, @Nullable String remediationOffset, @Nullable String effortToFixDescription) {
+    @Nullable String remediationCoefficient, @Nullable String remediationOffset, @Nullable String gapDescription) {
     boolean changed = false;
 
     if (!Objects.equals(dto.getDefRemediationFunction(), remediationFunction)) {
@@ -562,8 +562,8 @@ public class RegisterRules implements Startable {
       dto.setDefRemediationBaseEffort(remediationOffset);
       changed = true;
     }
-    if (!Objects.equals(dto.getGapDescription(), effortToFixDescription)) {
-      dto.setGapDescription(effortToFixDescription);
+    if (!Objects.equals(dto.getGapDescription(), gapDescription)) {
+      dto.setGapDescription(gapDescription);
       changed = true;
     }
     return changed;
@@ -809,7 +809,7 @@ public class RegisterRules implements Startable {
     return changes;
   }
 
-  private Set<String> getExistingAndRenamedRepositories(RegisterRulesContext recorder, Collection<RulesDefinition.Repository> context) {
+  private static Set<String> getExistingAndRenamedRepositories(RegisterRulesContext recorder, Collection<RulesDefinition.Repository> context) {
     return Stream.concat(
         context.stream().map(RulesDefinition.ExtendedRepository::key),
         recorder.getRenamed().map(Map.Entry::getValue).map(RuleKey::repository))
diff --git a/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/Rule.java b/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/Rule.java
deleted file mode 100644 (file)
index 8cdb0d1..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.server.rule;
-
-import org.sonar.api.rule.RuleKey;
-import org.sonar.api.rule.RuleStatus;
-import org.sonar.api.server.debt.DebtRemediationFunction;
-
-import javax.annotation.CheckForNull;
-
-import java.util.Date;
-import java.util.List;
-
-/**
- * @since 4.4
- */
-public interface Rule {
-
-  RuleKey key();
-
-  String language();
-
-  String name();
-
-  @CheckForNull
-  String htmlDescription();
-
-  @CheckForNull
-  String markdownDescription();
-
-  String effortToFixDescription();
-
-  /**
-   * Default severity when activated on a Quality profile
-   *
-   * @see org.sonar.api.rule.Severity
-   */
-  String severity();
-
-  /**
-   * @see org.sonar.api.rule.RuleStatus
-   */
-  RuleStatus status();
-
-  boolean isTemplate();
-
-  @CheckForNull
-  RuleKey templateKey();
-
-  /**
-   * Tags that can be customized by administrators
-   */
-  List<String> tags();
-
-  /**
-   * Read-only tags defined by plugins
-   */
-  List<String> systemTags();
-
-  List<RuleParam> params();
-
-  @CheckForNull
-  RuleParam param(final String key);
-
-  boolean debtOverloaded();
-
-  @CheckForNull
-  DebtRemediationFunction debtRemediationFunction();
-
-  @CheckForNull
-  DebtRemediationFunction defaultDebtRemediationFunction();
-
-  Date createdAt();
-
-  Date updatedAt();
-
-  @CheckForNull
-  String internalKey();
-
-  @CheckForNull
-  String markdownNote();
-
-  @CheckForNull
-  String noteLogin();
-
-  @CheckForNull
-  Date noteCreatedAt();
-
-  @CheckForNull
-  Date noteUpdatedAt();
-
-  boolean isManual();
-}
index efba2d8021340a0bb02f2d346d1135bc82efba6a..d468757279655be65c2bb4b06c16d05bc205b906 100644 (file)
@@ -53,14 +53,12 @@ import static org.sonar.api.utils.DateUtils.formatDateTime;
 import static org.sonar.core.util.stream.MoreCollectors.toList;
 import static org.sonar.db.rule.RuleDto.Format.MARKDOWN;
 import static org.sonar.server.rule.ws.RulesWsParameters.FIELD_CREATED_AT;
-import static org.sonar.server.rule.ws.RulesWsParameters.FIELD_DEBT_OVERLOADED;
 import static org.sonar.server.rule.ws.RulesWsParameters.FIELD_DEBT_REM_FUNCTION;
 import static org.sonar.server.rule.ws.RulesWsParameters.FIELD_DEFAULT_DEBT_REM_FUNCTION;
 import static org.sonar.server.rule.ws.RulesWsParameters.FIELD_DEFAULT_REM_FUNCTION;
 import static org.sonar.server.rule.ws.RulesWsParameters.FIELD_DEPRECATED_KEYS;
 import static org.sonar.server.rule.ws.RulesWsParameters.FIELD_DESCRIPTION_SECTIONS;
 import static org.sonar.server.rule.ws.RulesWsParameters.FIELD_EDUCATION_PRINCIPLES;
-import static org.sonar.server.rule.ws.RulesWsParameters.FIELD_EFFORT_TO_FIX_DESCRIPTION;
 import static org.sonar.server.rule.ws.RulesWsParameters.FIELD_GAP_DESCRIPTION;
 import static org.sonar.server.rule.ws.RulesWsParameters.FIELD_HTML_DESCRIPTION;
 import static org.sonar.server.rule.ws.RulesWsParameters.FIELD_INTERNAL_KEY;
@@ -136,7 +134,7 @@ public class RuleMapper {
     setIsExternal(ruleResponse, ruleDto, fieldsToReturn);
     setTemplateKey(ruleResponse, ruleDto, result, fieldsToReturn);
     setDefaultDebtRemediationFunctionFields(ruleResponse, ruleDto, fieldsToReturn);
-    setEffortToFixDescription(ruleResponse, ruleDto, fieldsToReturn);
+    setGapDescription(ruleResponse, ruleDto, fieldsToReturn);
     setScope(ruleResponse, ruleDto, fieldsToReturn);
     setDeprecatedKeys(ruleResponse, ruleDto, fieldsToReturn, deprecatedRuleKeysByRuleUuid);
 
@@ -235,18 +233,16 @@ public class RuleMapper {
     }
   }
 
-  private static void setEffortToFixDescription(Rules.Rule.Builder ruleResponse, RuleDto ruleDto, Set<String> fieldsToReturn) {
+  private static void setGapDescription(Rules.Rule.Builder ruleResponse, RuleDto ruleDto, Set<String> fieldsToReturn) {
     String gapDescription = ruleDto.getGapDescription();
-    if ((shouldReturnField(fieldsToReturn, FIELD_EFFORT_TO_FIX_DESCRIPTION) || shouldReturnField(fieldsToReturn, FIELD_GAP_DESCRIPTION))
+    if (shouldReturnField(fieldsToReturn, FIELD_GAP_DESCRIPTION)
       && gapDescription != null) {
-      ruleResponse.setEffortToFixDescription(gapDescription);
       ruleResponse.setGapDescription(gapDescription);
     }
   }
 
   private static void setIsRemediationFunctionOverloaded(Rules.Rule.Builder ruleResponse, RuleDto ruleDto, Set<String> fieldsToReturn) {
-    if (shouldReturnField(fieldsToReturn, FIELD_DEBT_OVERLOADED) || shouldReturnField(fieldsToReturn, FIELD_REM_FUNCTION_OVERLOADED)) {
-      ruleResponse.setDebtOverloaded(isRemediationFunctionOverloaded(ruleDto));
+    if (shouldReturnField(fieldsToReturn, FIELD_REM_FUNCTION_OVERLOADED)) {
       ruleResponse.setRemFnOverloaded(isRemediationFunctionOverloaded(ruleDto));
     }
   }
@@ -258,14 +254,10 @@ public class RuleMapper {
         String gapMultiplier = defaultDebtRemediationFunction.gapMultiplier();
         if (gapMultiplier != null) {
           ruleResponse.setDefaultRemFnGapMultiplier(gapMultiplier);
-          // Set deprecated field
-          ruleResponse.setDefaultDebtRemFnCoeff(gapMultiplier);
         }
         String baseEffort = defaultDebtRemediationFunction.baseEffort();
         if (baseEffort != null) {
           ruleResponse.setDefaultRemFnBaseEffort(baseEffort);
-          // Set deprecated field
-          ruleResponse.setDefaultDebtRemFnOffset(baseEffort);
         }
         if (defaultDebtRemediationFunction.type() != null) {
           ruleResponse.setDefaultRemFnType(defaultDebtRemediationFunction.type().name());
@@ -289,14 +281,10 @@ public class RuleMapper {
         String gapMultiplier = debtRemediationFunction.gapMultiplier();
         if (gapMultiplier != null) {
           ruleResponse.setRemFnGapMultiplier(gapMultiplier);
-          // Set deprecated field
-          ruleResponse.setDebtRemFnCoeff(gapMultiplier);
         }
         String baseEffort = debtRemediationFunction.baseEffort();
         if (baseEffort != null) {
           ruleResponse.setRemFnBaseEffort(baseEffort);
-          // Set deprecated field
-          ruleResponse.setDebtRemFnOffset(baseEffort);
         }
       }
     }
index 0e8099ed6bad848d2a4ce9d64c2ba5be23022a15..a89544f995eb8b6cef8077651ab639636b887319 100644 (file)
@@ -68,31 +68,29 @@ public class RulesWsParameters {
   public static final String FIELD_HTML_NOTE = "htmlNote";
 
   /**
-   * @deprecated since 5.5, replaced by {@link #FIELD_DEFAULT_REM_FUNCTION}
+   * Value for 'f' parameter which is used to return all the "defaultDebtRemFn" fields.
+   *
+   * @deprecated since 10.0, replaced by {@link #FIELD_DEFAULT_REM_FUNCTION}
    */
-  @Deprecated
+  @Deprecated(since = "10.0")
   public static final String FIELD_DEFAULT_DEBT_REM_FUNCTION = "defaultDebtRemFn";
+  /**
+   * Value for 'f' parameter which is used to return all the "defaultRemFn" fields.
+   */
   public static final String FIELD_DEFAULT_REM_FUNCTION = "defaultRemFn";
 
   /**
-   * @deprecated since 5.5, replaced by {@link #FIELD_REM_FUNCTION}
+   * Value for 'f' parameter which is used to return all the "debtRemFn" fields.
+   *
+   * @deprecated since 10.0, replaced by {@link #FIELD_REM_FUNCTION}
    */
-  @Deprecated
+  @Deprecated(since = "10.0")
   public static final String FIELD_DEBT_REM_FUNCTION = "debtRemFn";
-  public static final String FIELD_REM_FUNCTION = "remFn";
-
   /**
-   * @deprecated since 5.5, replaced by {@link #FIELD_GAP_DESCRIPTION}
+   * Value for 'f' parameter which is used to return all the "remFn" fields.
    */
-  @Deprecated
-  public static final String FIELD_EFFORT_TO_FIX_DESCRIPTION = "effortToFixDescription";
+  public static final String FIELD_REM_FUNCTION = "remFn";
   public static final String FIELD_GAP_DESCRIPTION = "gapDescription";
-
-  /**
-   * @deprecated since 5.5, replaced by {@link #FIELD_REM_FUNCTION_OVERLOADED}
-   */
-  @Deprecated
-  public static final String FIELD_DEBT_OVERLOADED = "debtOverloaded";
   public static final String FIELD_REM_FUNCTION_OVERLOADED = "remFnOverloaded";
 
   /**
@@ -108,7 +106,7 @@ public class RulesWsParameters {
   public static final Set<String> OPTIONAL_FIELDS = Set.of(FIELD_REPO, FIELD_NAME, FIELD_CREATED_AT, FIELD_UPDATED_AT, FIELD_SEVERITY, FIELD_STATUS, FIELD_INTERNAL_KEY,
     FIELD_IS_EXTERNAL, FIELD_IS_TEMPLATE, FIELD_TEMPLATE_KEY, FIELD_TAGS, FIELD_SYSTEM_TAGS, FIELD_LANGUAGE, FIELD_LANGUAGE_NAME, FIELD_HTML_DESCRIPTION,
     FIELD_MARKDOWN_DESCRIPTION, FIELD_DESCRIPTION_SECTIONS, FIELD_NOTE_LOGIN, FIELD_MARKDOWN_NOTE, FIELD_HTML_NOTE,
-    FIELD_DEFAULT_DEBT_REM_FUNCTION, FIELD_EFFORT_TO_FIX_DESCRIPTION, FIELD_DEBT_OVERLOADED, FIELD_DEBT_REM_FUNCTION,
+    FIELD_DEFAULT_DEBT_REM_FUNCTION, FIELD_DEBT_REM_FUNCTION,
     FIELD_DEFAULT_REM_FUNCTION, FIELD_GAP_DESCRIPTION, FIELD_REM_FUNCTION_OVERLOADED, FIELD_REM_FUNCTION,
     FIELD_PARAMS, FIELD_ACTIVES, FIELD_SCOPE, FIELD_DEPRECATED_KEYS, FIELD_EDUCATION_PRINCIPLES);
 
index bfcbd6632aca7f0b3148252b98b16c4d0a44e2a7..69ba17ff1cbd3f57a8597d2dccb83976ed60fb19 100644 (file)
@@ -20,7 +20,6 @@
 package org.sonar.server.rule.ws;
 
 import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.ListMultimap;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
@@ -99,7 +98,7 @@ import static org.sonar.server.ws.WsUtils.writeProtobuf;
 public class SearchAction implements RulesWsAction {
   public static final String ACTION = "search";
 
-  private static final Collection<String> DEFAULT_FACETS = ImmutableSet.of(PARAM_LANGUAGES, PARAM_REPOSITORIES, "tags");
+  private static final Collection<String> DEFAULT_FACETS = Set.of(PARAM_LANGUAGES, PARAM_REPOSITORIES, "tags");
   private static final String[] POSSIBLE_FACETS = new String[]{
     FACET_LANGUAGES,
     FACET_REPOSITORIES,
@@ -140,21 +139,32 @@ public class SearchAction implements RulesWsAction {
       .setChangelog(
         new Change("9.8", "response fields 'total', 's', 'ps' have been deprecated, please use 'paging' object instead"),
         new Change("9.8", "The field 'paging' has been added to the response"),
-        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"),
-        new Change("5.5", "The field 'debtRemFnOffset' has been deprecated use 'remFnBaseEffort' instead"),
-        new Change("5.5", "The field 'defaultDebtRemFnOffset' has been deprecated use 'defaultRemFnBaseEffort' instead"),
+        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"),
+        new Change("5.5", "The field 'debtRemFnOffset' has been deprecated, use 'remFnBaseEffort' instead"),
+        new Change("5.5", "The field 'defaultDebtRemFnOffset' has been deprecated, use 'defaultRemFnBaseEffort' instead"),
+        new Change("5.5", "The field 'debtOverloaded' has been deprecated, use 'remFnOverloaded' instead"),
         new Change("7.1", "The field 'scope' has been added to the response"),
         new Change("7.1", "The field 'scope' has been added to the 'f' parameter"),
         new Change("7.2", "The field 'isExternal' has been added to the response"),
         new Change("7.2", "The field 'includeExternal' has been added to the 'f' parameter"),
         new Change("7.5", "The field 'updatedAt' has been added to the 'f' parameter"),
-        new Change("9.5", "The field 'htmlDesc' has been deprecated use 'descriptionSections' instead"),
+        new Change("9.5", "The field 'htmlDesc' has been deprecated, use 'descriptionSections' instead"),
         new Change("9.5", "The field 'descriptionSections' has been added to the payload"),
         new Change("9.5", "The field 'descriptionSections' has been added to the 'f' parameter"),
         new Change("9.6", "'descriptionSections' can optionally embed a context field"),
-        new Change("9.6", "The field 'educationPrinciples' has been added to the 'f' parameter")
+        new Change("9.6", "The field 'educationPrinciples' has been added to the 'f' parameter"),
+        new Change("10.0", "The deprecated field 'effortToFixDescription' has been removed, use 'gapDescription' instead."),
+        new Change("10.0", "The deprecated field 'debtRemFnCoeff' has been removed, use 'remFnGapMultiplier' instead."),
+        new Change("10.0", "The deprecated field 'defaultDebtRemFnCoeff' has been removed, use 'defaultRemFnGapMultiplier' instead."),
+        new Change("10.0", "The deprecated field 'debtRemFnOffset' has been removed, use 'remFnBaseEffort' instead."),
+        new Change("10.0", "The deprecated field 'defaultDebtRemFnOffset' has been removed, use 'defaultRemFnBaseEffort' instead."),
+        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.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")
       );
 
     action.createParam(FACETS)
index ec77ecaa08ebeb2790823a9edac601fe4157fb17..32d3a5c62da8d226f0d224cd5fd0632d4cec285c 100644 (file)
@@ -69,17 +69,25 @@ public class ShowAction implements RulesWsAction {
       .setResponseExample(Resources.getResource(getClass(), "show-example.json"))
       .setHandler(this)
       .setChangelog(
-        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"),
-        new Change("5.5", "The field 'debtRemFnOffset' has been deprecated use 'remFnBaseEffort' instead"),
-        new Change("5.5", "The field 'defaultDebtRemFnOffset' has been deprecated use 'defaultRemFnBaseEffort' instead"),
-        new Change("5.5", "The field 'debtOverloaded' has been deprecated use 'remFnOverloaded' instead"),
-        new Change("7.5", "The field 'scope' has been added"),
-        new Change("9.5", "The field 'htmlDesc' has been deprecated use 'descriptionSections' instead"),
-        new Change("9.5", "The field 'descriptionSections' has been added to the payload"),
-        new Change("9.6", "'descriptionSections' can optionally embed a context field"),
-        new Change("9.6", "'educationPrinciples' has been added")
+        new Change("5.5", "The field 'effortToFixDescription' in the response has been deprecated, it becomes 'gapDescription'."),
+        new Change("5.5", "The field 'debtRemFnCoeff' in the response has been deprecated, it becomes 'remFnGapMultiplier'."),
+        new Change("5.5", "The field 'defaultDebtRemFnCoeff' in the response has been deprecated, it becomes 'defaultRemFnGapMultiplier'."),
+        new Change("5.5", "The field 'debtRemFnOffset' in the response has been deprecated, it becomes 'remFnBaseEffort'."),
+        new Change("5.5", "The field 'defaultDebtRemFnOffset' in the response has been deprecated, it becomes 'defaultRemFnBaseEffort'."),
+        new Change("5.5", "The field 'debtOverloaded' in the response has been deprecated, it becomes 'remFnOverloaded'."),
+        new Change("7.1", "The field 'scope' has been added."),
+        new Change("9.5", "The field 'htmlDesc' in the response has been deprecated, it becomes 'descriptionSections'."),
+        new Change("9.5", "The field 'descriptionSections' has been added to the payload."),
+        new Change("9.6", "'descriptionSections' can optionally embed a context field."),
+        new Change("9.6", "'educationPrinciples' has been added."),
+        new Change("10.0", "The deprecated field 'effortToFixDescription' has been removed, use 'gapDescription' instead."),
+        new Change("10.0", "The deprecated field 'debtRemFnCoeff' has been removed, use 'remFnGapMultiplier' instead."),
+        new Change("10.0", "The deprecated field 'defaultDebtRemFnCoeff' has been removed, use 'defaultRemFnGapMultiplier' instead."),
+        new Change("10.0", "The deprecated field 'debtRemFnOffset' has been removed, use 'remFnBaseEffort' instead."),
+        new Change("10.0", "The deprecated field 'defaultDebtRemFnOffset' has been removed, use 'defaultRemFnBaseEffort' instead."),
+        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")
       );
 
     action
index 1b8d109ce6ed0dea0ed7a4e4a73ba09ecbe1e456..667cac2768ec5b715687cb742c90e046fe9e9a1c 100644 (file)
@@ -21,7 +21,6 @@
       "defaultValue":"**/Sonar*","type":"STRING"
     }
     ],
-    "debtOverloaded":false,
     "remFnOverloaded":false,
     "scope":"MAIN",
     "isExternal":false,
index dd5cfece4ff0afc6aef59e1326aaeb1cb0a1e6a0..a358b2efa2ac3473d937f7634ee7f4e6ba242504 100644 (file)
@@ -312,7 +312,7 @@ public class SearchActionTest {
     Rules.SearchResponse response = ws.newRequest().executeProtobuf(Rules.SearchResponse.class);
     Rules.Rule result = response.getRules(0);
     assertThat(result.getCreatedAt()).isNotEmpty();
-    assertThat(result.getEffortToFixDescription()).isNotEmpty();
+    assertThat(result.getGapDescription()).isNotEmpty();
     assertThat(result.getHtmlDesc()).isNotEmpty();
     assertThat(result.hasIsTemplate()).isTrue();
     assertThat(result.getLang()).isEqualTo(rule.getLanguage());
@@ -343,7 +343,7 @@ public class SearchActionTest {
     assertThat(result.getEducationPrinciples().getEducationPrinciplesList()).containsExactlyElementsOf(rule.getEducationPrinciples());
 
     // not returned fields
-    assertThat(result.hasEffortToFixDescription()).isFalse();
+    assertThat(result.hasGapDescription()).isFalse();
     assertThat(result.hasHtmlDesc()).isFalse();
     assertThat(result.hasIsTemplate()).isFalse();
     assertThat(result.hasLang()).isFalse();
@@ -566,7 +566,7 @@ public class SearchActionTest {
     indexRules();
 
     SearchResponse result = ws.newRequest()
-      .setParam("f", "debtRemFn,debtOverloaded,defaultDebtRemFn")
+      .setParam("f", "debtRemFn,remFnOverloaded,defaultDebtRemFn")
       .executeProtobuf(SearchResponse.class);
     assertThat(result.getTotal()).isOne();
     assertThat(result.getPaging().getTotal()).isOne();
@@ -575,15 +575,15 @@ public class SearchActionTest {
 
     Rule searchedRule = result.getRules(0);
     assertThat(searchedRule).isNotNull();
-    assertThat(searchedRule.getDefaultDebtRemFnCoeff()).isEqualTo("1h");
-    assertThat(searchedRule.getDefaultDebtRemFnOffset()).isEqualTo("15min");
+    assertThat(searchedRule.getDefaultRemFnGapMultiplier()).isEqualTo("1h");
+    assertThat(searchedRule.getDefaultRemFnBaseEffort()).isEqualTo("15min");
     assertThat(searchedRule.getDefaultDebtRemFnType()).isEqualTo(DebtRemediationFunction.Type.LINEAR_OFFSET.name());
     assertThat(searchedRule.getDefaultRemFnBaseEffort()).isEqualTo("15min");
     assertThat(searchedRule.getDefaultRemFnGapMultiplier()).isEqualTo("1h");
     assertThat(searchedRule.getDefaultRemFnType()).isEqualTo(DebtRemediationFunction.Type.LINEAR_OFFSET.name());
-    assertThat(searchedRule.getDebtOverloaded()).isTrue();
-    assertThat(searchedRule.getDebtRemFnCoeff()).isEqualTo("2h");
-    assertThat(searchedRule.getDebtRemFnOffset()).isEqualTo("25min");
+    assertThat(searchedRule.getRemFnOverloaded()).isTrue();
+    assertThat(searchedRule.getRemFnGapMultiplier()).isEqualTo("2h");
+    assertThat(searchedRule.getRemFnBaseEffort()).isEqualTo("25min");
     assertThat(searchedRule.getDebtRemFnType()).isEqualTo(DebtRemediationFunction.Type.LINEAR_OFFSET.name());
   }
 
@@ -600,7 +600,7 @@ public class SearchActionTest {
     indexRules();
 
     SearchResponse result = ws.newRequest()
-      .setParam("f", "debtRemFn,debtOverloaded,defaultDebtRemFn")
+      .setParam("f", "debtRemFn,remFnOverloaded,defaultDebtRemFn")
       .executeProtobuf(SearchResponse.class);
     assertThat(result.getTotal()).isOne();
     assertThat(result.getPaging().getTotal()).isOne();
@@ -609,15 +609,15 @@ public class SearchActionTest {
 
     Rule searchedRule = result.getRules(0);
     assertThat(searchedRule).isNotNull();
-    assertThat(searchedRule.getDefaultDebtRemFnCoeff()).isEqualTo("1h");
-    assertThat(searchedRule.getDefaultDebtRemFnOffset()).isEqualTo("15min");
+    assertThat(searchedRule.getDefaultRemFnGapMultiplier()).isEqualTo("1h");
+    assertThat(searchedRule.getDefaultRemFnBaseEffort()).isEqualTo("15min");
     assertThat(searchedRule.getDefaultDebtRemFnType()).isEqualTo(DebtRemediationFunction.Type.LINEAR_OFFSET.name());
     assertThat(searchedRule.getDefaultRemFnBaseEffort()).isEqualTo("15min");
     assertThat(searchedRule.getDefaultRemFnGapMultiplier()).isEqualTo("1h");
     assertThat(searchedRule.getDefaultRemFnType()).isEqualTo(DebtRemediationFunction.Type.LINEAR_OFFSET.name());
-    assertThat(searchedRule.getDebtOverloaded()).isTrue();
-    assertThat(searchedRule.getDebtRemFnCoeff()).isEmpty();
-    assertThat(searchedRule.getDebtRemFnOffset()).isEqualTo("5min");
+    assertThat(searchedRule.getRemFnOverloaded()).isTrue();
+    assertThat(searchedRule.getRemFnGapMultiplier()).isEmpty();
+    assertThat(searchedRule.getRemFnBaseEffort()).isEqualTo("5min");
     assertThat(searchedRule.getDebtRemFnType()).isEqualTo(DebtRemediationFunction.Type.CONSTANT_ISSUE.name());
   }
 
@@ -634,7 +634,7 @@ public class SearchActionTest {
     indexRules();
 
     SearchResponse result = ws.newRequest()
-      .setParam("f", "debtRemFn,debtOverloaded,defaultDebtRemFn")
+      .setParam("f", "debtRemFn,remFnOverloaded,defaultDebtRemFn")
       .executeProtobuf(SearchResponse.class);
     assertThat(result.getTotal()).isOne();
     assertThat(result.getPaging().getTotal()).isOne();
@@ -643,15 +643,15 @@ public class SearchActionTest {
 
     Rule searchedRule = result.getRules(0);
     assertThat(searchedRule).isNotNull();
-    assertThat(searchedRule.getDefaultDebtRemFnCoeff()).isEqualTo("1h");
-    assertThat(searchedRule.getDefaultDebtRemFnOffset()).isEqualTo("15min");
+    assertThat(searchedRule.getDefaultRemFnGapMultiplier()).isEqualTo("1h");
+    assertThat(searchedRule.getDefaultRemFnBaseEffort()).isEqualTo("15min");
     assertThat(searchedRule.getDefaultDebtRemFnType()).isEqualTo(DebtRemediationFunction.Type.LINEAR_OFFSET.name());
     assertThat(searchedRule.getDefaultRemFnBaseEffort()).isEqualTo("15min");
     assertThat(searchedRule.getDefaultRemFnGapMultiplier()).isEqualTo("1h");
     assertThat(searchedRule.getDefaultRemFnType()).isEqualTo(DebtRemediationFunction.Type.LINEAR_OFFSET.name());
-    assertThat(searchedRule.getDebtOverloaded()).isTrue();
-    assertThat(searchedRule.getDebtRemFnCoeff()).isEqualTo("1h");
-    assertThat(searchedRule.getDebtRemFnOffset()).isEmpty();
+    assertThat(searchedRule.getRemFnOverloaded()).isTrue();
+    assertThat(searchedRule.getRemFnGapMultiplier()).isEqualTo("1h");
+    assertThat(searchedRule.getRemFnBaseEffort()).isEmpty();
     assertThat(searchedRule.getDebtRemFnType()).isEqualTo(DebtRemediationFunction.Type.LINEAR.name());
   }
 
index a955a8541fad7b2e282ac55ba6ca46eab8fd44a6..70e917819b5aa2e2a341ece098ed59a31999fb70 100644 (file)
@@ -287,13 +287,13 @@ public class ShowActionTest {
 
     Rule resultRule = result.getRule();
     assertThat(resultRule.getDefaultRemFnType()).isEqualTo("LINEAR_OFFSET");
-    assertThat(resultRule.getDefaultDebtRemFnCoeff()).isEqualTo("5d");
-    assertThat(resultRule.getDefaultDebtRemFnOffset()).isEqualTo("10h");
-    assertThat(resultRule.getEffortToFixDescription()).isEqualTo("gap desc");
+    assertThat(resultRule.getDefaultRemFnGapMultiplier()).isEqualTo("5d");
+    assertThat(resultRule.getDefaultRemFnBaseEffort()).isEqualTo("10h");
+    assertThat(resultRule.getGapDescription()).isEqualTo("gap desc");
     assertThat(resultRule.getDebtRemFnType()).isEqualTo("CONSTANT_ISSUE");
-    assertThat(resultRule.hasDebtRemFnCoeff()).isFalse();
-    assertThat(resultRule.getDebtRemFnOffset()).isEqualTo("15h");
-    assertThat(resultRule.getDebtOverloaded()).isTrue();
+    assertThat(resultRule.hasRemFnGapMultiplier()).isFalse();
+    assertThat(resultRule.getRemFnBaseEffort()).isEqualTo("15h");
+    assertThat(resultRule.getRemFnOverloaded()).isTrue();
     assertThat(resultRule.hasDeprecatedKeys()).isFalse();
   }
 
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/filter_by_tags.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/filter_by_tags.json
deleted file mode 100644 (file)
index 20697e5..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-{
-  "total": 1,
-  "p": 1,
-  "ps": 100,
-  "paging": {
-    "pageIndex": 1,
-    "pageSize": 100,
-    "total": 1
-  },
-  "rules": [
-    {
-      "key": "xoo:x1",
-      "sysTags": ["tag1"],
-      "tags": []
-    }
-  ],
-  "facets": [
-  {
-    "property": "tags",
-    "values": [
-      {
-        "val": "tag1",
-        "count": 1
-      },
-      {
-        "val": "tag2",
-        "count": 1
-      }
-    ]
-  }
-]}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/get_note_as_markdown_and_html.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/get_note_as_markdown_and_html.json
deleted file mode 100644 (file)
index fcee129..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-{
-  "total": 1,
-  "p": 1,
-  "ps": 100,
-  "paging": {
-    "pageIndex": 1,
-    "pageSize": 100,
-    "total": 1
-  },
-  "rules": [
-    {
-      "key": "xoo:x1",
-      "htmlNote": "this is <strong>bold</strong>",
-      "mdNote": "this is *bold*"
-    }
-  ]}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/return_mandatory_fields_even_when_setting_f_param.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/return_mandatory_fields_even_when_setting_f_param.json
deleted file mode 100644 (file)
index f3a9823..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "rules": [
-    {
-      "key": "xoo:x1",
-      "name": "Rule x1",
-      "type": "CODE_SMELL"
-    }
-  ]
-}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_2_rules.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_2_rules.json
deleted file mode 100644 (file)
index cd8c702..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-{
-  "total": 2,
-  "p": 1,
-  "ps": 100,
-  "paging": {
-    "pageIndex": 1,
-    "pageSize": 100,
-    "total": 2
-  },
-  "rules": [
-    {
-      "key": "xoo:x2",
-      "repo": "xoo",
-      "name": "Rule x2",
-      "htmlDesc": "Description x2",
-      "severity": "INFO",
-      "status": "READY",
-      "internalKey": "InternalKeyx2",
-      "isTemplate": false,
-      "tags": [
-        "tag1",
-        "tag2"
-      ],
-      "sysTags": [
-        "systag1",
-        "systag2"
-      ],
-      "debtRemFnType": "LINEAR",
-      "debtRemFnCoeff": "1h",
-      "lang": "xoo",
-      "type": "VULNERABILITY",
-      "params": []
-    },
-    {
-      "key": "xoo:x1",
-      "repo": "xoo",
-      "name": "Rule x1",
-      "htmlDesc": "Description x1",
-      "severity": "INFO",
-      "status": "READY",
-      "internalKey": "InternalKeyx1",
-      "isTemplate": false,
-      "tags": [
-        "tag1",
-        "tag2"
-      ],
-      "sysTags": [
-        "systag1",
-        "systag2"
-      ],
-      "debtRemFnType": "LINEAR",
-      "debtRemFnCoeff": "1h",
-      "lang": "xoo",
-      "type": "BUG",
-      "params": []
-    }
-  ]
-}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_2_rules_fields.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_2_rules_fields.json
deleted file mode 100644 (file)
index 404203e..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-{
-  "total": 2,
-  "p": 1,
-  "ps": 100,
-  "paging": {
-    "pageIndex": 1,
-    "pageSize": 100,
-    "total": 2
-  },
-  "rules": [
-    {
-      "key": "xoo:x2",
-      "name": "Rule x2",
-      "mdDesc": "A *Xoo* rule",
-      "htmlDesc": "A <strong>Xoo</strong> rule",
-      "type": "BUG"
-    },
-    {
-      "key": "xoo:x1",
-      "name": "Rule x1",
-      "htmlDesc": "Description x1",
-      "type": "CODE_SMELL"
-    }
-  ]
-}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_active_rules.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_active_rules.json
deleted file mode 100644 (file)
index fdc460c..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-  "total": 1,
-  "p": 1,
-  "ps": 100,
-  "paging": {
-    "pageIndex": 1,
-    "pageSize": 100,
-    "total": 2
-  },
-  "rules": [
-    {
-      "key": "xoo:x1"
-    }
-  ]}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_active_rules_params.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_active_rules_params.json
deleted file mode 100644 (file)
index c8edf1a..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-{"total": 1, "p": 1, "ps": 100, "rules": [
-  {
-    "key": "xoo:x1",
-    "params": [
-      {
-        "key": "my_var",
-        "htmlDesc": "My small description",
-        "defaultValue": "some value",
-        "type": "string"
-      },
-      {
-        "key": "the_var",
-        "htmlDesc": "My small description",
-        "defaultValue": "other value",
-        "type": "integer"
-      }
-    ]
-  }
-]
-}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_debt_rules_with_default_and_overridden_debt_values.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_debt_rules_with_default_and_overridden_debt_values.json
deleted file mode 100644 (file)
index 2fce4c1..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-{
-  "total": 1,
-  "p": 1,
-  "ps": 100,
-  "paging": {
-    "pageIndex": 1,
-    "pageSize": 100,
-    "total": 1
-  },
-  "rules": [
-  {
-    "key": "xoo:x1",
-    "remFnType": "LINEAR_OFFSET",
-    "remFnGapMultiplier": "2h",
-    "remFnBaseEffort": "25min",
-    "debtOverloaded": true,
-    "defaultRemFnType": "LINEAR_OFFSET",
-    "defaultRemFnGapMultiplier": "1h",
-    "defaultRemFnBaseEffort": "15min"
-  }
-]}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_debt_rules_with_default_linear_offset_and_overridden_constant_debt.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_debt_rules_with_default_linear_offset_and_overridden_constant_debt.json
deleted file mode 100644 (file)
index 435010e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-{
-  "total": 1,
-  "p": 1,
-  "ps": 100,
-  "paging": {
-    "pageIndex": 1,
-    "pageSize": 100,
-    "total": 1
-  },
-  "rules": [
-    {
-      "key": "xoo:x1",
-      "remFnType": "CONSTANT_ISSUE",
-      "remFnBaseEffort": "5min",
-      "debtOverloaded": true,
-      "defaultRemFnType": "LINEAR_OFFSET",
-      "defaultRemFnGapMultiplier": "1h",
-      "defaultRemFnBaseEffort": "15min"
-    }
-  ]
-}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_debt_rules_with_default_linear_offset_and_overridden_linear_debt.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_debt_rules_with_default_linear_offset_and_overridden_linear_debt.json
deleted file mode 100644 (file)
index 684826b..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "total": 1,
-  "p": 1,
-  "ps": 100,
-  "paging": {
-    "pageIndex": 1,
-    "pageSize": 100,
-    "total": 1
-  },
-  "rules": [
-  {
-    "key": "xoo:x1",
-    "remFnType": "LINEAR",
-    "remFnGapMultiplier": "1h",
-    "debtOverloaded": true,
-    "defaultRemFnType": "LINEAR_OFFSET",
-    "defaultRemFnGapMultiplier": "1h",
-    "defaultRemFnBaseEffort": "15min"
-  }
-]}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_no_rules.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_no_rules.json
deleted file mode 100644 (file)
index f62d343..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-    "total": 0,
-    "p": 1,
-    "ps": 100,
-    "paging": {
-        "pageIndex": 1,
-        "pageSize": 100,
-        "total": 99999
-    },
-    "rules": [],
-    "actives": {},
-    "qProfiles": {}
-}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_profile_active_rules.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_profile_active_rules.json
deleted file mode 100644 (file)
index 293af7e..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-{
-  "total": 1,
-  "p": 1,
-  "ps": 100,
-  "rules": [
-    {
-      "key": "xoo:x1"
-    }
-  ],
-  "actives": {
-    "xoo:x1": [
-      {
-        "qProfile": "XOO_P2",
-        "inherit": "NONE",
-        "severity": "BLOCKER",
-        "params": [
-          {
-            "key": "the_var",
-            "value": "The Other Value"
-          },
-          {
-            "key": "my_var",
-            "value": "The VALUE"
-          },
-          {
-            "key": "empty_var",
-            "value": ""
-          }
-        ]
-      }
-    ]
-  },
-  "qProfiles": {
-    "XOO_P2": {
-      "name": "P2",
-      "lang": "xoo",
-      "langName": "Xoo"
-    }
-  }
-}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_profile_active_rules_inheritance.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_profile_active_rules_inheritance.json
deleted file mode 100644 (file)
index 016101f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-{
-  "total": 1,
-  "p": 1,
-  "ps": 100,
-  "rules": [
-    {
-      "key": "xoo:x1"
-    }
-  ],
-  "actives": {
-    "xoo:x1": [
-      {
-        "qProfile": "XOO_P2",
-        "inherit": "OVERRIDES",
-        "severity": "CRITICAL",
-        "params": []
-      }
-    ]
-  },
-  "qProfiles": {
-    "XOO_P2": {
-      "name": "P2",
-      "lang": "xoo",
-      "langName": "Xoo",
-      "parent": "XOO_P1"
-    },
-    "XOO_P1": {
-      "name": "P1",
-      "lang": "xoo",
-      "langName": "Xoo"
-    }
-  }
-}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_rules_from_template_key.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_rules_from_template_key.json
deleted file mode 100644 (file)
index f966859..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-  "total": 1, "p": 1, "ps": 100,
-  "rules": [
-    {
-      "key": "xoo:x2",
-      "templateKey": "xoo:x1"
-    }
-  ]}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_rules_with_deprecated_fields.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_rules_with_deprecated_fields.json
deleted file mode 100644 (file)
index 6bac105..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-{
-  "rules": [
-    {
-      "key": "xoo:x1",
-      "name": "Rule x1",
-      "defaultDebtRemFnType": "LINEAR_OFFSET",
-      "defaultDebtRemFnCoeff": "1h",
-      "defaultDebtRemFnOffset": "15min",
-      "effortToFixDescription": "xoo.x1.effortToFix",
-      "debtOverloaded": true,
-      "debtRemFnType": "LINEAR_OFFSET",
-      "debtRemFnCoeff": "2h",
-      "debtRemFnOffset": "25min",
-      "defaultRemFnType": "LINEAR_OFFSET",
-      "defaultRemFnGapMultiplier": "1h",
-      "defaultRemFnBaseEffort": "15min",
-      "remFnType": "LINEAR_OFFSET",
-      "remFnGapMultiplier": "2h",
-      "remFnBaseEffort": "25min",
-      "remFnOverloaded": true,
-      "gapDescription": "xoo.x1.effortToFix",
-      "type": "CODE_SMELL"
-    }
-  ]
-}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_template_rules.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/search_template_rules.json
deleted file mode 100644 (file)
index c7a4498..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-  "total": 1, "p": 1, "ps": 100,
-  "rules": [
-  {
-    "key": "xoo:x1",
-    "isTemplate": true
-  }
-]}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/severities_facet.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/severities_facet.json
deleted file mode 100644 (file)
index f2d9754..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-{"total": 0, "p": 1, "ps": 100, "rules": [],
-"facets": [
-  {
-    "property": "severities",
-    "values": [
-      {
-        "val": "BLOCKER",
-        "count": 0
-      },{
-        "val": "CRITICAL",
-        "count": 0
-      },{
-        "val": "MAJOR",
-        "count": 0
-      },{
-        "val": "MINOR",
-        "count": 0
-      },
-      {
-        "val": "INFO",
-        "count": 0
-      }
-    ]
-  }
-]}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/statuses_facet.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/statuses_facet.json
deleted file mode 100644 (file)
index 4692be8..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-{"total": 0, "p": 1, "ps": 100, "rules": [],
-"facets": [
-  {
-    "property": "statuses",
-    "values": [
-      {
-        "val": "BETA",
-        "count": 0
-      },{
-        "val": "DEPRECATED",
-        "count": 0
-      },{
-        "val": "READY",
-        "count": 0
-      }
-    ]
-  }
-]}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/statuses_facet_sticky.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/SearchActionMediumTest/statuses_facet_sticky.json
deleted file mode 100644 (file)
index a5b7a79..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-{"total": 1, "p": 1, "ps": 100, "rules": [
-  {"key": "xoo:x3"}
-],
-"facets": [
-  {
-    "property": "statuses",
-    "values": [
-      {
-        "val": "BETA",
-        "count": 1
-      },{
-        "val": "DEPRECATED",
-        "count": 1
-      },{
-        "val": "READY",
-        "count": 1
-      }
-    ]
-  }
-]}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/UpdateActionMediumTest/deprecated_remediation_function.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/UpdateActionMediumTest/deprecated_remediation_function.json
deleted file mode 100644 (file)
index e5dcab5..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "rule": {
-    "key": "xoo:x1",
-    "defaultDebtRemFnType": "LINEAR_OFFSET",
-    "defaultDebtRemFnCoeff": "10d",
-    "defaultDebtRemFnOffset": "5min",
-    "effortToFixDescription": "xoo.x1.effortToFix",
-    "debtRemFnType": "LINEAR_OFFSET",
-    "debtRemFnCoeff": "11d",
-    "debtRemFnOffset": "6min",
-    "defaultRemFnType": "LINEAR_OFFSET",
-    "defaultRemFnGapMultiplier": "10d",
-    "defaultRemFnBaseEffort": "5min",
-    "remFnType": "LINEAR_OFFSET",
-    "remFnGapMultiplier": "11d",
-    "remFnBaseEffort": "6min",
-    "gapDescription": "xoo.x1.effortToFix",
-  }
-}
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/UpdateActionMediumTest/update_custom_rule.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/rule/ws/UpdateActionMediumTest/update_custom_rule.json
deleted file mode 100644 (file)
index 2e3f3fa..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-{
-  "rule": {
-    "key": "java:MY_CUSTOM",
-    "repo": "java",
-    "name": "My custom rule",
-    "htmlDesc": "Description",
-    "severity": "MAJOR",
-    "status": "BETA",
-    "internalKey": "InternalKeyS001",
-    "isTemplate": false,
-    "templateKey": "java:S001",
-    "tags": ["tag1", "tag2"],
-    "sysTags": ["systag1", "systag2"],
-    "debtRemFnType": "LINEAR_OFFSET",
-    "debtRemFnCoeff": "5d",
-    "debtRemFnOffset": "10h",
-    "lang": "js",
-    "params": [
-      {
-        "key": "regex",
-        "htmlDesc": "Reg ex",
-        "defaultValue": "a.*"
-      }
-    ]
-  }
-}
index d42160d816aa29b1ad2d8ede324c46cac45445ce..068caa90a59a2ab2e04871a7034687380f4fb723 100644 (file)
@@ -158,11 +158,9 @@ public class SearchRequest {
    * <ul>
    *   <li>"actives"</li>
    *   <li>"createdAt"</li>
-   *   <li>"debtOverloaded"</li>
    *   <li>"debtRemFn"</li>
    *   <li>"defaultDebtRemFn"</li>
    *   <li>"defaultRemFn"</li>
-   *   <li>"effortToFixDescription"</li>
    *   <li>"gapDescription"</li>
    *   <li>"htmlDesc"</li>
    *   <li>"htmlNote"</li>
index 96c6fb6479780d1ed7e3bb987052e2cb00788cf2..961cd3274286cd7f221787d0deada888ea9a496a 100644 (file)
@@ -96,22 +96,16 @@ message Rule {
   optional string unusedDebtCharName = 27;
   optional string unusedDebtSubCharName = 28;
 
-  // Deprecated since 5.5, replaced by defaultRemFnType
-  optional string defaultDebtRemFnType = 29;
-  // Deprecated since 5.5, replaced by defaultRemFnGapMultiplier
-  optional string defaultDebtRemFnCoeff = 30;
-  // Deprecated since 5.5, replaced by defaultRemFnBaseEffort
-  optional string defaultDebtRemFnOffset = 31;
-  // Deprecated since 5.5, replaced by gapDescription
-  optional string effortToFixDescription = 32;
-  // Deprecated since 5.5, replaced by remFnOverloaded
-  optional bool debtOverloaded = 33;
-  // Deprecated since 5.5, replaced by remFnType
-  optional string debtRemFnType = 34;
-  // Deprecated since 5.5, replaced by remFnGapMultiplier
-  optional string debtRemFnCoeff = 35;
-  // Deprecated since 5.5, replaced by remFnBaseEffort
-  optional string debtRemFnOffset = 36;
+  // Deprecated since 10.0, replaced by defaultRemFnType
+  optional string defaultDebtRemFnType = 29 [deprecated=true];
+  reserved 30;
+  reserved 31;
+  reserved 32;
+  reserved 33;
+  // Deprecated since 10.0, replaced by remFnType
+  optional string debtRemFnType = 34 [deprecated=true];
+  reserved 35;
+  reserved 36;
   optional sonarqube.ws.commons.RuleType type = 37;
   optional string defaultRemFnType = 38;
   optional string defaultRemFnGapMultiplier = 39;