]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-13249 deprecate usergroups id parameter
authorPierre <pierre.guillot@sonarsource.com>
Thu, 26 Mar 2020 16:40:13 +0000 (17:40 +0100)
committersonartech <sonartech@sonarsource.com>
Mon, 25 May 2020 20:05:16 +0000 (20:05 +0000)
server/sonar-webserver-webapi/src/main/java/org/sonar/server/usergroups/ws/AddUserAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/usergroups/ws/GroupWsSupport.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/usergroups/ws/RemoveUserAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/usergroups/ws/SearchAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/usergroups/ws/UpdateAction.java

index b3f65f8901fd521e1a30c1f6903f0e764211c4bb..b5028c67b468dcc21275c06f284e592b12c7df6e 100644 (file)
@@ -35,13 +35,13 @@ import org.sonar.server.user.UserSession;
 import static com.google.common.base.Preconditions.checkArgument;
 import static java.lang.String.format;
 import static org.sonar.db.permission.OrganizationPermission.ADMINISTER;
+import static org.sonar.server.exceptions.NotFoundException.checkFound;
 import static org.sonar.server.usergroups.ws.GroupWsSupport.PARAM_GROUP_ID;
 import static org.sonar.server.usergroups.ws.GroupWsSupport.PARAM_GROUP_NAME;
 import static org.sonar.server.usergroups.ws.GroupWsSupport.PARAM_LOGIN;
 import static org.sonar.server.usergroups.ws.GroupWsSupport.PARAM_ORGANIZATION_KEY;
 import static org.sonar.server.usergroups.ws.GroupWsSupport.defineGroupWsParameters;
 import static org.sonar.server.usergroups.ws.GroupWsSupport.defineLoginWsParameter;
-import static org.sonar.server.exceptions.NotFoundException.checkFound;
 
 public class AddUserAction implements UserGroupsWsAction {
 
index 6123b4f9bb2037ddee7c53eba432d236f00752d4..c60a1262c236c50e6d7ba659a1b1ace36b998236 100644 (file)
@@ -36,9 +36,9 @@ import org.sonarqube.ws.UserGroups;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.Optional.ofNullable;
+import static org.sonar.server.exceptions.BadRequestException.checkRequest;
 import static org.sonar.server.exceptions.NotFoundException.checkFound;
 import static org.sonar.server.exceptions.NotFoundException.checkFoundWithOptional;
-import static org.sonar.server.exceptions.BadRequestException.checkRequest;
 
 /**
  * Factorizes code about user groups between web services
@@ -162,6 +162,7 @@ public class GroupWsSupport {
 
   private static void defineGroupIdWsParameter(WebService.NewAction action) {
     action.createParam(PARAM_GROUP_ID)
+      .setDeprecatedSince("8.3")
       .setDescription("Group id")
       .setExampleValue("42");
   }
index bd7994cfdb90f16ddbfb6d45eb87a31f5d3c35e1..e201e718161eb6e1ea70e1e6edb6f75f4c72df5e 100644 (file)
@@ -31,13 +31,13 @@ import org.sonar.db.user.UserDto;
 import org.sonar.server.user.UserSession;
 
 import static java.lang.String.format;
+import static org.sonar.server.exceptions.BadRequestException.checkRequest;
+import static org.sonar.server.exceptions.NotFoundException.checkFound;
 import static org.sonar.server.usergroups.ws.GroupWsSupport.PARAM_GROUP_ID;
 import static org.sonar.server.usergroups.ws.GroupWsSupport.PARAM_GROUP_NAME;
 import static org.sonar.server.usergroups.ws.GroupWsSupport.PARAM_LOGIN;
 import static org.sonar.server.usergroups.ws.GroupWsSupport.defineGroupWsParameters;
 import static org.sonar.server.usergroups.ws.GroupWsSupport.defineLoginWsParameter;
-import static org.sonar.server.exceptions.NotFoundException.checkFound;
-import static org.sonar.server.exceptions.BadRequestException.checkRequest;
 
 public class RemoveUserAction implements UserGroupsWsAction {
 
index ff1277f41583451c59d85889b6e7e747fa684093..b3828aea235f60ae73161388d89c36060205877b 100644 (file)
@@ -45,6 +45,7 @@ import static org.apache.commons.lang.StringUtils.defaultIfBlank;
 import static org.sonar.api.utils.Paging.forPageIndex;
 import static org.sonar.db.permission.OrganizationPermission.ADMINISTER;
 import static org.sonar.server.es.SearchOptions.MAX_LIMIT;
+import static org.sonar.server.usergroups.ws.GroupWsSupport.PARAM_GROUP_ID;
 import static org.sonar.server.usergroups.ws.GroupWsSupport.PARAM_ORGANIZATION_KEY;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
 import static org.sonarqube.ws.UserGroups.Group;
@@ -80,8 +81,10 @@ public class SearchAction implements UserGroupsWsAction {
       .addFieldsParam(ALL_FIELDS)
       .addPagingParams(100, MAX_LIMIT)
       .addSearchQuery("sonar-users", "names")
-      .setChangelog(new Change("6.4", "Paging response fields moved to a Paging object"),
-        new Change("6.4", "'default' response field has been added"));
+      .setChangelog(
+        new Change("6.4", "Paging response fields moved to a Paging object"),
+        new Change("6.4", "'default' response field has been added"),
+        new Change("8.3", "field " + PARAM_GROUP_ID + "in the response is deprecated"));
 
     action.createParam(PARAM_ORGANIZATION_KEY)
       .setDescription("Key of organization. If not set then groups are searched in default organization.")
index 555439dcd9d50a732b4e495ea9c55b4275a531a6..7303552ab38b43cba9405150280b5eeb25d7e605 100644 (file)
@@ -37,13 +37,13 @@ import org.sonarqube.ws.UserGroups;
 import static java.lang.String.format;
 import static org.sonar.api.user.UserGroupValidation.GROUP_NAME_MAX_LENGTH;
 import static org.sonar.db.permission.OrganizationPermission.ADMINISTER;
+import static org.sonar.server.exceptions.NotFoundException.checkFound;
+import static org.sonar.server.exceptions.NotFoundException.checkFoundWithOptional;
 import static org.sonar.server.usergroups.ws.GroupWsSupport.DESCRIPTION_MAX_LENGTH;
 import static org.sonar.server.usergroups.ws.GroupWsSupport.PARAM_GROUP_DESCRIPTION;
 import static org.sonar.server.usergroups.ws.GroupWsSupport.PARAM_GROUP_ID;
 import static org.sonar.server.usergroups.ws.GroupWsSupport.PARAM_GROUP_NAME;
 import static org.sonar.server.usergroups.ws.GroupWsSupport.toProtobuf;
-import static org.sonar.server.exceptions.NotFoundException.checkFound;
-import static org.sonar.server.exceptions.NotFoundException.checkFoundWithOptional;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
 
 public class UpdateAction implements UserGroupsWsAction {