]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-18745 Drop default field in api/qualitygates/list
authorMatteo Mara <matteo.mara@sonarsource.com>
Thu, 30 Mar 2023 13:02:06 +0000 (15:02 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 30 Mar 2023 20:03:08 +0000 (20:03 +0000)
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualitygate/ws/ListActionIT.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/qualitygate/ws/ListAction.java
server/sonar-webserver-webapi/src/main/resources/org/sonar/server/qualitygate/ws/list-example.json
sonar-ws/src/main/protobuf/ws-qualitygates.proto

index b5f66629aeeb614a60f46ad96f5663ca0aa0c331..ebee86f26c0f58a2a6cebd965fc89738d2266b05 100644 (file)
@@ -124,17 +124,6 @@ public class ListActionIT {
         tuple(qualityGate3.getName(), OVER_COMPLIANT.toString()));
   }
 
-  @Test
-  public void test_deprecated_default_field() {
-    QualityGateDto defaultQualityGate = db.qualityGates().insertQualityGate();
-    db.qualityGates().setDefaultQualityGate(defaultQualityGate);
-
-    ListWsResponse response = ws.newRequest()
-      .executeProtobuf(ListWsResponse.class);
-
-    assertThat(response.getDefault()).isEqualTo(defaultQualityGate.getUuid());
-  }
-
   @Test
   public void no_default_quality_gate() {
     QualityGateDto qualityGate = db.qualityGates().insertQualityGate();
index 4841361bb546bc79ddc4bd052ad6a64e07772590..e683ed7bba0996c4e6e00e6996971f549186ca70 100644 (file)
@@ -34,7 +34,6 @@ import org.sonar.server.qualitygate.QualityGateFinder;
 import org.sonarqube.ws.Qualitygates.ListWsResponse;
 import org.sonarqube.ws.Qualitygates.ListWsResponse.QualityGate;
 
-import static java.util.Optional.ofNullable;
 import static org.sonar.core.util.stream.MoreCollectors.toList;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
 
@@ -59,6 +58,7 @@ public class ListAction implements QualityGatesWsAction {
       .setSince("4.3")
       .setResponseExample(Resources.getResource(this.getClass(), "list-example.json"))
       .setChangelog(
+        new Change("10.0", "Field 'default' in the response has been removed"),
         new Change("10.0", "Field 'id' in the response has been removed"),
         new Change("9.9", "'caycStatus' field is added on quality gate"),
         new Change("8.4", "Field 'id' in the response is deprecated. Format changes from integer to string."),
@@ -92,7 +92,6 @@ public class ListAction implements QualityGatesWsAction {
           .setActions(wsSupport.getActions(dbSession, qualityGate, defaultQualityGate))
           .build())
         .collect(toList()));
-    ofNullable(defaultUuid).ifPresent(builder::setDefault);
     return builder.build();
   }
 
index 4a5ec0976962ac3997697bc3f48f94b1b96010f7..8327e2ae0dc39d35ed38934e002ec9c5446eac7d 100644 (file)
@@ -150,8 +150,7 @@ message SearchResponse {
 // GET api/qualitygates/list
 message ListWsResponse {
   repeated QualityGate qualitygates = 1;
-  // Deprecated since 7.0
-  optional string default = 2;
+  reserved 2; //drop default
   optional RootActions actions = 3;
 
   message QualityGate {