From 4b5ae093e3961996a13a5c495fc17caf77eec356 Mon Sep 17 00:00:00 2001 From: Steve Marion Date: Fri, 10 Mar 2023 09:46:49 +0100 Subject: [PATCH] [SONAR-15839] add reversing of metric deprecation changelog. --- .../java/org/sonar/server/measure/ws/ComponentAction.java | 2 ++ .../org/sonar/server/measure/ws/ComponentTreeAction.java | 2 ++ .../main/java/org/sonar/server/measure/ws/SearchAction.java | 5 ++++- .../org/sonar/server/measure/ws/SearchHistoryAction.java | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/ws/ComponentAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/ws/ComponentAction.java index 95a9d4d715a..c4129a81e7f 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/ws/ComponentAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/ws/ComponentAction.java @@ -96,6 +96,8 @@ public class ComponentAction implements MeasuresWsAction { .setResponseExample(getClass().getResource("component-example.json")) .setSince("5.4") .setChangelog( + new Change("10.0", format("The use of the following metrics in 'metricKeys' parameter is not deprecated anymore: %s", + MeasuresWsModule.getDeprecatedMetrics())), new Change("10.0", "the response field periods under measures field is removed."), new Change("10.0", "the option `periods` of 'additionalFields' request field is removed."), new Change("9.3", "When the new code period is set to 'reference branch', the response field 'date' under the 'period' field has been removed"), diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/ws/ComponentTreeAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/ws/ComponentTreeAction.java index 3c65f7c95ef..da343f45723 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/ws/ComponentTreeAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/ws/ComponentTreeAction.java @@ -178,6 +178,8 @@ public class ComponentTreeAction implements MeasuresWsAction { .setHandler(this) .addPagingParams(100, MAX_SIZE) .setChangelog( + new Change("10.0", format("The use of the following metrics in 'metricKeys' parameter is not deprecated anymore: %s", + MeasuresWsModule.getDeprecatedMetrics())), new Change("10.0", "the response field periods under measures field is removed."), new Change("10.0", "the option `periods` of 'additionalFields' request field is removed."), new Change("9.3", format("The use of the following metrics in 'metricKeys' parameter is deprecated: %s", diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/ws/SearchAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/ws/SearchAction.java index dea6199daeb..c7986f064a1 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/ws/SearchAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/ws/SearchAction.java @@ -84,7 +84,10 @@ public class SearchAction implements MeasuresWsAction { .setSince("6.2") .setResponseExample(getClass().getResource("search-example.json")) .setHandler(this) - .setChangelog(new Change("9.3", format("The use of the following metrics in 'metricKeys' parameter is deprecated: %s", + .setChangelog( + new Change("10.0", format("The use of the following metrics in 'metricKeys' parameter is not deprecated anymore: %s", + MeasuresWsModule.getDeprecatedMetrics())), + new Change("9.3", format("The use of the following metrics in 'metricKeys' parameter is deprecated: %s", MeasuresWsModule.getDeprecatedMetrics()))); createMetricKeysParameter(action); diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/ws/SearchHistoryAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/ws/SearchHistoryAction.java index 3d71c2003bc..09bedb212df 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/ws/SearchHistoryAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/ws/SearchHistoryAction.java @@ -93,6 +93,8 @@ public class SearchHistoryAction implements MeasuresWsAction { .setResponseExample(getClass().getResource("search_history-example.json")) .setSince("6.3") .setChangelog( + new Change("10.0", format("The use of the following metrics in 'metricKeys' parameter is not deprecated anymore: %s", + MeasuresWsModule.getDeprecatedMetrics())), new Change("9.3", format("The use of the following metrics in 'metrics' parameter is deprecated: %s", MeasuresWsModule.getDeprecatedMetrics())), new Change("7.6", format("The use of module keys in parameter '%s' is deprecated", PARAM_COMPONENT))) -- 2.39.5