]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-13848 remove deprecated response field 'debtTotal' from api/issues/search
authorMichal Duda <michal.duda@sonarsource.com>
Wed, 24 Feb 2021 12:36:16 +0000 (13:36 +0100)
committersonartech <sonartech@sonarsource.com>
Fri, 26 Feb 2021 20:07:40 +0000 (20:07 +0000)
server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/SearchResponseFormat.java
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/issue/ws/SearchActionTest/filter_by_leak_period.json
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/issue/ws/SearchActionTest/filter_by_leak_period_has_no_effect_on_prs.json
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/issue/ws/SearchActionTest/filter_by_main_scope.json
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/issue/ws/SearchActionTest/filter_by_main_scope_2.json
server/sonar-webserver-webapi/src/test/resources/org/sonar/server/issue/ws/SearchActionTest/filter_by_test_scope.json
sonar-ws/src/main/protobuf/ws-issues.proto

index 040a1f9507135eb531274e574885a81f528893c5..b200d46938411f5503bd763a7d36795d61b7b6f3 100644 (file)
@@ -92,7 +92,7 @@ public class SearchResponseFormat {
     SearchWsResponse.Builder response = SearchWsResponse.newBuilder();
 
     formatPaging(paging, response);
-    formatEffortTotal(data, response);
+    ofNullable(data.getEffortTotal()).ifPresent(response::setEffortTotal);
     response.addAllIssues(formatIssues(fields, data));
     response.addAllComponents(formatComponents(data));
     formatFacets(data, facets, response);
@@ -126,14 +126,6 @@ public class SearchResponseFormat {
     return response.build();
   }
 
-  private static void formatEffortTotal(SearchResponseData data, SearchWsResponse.Builder response) {
-    Long effort = data.getEffortTotal();
-    if (effort != null) {
-      response.setDebtTotal(effort);
-      response.setEffortTotal(effort);
-    }
-  }
-
   private static void formatPaging(Paging paging, SearchWsResponse.Builder response) {
     response.setP(paging.pageIndex());
     response.setPs(paging.pageSize());
index 13a5436b17767e1685c287eed89c80001f40fd7c..6c5f4ba193fdc22e165eb15cc2b06c433c5528ef 100644 (file)
@@ -28,6 +28,7 @@ option optimize_for = SPEED;
 
 // Response of GET api/issues/search
 message SearchWsResponse {
+  reserved 5;
   optional int64 total = 1;
   optional int64 p = 2;
   optional int32 ps = 3;
@@ -35,8 +36,6 @@ message SearchWsResponse {
 
   // Total amount of effort, only when the facet "total" is enabled
   optional int64 effortTotal = 13;
-  // Deprecated since 5.5, replaced by effortTotal
-  optional int64 debtTotal = 5;
 
   repeated Issue issues = 6;
   repeated Component components = 7;