From 328e5ce94d64bc7abf3f648ea218ba859670cdd1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?L=C3=A9o=20Geoffroy?= Date: Wed, 3 May 2023 17:18:36 +0200 Subject: [PATCH] SONAR-18741 Drop support for providing module keys in ws --- .../it/java/org/sonar/server/component/ws/ShowActionIT.java | 3 ++- .../it/java/org/sonar/server/component/ws/TreeActionIT.java | 1 + .../it/java/org/sonar/server/ui/ws/ComponentActionIT.java | 3 ++- .../main/java/org/sonar/server/ce/ws/ActivityAction.java | 3 ++- .../main/java/org/sonar/server/component/ws/AppAction.java | 6 ++++-- .../main/java/org/sonar/server/component/ws/ShowAction.java | 1 + .../main/java/org/sonar/server/component/ws/TreeAction.java | 1 + .../main/java/org/sonar/server/favorite/ws/AddAction.java | 1 + .../java/org/sonar/server/favorite/ws/RemoveAction.java | 4 +++- .../java/org/sonar/server/measure/ws/ComponentAction.java | 1 + .../org/sonar/server/setting/ws/ListDefinitionsAction.java | 4 +++- .../main/java/org/sonar/server/setting/ws/SetAction.java | 1 + .../main/java/org/sonar/server/setting/ws/ValuesAction.java | 1 + .../main/java/org/sonar/server/ui/ws/ComponentAction.java | 1 + .../org/sonarqube/ws/client/components/SearchRequest.java | 1 - .../sonarqube/ws/client/components/SuggestionsRequest.java | 1 - .../org/sonarqube/ws/client/components/TreeRequest.java | 1 - .../sonarqube/ws/client/measures/ComponentTreeRequest.java | 1 - 18 files changed, 24 insertions(+), 11 deletions(-) diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/component/ws/ShowActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/component/ws/ShowActionIT.java index f8793a0ed75..55e8fc57321 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/component/ws/ShowActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/component/ws/ShowActionIT.java @@ -78,7 +78,8 @@ public class ShowActionIT { assertThat(action.description()).isNotNull(); assertThat(action.responseExample()).isNotNull(); assertThat(action.changelog()).extracting(Change::getVersion, Change::getDescription).containsExactlyInAnyOrder( - tuple("7.6", "The use of module keys in parameter 'component' is deprecated")); + tuple("7.6", "The use of module keys in parameter 'component' is deprecated"), + tuple("10.1", "The use of module keys in parameter 'component' is removed")); assertThat(action.params()).extracting(WebService.Param::key).containsExactlyInAnyOrder("component", "branch", "pullRequest"); WebService.Param component = action.param(PARAM_COMPONENT); diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/component/ws/TreeActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/component/ws/TreeActionIT.java index 6b02526188a..e353afcbe5f 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/component/ws/TreeActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/component/ws/TreeActionIT.java @@ -99,6 +99,7 @@ public class TreeActionIT { assertThat(action.description()).isNotNull(); assertThat(action.responseExample()).isNotNull(); assertThat(action.changelog()).extracting(Change::getVersion, Change::getDescription).containsExactlyInAnyOrder( + tuple("10.1", "The use of module keys in parameter 'component' is removed"), tuple("10.1", "The use of 'BRC' as value for parameter 'qualifiers' is removed"), tuple("7.6", "The use of 'BRC' as value for parameter 'qualifiers' is deprecated"), tuple("7.6", "The use of module keys in parameter 'component' is deprecated")); diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/ui/ws/ComponentActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/ui/ws/ComponentActionIT.java index 469ec426a1d..06ffe2da299 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/ui/ws/ComponentActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/ui/ws/ComponentActionIT.java @@ -749,7 +749,8 @@ public class ComponentActionIT { tuple("6.4", "The 'visibility' field is added"), tuple("7.3", "The 'almRepoUrl' and 'almId' fields are added"), tuple("7.6", "The use of module keys in parameter 'component' is deprecated"), - tuple("8.8", "Deprecated parameter 'componentKey' has been removed. Please use parameter 'component' instead")); + tuple("8.8", "Deprecated parameter 'componentKey' has been removed. Please use parameter 'component' instead"), + tuple("10.1", "The use of module keys in parameter 'component' is removed")); WebService.Param componentId = action.param(PARAM_COMPONENT); assertThat(componentId.isRequired()).isFalse(); diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ce/ws/ActivityAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ce/ws/ActivityAction.java index 1b6fa75b1b2..5eb7b96b74c 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ce/ws/ActivityAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ce/ws/ActivityAction.java @@ -112,7 +112,8 @@ public class ActivityAction implements CeWsAction { new Change("7.1", "field \"pullRequest\" added"), new Change("7.6", format("The use of module keys in parameters '%s' is deprecated", TEXT_QUERY)), new Change("8.8", "field \"logs\" is dropped"), - new Change("10.0", "Remove deprecated field 'componentId'")) + new Change("10.0", "Remove deprecated field 'componentId'"), + new Change("10.1", String.format("The use of module keys in parameter '%s' is removed", PARAM_COMPONENT))) .setSince("5.2"); action.createParam(PARAM_COMPONENT) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/AppAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/AppAction.java index 80ab01dd0de..b183208c47a 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/AppAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/AppAction.java @@ -61,8 +61,10 @@ public class AppAction implements ComponentsWsAction { "Requires the following permission: 'Browse'.") .setResponseExample(getClass().getResource("app-example.json")) .setSince("4.4") - .setChangelog(new Change("9.6", "The fields 'subProject', 'subProjectName' were removed from the response.")) - .setChangelog(new Change("7.6", String.format("The use of module keys in parameter '%s' is deprecated", PARAM_COMPONENT))) + .setChangelog( + new Change("10.1", String.format("The use of module keys in parameter '%s' is removed", PARAM_COMPONENT)), + new Change("9.6", "The fields 'subProject', 'subProjectName' were removed from the response."), + new Change("7.6", String.format("The use of module keys in parameter '%s' is deprecated", PARAM_COMPONENT))) .setInternal(true) .setHandler(this); diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/ShowAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/ShowAction.java index 73adff97112..fcaee32e5f1 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/ShowAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/ShowAction.java @@ -79,6 +79,7 @@ public class ShowAction implements ComponentsWsAction { .setResponseExample(getClass().getResource("show-example.json")) .setSince("5.4") .setChangelog( + new Change("10.1", String.format("The use of module keys in parameter '%s' is removed", PARAM_COMPONENT)), new Change("7.6", String.format("The use of module keys in parameter '%s' is deprecated", PARAM_COMPONENT))) .setHandler(this); diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/TreeAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/TreeAction.java index 5b8b1aa8343..827be3accba 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/TreeAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/component/ws/TreeAction.java @@ -119,6 +119,7 @@ public class TreeAction implements ComponentsWsAction { .setSince("5.4") .setResponseExample(getClass().getResource("tree-example.json")) .setChangelog( + new Change("10.1", String.format("The use of module keys in parameter '%s' is removed", PARAM_COMPONENT)), new Change("10.1", String.format("The use of 'BRC' as value for parameter '%s' is removed", PARAM_QUALIFIERS)), new Change("7.6", String.format("The use of 'BRC' as value for parameter '%s' is deprecated", PARAM_QUALIFIERS)), new Change("7.6", String.format("The use of module keys in parameter '%s' is deprecated", PARAM_COMPONENT))) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/ws/AddAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/ws/AddAction.java index eda655430ff..32f37d48369 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/ws/AddAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/ws/AddAction.java @@ -69,6 +69,7 @@ public class AddAction implements FavoritesWsAction { "Requires authentication and the following permission: 'Browse' on the project of the specified component.") .setSince("6.3") .setChangelog( + new Change("10.1", String.format("The use of module keys in parameter '%s' is removed", PARAM_COMPONENT)), new Change("8.4", "It's no longer possible to set a file as favorite"), new Change("7.7", "It's no longer possible to have more than 100 favorites by qualifier"), new Change("7.7", "It's no longer possible to set a directory as favorite"), diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/ws/RemoveAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/ws/RemoveAction.java index a1a9cd4d6e0..0d8ddb707e8 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/ws/RemoveAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/ws/RemoveAction.java @@ -53,7 +53,9 @@ public class RemoveAction implements FavoritesWsAction { .setDescription("Remove a component (project, portfolio, application etc.) as favorite for the authenticated user.
" + "Requires authentication.") .setSince("6.3") - .setChangelog(new Change("7.6", String.format("The use of module keys in parameter '%s' is deprecated", PARAM_COMPONENT))) + .setChangelog( + new Change("10.1", String.format("The use of module keys in parameter '%s' is removed", PARAM_COMPONENT)), + new Change("7.6", String.format("The use of module keys in parameter '%s' is deprecated", PARAM_COMPONENT))) .setPost(true) .setHandler(this); 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 8f325fd6553..87eb8984c71 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,7 @@ public class ComponentAction implements MeasuresWsAction { .setResponseExample(getClass().getResource("component-example.json")) .setSince("5.4") .setChangelog( + new Change("10.1", String.format("The use of module keys in parameter '%s' is removed", PARAM_COMPONENT)), 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."), diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/setting/ws/ListDefinitionsAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/setting/ws/ListDefinitionsAction.java index 7c3dfe2cba1..c14b2b1391c 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/setting/ws/ListDefinitionsAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/setting/ws/ListDefinitionsAction.java @@ -77,7 +77,9 @@ public class ListDefinitionsAction implements SettingsWsAction { "") .setResponseExample(getClass().getResource("list_definitions-example.json")) .setSince("6.3") - .setChangelog(new Change("7.6", String.format("The use of module keys in parameter '%s' is deprecated", PARAM_COMPONENT))) + .setChangelog( + new Change("10.1", String.format("The use of module keys in parameter '%s' is removed", PARAM_COMPONENT)), + new Change("7.6", String.format("The use of module keys in parameter '%s' is deprecated", PARAM_COMPONENT))) .setHandler(this); action.createParam(PARAM_COMPONENT) .setDescription("Component key") diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/setting/ws/SetAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/setting/ws/SetAction.java index 5332a5280e3..92884434b95 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/setting/ws/SetAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/setting/ws/SetAction.java @@ -103,6 +103,7 @@ public class SetAction implements SettingsWsAction { PARAM_VALUE, PARAM_VALUES) .setSince("6.1") .setChangelog( + new Change("10.1", String.format("The use of module keys in parameter '%s' is removed", PARAM_COMPONENT)), new Change("8.8", "Deprecated parameter 'componentKey' has been removed"), new Change("7.6", String.format("The use of module keys in parameter '%s' is deprecated", PARAM_COMPONENT)), new Change("7.1", "The settings defined in conf/sonar.properties are read-only and can't be changed")) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/setting/ws/ValuesAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/setting/ws/ValuesAction.java index deb01610b6e..7157264aded 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/setting/ws/ValuesAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/setting/ws/ValuesAction.java @@ -103,6 +103,7 @@ public class ValuesAction implements SettingsWsAction { .setResponseExample(getClass().getResource("values-example.json")) .setSince("6.3") .setChangelog( + new Change("10.1", String.format("The use of module keys in parameter '%s' is removed", PARAM_COMPONENT)), new Change("9.1", "The secured settings values are no longer returned. Secured settings keys that have a value " + "are now returned in setSecuredSettings array."), new Change("7.6", String.format("The use of module keys in parameter '%s' is deprecated", PARAM_COMPONENT)), diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/ComponentAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/ComponentAction.java index 58e63b6f858..3a458ad2588 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/ComponentAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/ComponentAction.java @@ -121,6 +121,7 @@ public class ComponentAction implements NavigationWsAction { .setResponseExample(getClass().getResource("component-example.json")) .setSince("5.2") .setChangelog( + new Change("10.1", String.format("The use of module keys in parameter '%s' is removed", PARAM_COMPONENT)), new Change("8.8", "Deprecated parameter 'componentKey' has been removed. Please use parameter 'component' instead"), new Change("7.6", format("The use of module keys in parameter '%s' is deprecated", PARAM_COMPONENT)), new Change("7.3", "The 'almRepoUrl' and 'almId' fields are added"), diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/components/SearchRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/components/SearchRequest.java index 5171c19ea76..2b221c62864 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/components/SearchRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/components/SearchRequest.java @@ -89,7 +89,6 @@ public class SearchRequest { * This is a mandatory parameter. * Possible values: * diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/components/TreeRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/components/TreeRequest.java index a796a094775..1473e48559e 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/components/TreeRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/components/TreeRequest.java @@ -137,7 +137,6 @@ public class TreeRequest { /** * Possible values: *