]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9269 Drop database ids of component in api/issues/* WS responses
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 19 May 2017 15:40:07 +0000 (17:40 +0200)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Tue, 23 May 2017 07:38:51 +0000 (09:38 +0200)
18 files changed:
it/it-tests/src/test/java/it/issue/IssueSearchTest.java
server/sonar-server/src/main/java/org/sonar/server/issue/ws/AddCommentAction.java
server/sonar-server/src/main/java/org/sonar/server/issue/ws/AssignAction.java
server/sonar-server/src/main/java/org/sonar/server/issue/ws/DoTransitionAction.java
server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseFormat.java
server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetSeverityAction.java
server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetTagsAction.java
server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetTypeAction.java
server/sonar-server/src/main/resources/org/sonar/server/issue/ws/add_comment-example.json
server/sonar-server/src/main/resources/org/sonar/server/issue/ws/assign-example.json
server/sonar-server/src/main/resources/org/sonar/server/issue/ws/delete_comment-example.json
server/sonar-server/src/main/resources/org/sonar/server/issue/ws/do_transition-example.json
server/sonar-server/src/main/resources/org/sonar/server/issue/ws/edit_comment-example.json
server/sonar-server/src/main/resources/org/sonar/server/issue/ws/set_severity-example.json
server/sonar-server/src/main/resources/org/sonar/server/issue/ws/set_tags-example.json
server/sonar-server/src/main/resources/org/sonar/server/issue/ws/set_type-example.json
server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java
sonar-ws/src/main/protobuf/ws-issues.proto

index 5c4007cf222544e271ded57d94d0fcd707dd531a..cc8f3f8031f032b4e833535d5ac692566e21b3ee 100644 (file)
@@ -21,7 +21,6 @@ package it.issue;
 
 import java.io.IOException;
 import java.text.SimpleDateFormat;
-import java.util.Collection;
 import java.util.Date;
 import java.util.List;
 import org.apache.commons.lang.time.DateUtils;
@@ -31,7 +30,6 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 import org.sonar.wsclient.base.HttpException;
 import org.sonar.wsclient.base.Paging;
-import org.sonar.wsclient.component.Component;
 import org.sonar.wsclient.issue.Issue;
 import org.sonar.wsclient.issue.IssueQuery;
 import org.sonar.wsclient.issue.Issues;
@@ -244,33 +242,6 @@ public class IssueSearchTest extends AbstractIssueTest {
     assertThat(search(IssueQuery.create().createdAt(toDate("2010-01-01"))).size()).isEqualTo(0);
   }
 
-  @Test
-  public void components_contain_sub_project_id_and_project_id_informations() {
-    String fileKey = "com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo";
-
-    Issues issues = issueClient().find(IssueQuery.create().components(fileKey));
-    assertThat(issues.list()).isNotEmpty();
-
-    Collection<Component> components = issues.components();
-
-    Component project = findComponent(components, "com.sonarsource.it.samples:multi-modules-sample");
-    assertThat(project.subProjectId()).isNull();
-    assertThat(project.projectId()).isNull();
-
-    Component subModuleA1 = findComponent(components, "com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1");
-    assertThat(subModuleA1.subProjectId()).isEqualTo(project.id());
-    assertThat(subModuleA1.projectId()).isEqualTo(project.id());
-
-    Component file = findComponent(components, fileKey);
-    assertThat(file.subProjectId()).isNotNull();
-    assertThat(file.projectId()).isNotNull();
-
-    Issue issue = issues.list().get(0);
-    assertThat(issues.component(issue)).isNotNull();
-    assertThat(issues.component(issue).subProjectId()).isEqualTo(subModuleA1.id());
-    assertThat(issues.component(issue).projectId()).isEqualTo(project.id());
-  }
-
   @Test
   public void return_issue_type() throws Exception {
     List<org.sonarqube.ws.Issues.Issue> issues = searchByRuleKey("xoo:OneBugIssuePerLine");
@@ -304,11 +275,4 @@ public class IssueSearchTest extends AbstractIssueTest {
     return newAdminWsClient(ORCHESTRATOR).issues().search(request);
   }
 
-  private static Component findComponent(Collection<Component> components, String key) {
-    return components.stream()
-      .filter(input -> key.equals(input.key()))
-      .findFirst()
-      .orElseThrow(() -> new IllegalStateException("Component key not found: " + key));
-  }
-
 }
index b056349b8f3ce72404ff697ba3bf86c1d11949ec..12de91a95f2a8de8ac5a2bb1c8f5bb094fd1b83e 100644 (file)
@@ -55,7 +55,7 @@ public class AddCommentAction implements IssuesWsAction {
   private final OperationResponseWriter responseWriter;
 
   public AddCommentAction(System2 system2, UserSession userSession, DbClient dbClient, IssueFinder issueFinder, IssueUpdater issueUpdater, IssueFieldsSetter issueFieldsSetter,
-                          OperationResponseWriter responseWriter) {
+    OperationResponseWriter responseWriter) {
     this.system2 = system2;
     this.userSession = userSession;
     this.dbClient = dbClient;
@@ -71,7 +71,9 @@ public class AddCommentAction implements IssuesWsAction {
       .setDescription("Add a comment.<br/>" +
         "Requires authentication and the following permission: 'Browse' on the project of the specified issue.")
       .setSince("3.6")
-      .setChangelog(new Change("6.3", "the response returns the issue with all its details"))
+      .setChangelog(
+        new Change("6.3", "the response returns the issue with all its details"),
+        new Change("6.5", "the database ids of the components are removed from the response"))
       .setHandler(this)
       .setResponseExample(Resources.getResource(this.getClass(), "add_comment-example.json"))
       .setPost(true);
index cdb9fc28346086810b4eb945e8afc88cb7babcd0..f4c4792d378f0204114691ca4929499de81e68e6 100644 (file)
@@ -26,6 +26,7 @@ import java.util.Optional;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
 import org.apache.commons.lang.BooleanUtils;
+import org.sonar.api.server.ws.Change;
 import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
@@ -81,6 +82,9 @@ public class AssignAction implements IssuesWsAction {
     WebService.NewAction action = controller.createAction(ACTION_ASSIGN)
       .setDescription("Assign/Unassign an issue. Requires authentication and Browse permission on project")
       .setSince("3.6")
+      .setChangelog(
+        new Change("6.5", "the database ids of the components are removed from the response"),
+        new Change("6.5", "the response field components.uuid is deprecated. Use components.key instead."))
       .setHandler(this)
       .setResponseExample(Resources.getResource(this.getClass(), "assign-example.json"))
       .setPost(true);
index 691f3750069d6639969f176fa0743730733772c2..f7021444718acbf31259ba4ee224bde50d49457c 100644 (file)
@@ -22,6 +22,7 @@ package org.sonar.server.issue.ws;
 import com.google.common.io.Resources;
 import java.util.Date;
 import org.sonar.api.issue.DefaultTransitions;
+import org.sonar.api.server.ws.Change;
 import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
@@ -65,6 +66,9 @@ public class DoTransitionAction implements IssuesWsAction {
       .setDescription("Do workflow transition on an issue. Requires authentication and Browse permission on project.<br/>" +
         "The transitions '" + DefaultTransitions.WONT_FIX + "' and '" + DefaultTransitions.FALSE_POSITIVE + "' require the permission 'Administer Issues'.")
       .setSince("3.6")
+      .setChangelog(
+        new Change("6.5", "the database ids of the components are removed from the response"),
+        new Change("6.5", "the response field components.uuid is deprecated. Use components.key instead."))
       .setHandler(this)
       .setResponseExample(Resources.getResource(this.getClass(), "do_transition-example.json"))
       .setPost(true);
index e309be3cdbb4828ed6087e242dc8b4f11c2b1cd9..4ea2c89a741e2dc1b03e6e21c6240968a72886f0 100644 (file)
@@ -161,8 +161,6 @@ public class SearchResponseFormat {
     ComponentDto component = data.getComponentByUuid(dto.getComponentUuid());
     issueBuilder.setOrganization(data.getOrganizationKey(component.getOrganizationUuid()));
     issueBuilder.setComponent(component.key());
-    // Only used for the compatibility with the Java WS Client <= 4.4 used by Eclipse
-    issueBuilder.setComponentId(component.getId());
     ComponentDto project = data.getComponentByUuid(dto.getProjectUuid());
     if (project != null) {
       issueBuilder.setProject(project.getKey());
@@ -192,7 +190,7 @@ public class SearchResponseFormat {
     setNullable(dto.getIssueCloseDate(), issueBuilder::setCloseDate, DateUtils::formatDateTime);
   }
 
-  private void completeIssueLocations(IssueDto dto, Issue.Builder issueBuilder) {
+  private static void completeIssueLocations(IssueDto dto, Issue.Builder issueBuilder) {
     DbIssues.Locations locations = dto.parseLocations();
     if (locations == null) {
       return;
@@ -308,7 +306,6 @@ public class SearchResponseFormat {
       String uuid = dto.uuid();
       Component.Builder builder = Component.newBuilder()
         .setOrganization(data.getOrganizationKey(dto.getOrganizationUuid()))
-        .setId(dto.getId())
         .setKey(dto.key())
         .setUuid(uuid)
         .setQualifier(dto.qualifier())
@@ -322,14 +319,6 @@ public class SearchResponseFormat {
         builder.setPath(path);
       }
 
-      // On a root project, parentProjectId is null but projectId is equal to itself, which make no sense.
-      if (!uuid.equals(dto.getRootUuid())) {
-        ComponentDto project = data.getComponentByUuid(dto.projectUuid());
-        setNullable(project, builder::setProjectId, ComponentDto::getId);
-
-        ComponentDto subProject = data.getComponentByUuid(dto.getRootUuid());
-        setNullable(subProject, builder::setSubProjectId, ComponentDto::getId);
-      }
       result.add(builder.build());
     }
     return result;
index a775df2b7754333da1ed882fcff8b9ff65bbe260..8af7217ce4bf8d5bb1a6bd48a5ffe1f5d8744713 100644 (file)
@@ -22,6 +22,7 @@ package org.sonar.server.issue.ws;
 import com.google.common.io.Resources;
 import java.util.Date;
 import org.sonar.api.rule.Severity;
+import org.sonar.api.server.ws.Change;
 import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
@@ -70,6 +71,9 @@ public class SetSeverityAction implements IssuesWsAction {
         "  <li>'Administer Issues' rights on project of the specified issue</li>" +
         "</ul>")
       .setSince("3.6")
+      .setChangelog(
+        new Change("6.5", "the database ids of the components are removed from the response"),
+        new Change("6.5", "the response field components.uuid is deprecated. Use components.key instead."))
       .setHandler(this)
       .setResponseExample(Resources.getResource(this.getClass(), "set_severity-example.json"))
       .setPost(true);
index ed9c43e948f9acee521a638081f7326f262f39f0..0df9128e171ea7164c9915d3b15caddf5b7f515d 100644 (file)
@@ -72,7 +72,10 @@ public class SetTagsAction implements IssuesWsAction {
       .setSince("5.1")
       .setDescription("Set tags on an issue. <br/>" +
         "Requires authentication and Browse permission on project")
-      .setChangelog(new Change("6.4", "response contains issue information instead of list of tags"))
+      .setChangelog(
+        new Change("6.5", "the database ids of the components are removed from the response"),
+        new Change("6.5", "the response field components.uuid is deprecated. Use components.key instead."),
+        new Change("6.4", "response contains issue information instead of list of tags"))
       .setResponseExample(Resources.getResource(this.getClass(), "set_tags-example.json"))
       .setHandler(this);
     action.createParam(PARAM_ISSUE)
index 34101227721ee6082927b4e32bed1a9b77cdf706..4fde4097328c85cd2bf0ce2a0ac6995411fa1d60 100644 (file)
@@ -22,6 +22,7 @@ package org.sonar.server.issue.ws;
 import com.google.common.io.Resources;
 import java.util.Date;
 import org.sonar.api.rules.RuleType;
+import org.sonar.api.server.ws.Change;
 import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
@@ -70,6 +71,9 @@ public class SetTypeAction implements IssuesWsAction {
         "  <li>'Administer Issues' rights on project of the specified issue</li>" +
         "</ul>")
       .setSince("5.5")
+      .setChangelog(
+        new Change("6.5", "the database ids of the components are removed from the response"),
+        new Change("6.5", "the response field components.uuid is deprecated. Use components.key instead."))
       .setHandler(this)
       .setResponseExample(Resources.getResource(this.getClass(), "set_type-example.json"))
       .setPost(true);
index bc58343b9ec9063a268164b09683e487dbaa76be..c87e0cd9789800553e924966a40a77919aefe0cb 100644 (file)
@@ -4,7 +4,6 @@
     "rule": "squid:S2301",
     "severity": "MAJOR",
     "component": "org.sonarsource.sonarlint.intellij:sonarlint-intellij:src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-    "componentId": 87163,
     "project": "org.sonarsource.sonarlint.intellij:sonarlint-intellij",
     "line": 78,
     "textRange": {
   },
   "components": [
     {
-      "id": 87163,
       "key": "org.sonarsource.sonarlint.intellij:sonarlint-intellij:src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
       "uuid": "AVfTIlxMwczdZ2UaLhnt",
       "enabled": true,
       "qualifier": "FIL",
       "name": "ServerIssueUpdater.java",
       "longName": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-      "path": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-      "projectId": 23498,
-      "subProjectId": 23498
+      "path": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java"
     },
     {
       "id": 23498,
index bc58343b9ec9063a268164b09683e487dbaa76be..412ea524298597360ec7381425fbbfb7c1060a32 100644 (file)
@@ -4,7 +4,6 @@
     "rule": "squid:S2301",
     "severity": "MAJOR",
     "component": "org.sonarsource.sonarlint.intellij:sonarlint-intellij:src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-    "componentId": 87163,
     "project": "org.sonarsource.sonarlint.intellij:sonarlint-intellij",
     "line": 78,
     "textRange": {
   },
   "components": [
     {
-      "id": 87163,
       "key": "org.sonarsource.sonarlint.intellij:sonarlint-intellij:src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
       "uuid": "AVfTIlxMwczdZ2UaLhnt",
       "enabled": true,
       "qualifier": "FIL",
       "name": "ServerIssueUpdater.java",
       "longName": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-      "path": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-      "projectId": 23498,
-      "subProjectId": 23498
+      "path": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java"
     },
     {
-      "id": 23498,
       "key": "org.sonarsource.sonarlint.intellij:sonarlint-intellij",
       "uuid": "8b745480-b598-4e34-af4a-cb2de1808e50",
       "enabled": true,
index bc58343b9ec9063a268164b09683e487dbaa76be..7cab6160070dd6421f4bed41ff601cd41a1a07c2 100644 (file)
   },
   "components": [
     {
-      "id": 87163,
       "key": "org.sonarsource.sonarlint.intellij:sonarlint-intellij:src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
       "uuid": "AVfTIlxMwczdZ2UaLhnt",
       "enabled": true,
       "qualifier": "FIL",
       "name": "ServerIssueUpdater.java",
       "longName": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-      "path": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-      "projectId": 23498,
-      "subProjectId": 23498
+      "path": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java"
     },
     {
-      "id": 23498,
       "key": "org.sonarsource.sonarlint.intellij:sonarlint-intellij",
       "uuid": "8b745480-b598-4e34-af4a-cb2de1808e50",
       "enabled": true,
index bc58343b9ec9063a268164b09683e487dbaa76be..412ea524298597360ec7381425fbbfb7c1060a32 100644 (file)
@@ -4,7 +4,6 @@
     "rule": "squid:S2301",
     "severity": "MAJOR",
     "component": "org.sonarsource.sonarlint.intellij:sonarlint-intellij:src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-    "componentId": 87163,
     "project": "org.sonarsource.sonarlint.intellij:sonarlint-intellij",
     "line": 78,
     "textRange": {
   },
   "components": [
     {
-      "id": 87163,
       "key": "org.sonarsource.sonarlint.intellij:sonarlint-intellij:src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
       "uuid": "AVfTIlxMwczdZ2UaLhnt",
       "enabled": true,
       "qualifier": "FIL",
       "name": "ServerIssueUpdater.java",
       "longName": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-      "path": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-      "projectId": 23498,
-      "subProjectId": 23498
+      "path": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java"
     },
     {
-      "id": 23498,
       "key": "org.sonarsource.sonarlint.intellij:sonarlint-intellij",
       "uuid": "8b745480-b598-4e34-af4a-cb2de1808e50",
       "enabled": true,
index bc58343b9ec9063a268164b09683e487dbaa76be..7cab6160070dd6421f4bed41ff601cd41a1a07c2 100644 (file)
   },
   "components": [
     {
-      "id": 87163,
       "key": "org.sonarsource.sonarlint.intellij:sonarlint-intellij:src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
       "uuid": "AVfTIlxMwczdZ2UaLhnt",
       "enabled": true,
       "qualifier": "FIL",
       "name": "ServerIssueUpdater.java",
       "longName": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-      "path": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-      "projectId": 23498,
-      "subProjectId": 23498
+      "path": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java"
     },
     {
-      "id": 23498,
       "key": "org.sonarsource.sonarlint.intellij:sonarlint-intellij",
       "uuid": "8b745480-b598-4e34-af4a-cb2de1808e50",
       "enabled": true,
index bc58343b9ec9063a268164b09683e487dbaa76be..412ea524298597360ec7381425fbbfb7c1060a32 100644 (file)
@@ -4,7 +4,6 @@
     "rule": "squid:S2301",
     "severity": "MAJOR",
     "component": "org.sonarsource.sonarlint.intellij:sonarlint-intellij:src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-    "componentId": 87163,
     "project": "org.sonarsource.sonarlint.intellij:sonarlint-intellij",
     "line": 78,
     "textRange": {
   },
   "components": [
     {
-      "id": 87163,
       "key": "org.sonarsource.sonarlint.intellij:sonarlint-intellij:src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
       "uuid": "AVfTIlxMwczdZ2UaLhnt",
       "enabled": true,
       "qualifier": "FIL",
       "name": "ServerIssueUpdater.java",
       "longName": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-      "path": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-      "projectId": 23498,
-      "subProjectId": 23498
+      "path": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java"
     },
     {
-      "id": 23498,
       "key": "org.sonarsource.sonarlint.intellij:sonarlint-intellij",
       "uuid": "8b745480-b598-4e34-af4a-cb2de1808e50",
       "enabled": true,
index bc58343b9ec9063a268164b09683e487dbaa76be..4f2e2f1ef2199b945b781992d7751c5864da8cf4 100644 (file)
@@ -4,7 +4,6 @@
     "rule": "squid:S2301",
     "severity": "MAJOR",
     "component": "org.sonarsource.sonarlint.intellij:sonarlint-intellij:src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-    "componentId": 87163,
     "project": "org.sonarsource.sonarlint.intellij:sonarlint-intellij",
     "line": 78,
     "textRange": {
@@ -53,7 +52,6 @@
   },
   "components": [
     {
-      "id": 87163,
       "key": "org.sonarsource.sonarlint.intellij:sonarlint-intellij:src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
       "uuid": "AVfTIlxMwczdZ2UaLhnt",
       "enabled": true,
@@ -65,7 +63,6 @@
       "subProjectId": 23498
     },
     {
-      "id": 23498,
       "key": "org.sonarsource.sonarlint.intellij:sonarlint-intellij",
       "uuid": "8b745480-b598-4e34-af4a-cb2de1808e50",
       "enabled": true,
index bc58343b9ec9063a268164b09683e487dbaa76be..412ea524298597360ec7381425fbbfb7c1060a32 100644 (file)
@@ -4,7 +4,6 @@
     "rule": "squid:S2301",
     "severity": "MAJOR",
     "component": "org.sonarsource.sonarlint.intellij:sonarlint-intellij:src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-    "componentId": 87163,
     "project": "org.sonarsource.sonarlint.intellij:sonarlint-intellij",
     "line": 78,
     "textRange": {
   },
   "components": [
     {
-      "id": 87163,
       "key": "org.sonarsource.sonarlint.intellij:sonarlint-intellij:src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
       "uuid": "AVfTIlxMwczdZ2UaLhnt",
       "enabled": true,
       "qualifier": "FIL",
       "name": "ServerIssueUpdater.java",
       "longName": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-      "path": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java",
-      "projectId": 23498,
-      "subProjectId": 23498
+      "path": "src/main/java/org/sonarlint/intellij/core/ServerIssueUpdater.java"
     },
     {
-      "id": 23498,
       "key": "org.sonarsource.sonarlint.intellij:sonarlint-intellij",
       "uuid": "8b745480-b598-4e34-af4a-cb2de1808e50",
       "enabled": true,
index 2f4a430d5e1b7882a1b8c064831cad4c6a460672..1d873091674db05aad418889c0b38a9bf9f1dc5d 100644 (file)
@@ -294,21 +294,6 @@ public class SearchActionMediumTest {
     result.assertJson(this.getClass(), "issue_on_removed_file.json");
   }
 
-  @Test
-  public void issue_contains_component_id_for_eclipse() throws Exception {
-    ComponentDto project = insertComponent(ComponentTesting.newPublicProjectDto(otherOrganization1, "PROJECT_ID").setKey("PROJECT_KEY"));
-    indexPermissionsOf(project);
-    ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, null, "FILE_ID").setKey("FILE_KEY"));
-    IssueDto issue = IssueTesting.newDto(newRule(), file, project);
-    db.issueDao().insert(session, issue);
-    session.commit();
-    IssueIndexer r = tester.get(IssueIndexer.class);
-    r.indexOnStartup(r.getIndexTypes());
-
-    WsTester.Result result = wsTester.newGetRequest(CONTROLLER_ISSUES, ACTION_SEARCH).execute();
-    assertThat(result.outputAsString()).contains("\"componentId\":" + file.getId() + ",");
-  }
-
   @Test
   public void apply_paging_with_one_component() throws Exception {
     RuleDto rule = newRule();
index 4e31149efcf65d74678c878f0357bd1d79465979..30a54ddbd34cb4c7b622a64ec98b11b540c792f8 100644 (file)
@@ -56,7 +56,7 @@ message Operation {
   repeated sonarqube.ws.commons.Rule rules = 3;
   repeated Users.User users = 4;
   // Deprecated since 5.5, action plan has been removed
-  repeated ActionPlan actiunusedActionPlansonPlans = 5;
+  repeated ActionPlan unusedActionPlans = 5;
 }
 
 message Issue {
@@ -65,7 +65,7 @@ message Issue {
   optional string rule = 2;
   optional sonarqube.ws.commons.Severity severity = 3;
   optional string component = 4;
-  optional int64 componentId = 5;
+  optional int64 unusedComponentId = 5;
   optional string project = 6;
   optional string subProject = 7;
   optional int32 line = 8;
@@ -172,7 +172,7 @@ message Languages {
 
 message Component {
   optional string organization = 11;
-  optional int64 id = 1;
+  optional int64 deprecatedId = 1;
   optional string key = 2;
   optional string uuid = 3;
   optional bool enabled = 4;
@@ -180,8 +180,8 @@ message Component {
   optional string name = 6;
   optional string longName = 7;
   optional string path = 8;
-  optional int64 projectId = 9;
-  optional int64 subProjectId = 10;
+  optional int64 unusedProjectId = 9;
+  optional int64 unusedSubProjectId = 10;
 }
 
 // Response of GET api/issues/changelog