From c1e24e180870470d45af355cfd05191ae6ae9d02 Mon Sep 17 00:00:00 2001 From: Teryk Bellahsene Date: Fri, 19 May 2017 17:40:07 +0200 Subject: [PATCH] SONAR-9269 Drop database ids of component in api/issues/* WS responses --- .../test/java/it/issue/IssueSearchTest.java | 36 ------------------- .../server/issue/ws/AddCommentAction.java | 6 ++-- .../sonar/server/issue/ws/AssignAction.java | 4 +++ .../server/issue/ws/DoTransitionAction.java | 4 +++ .../server/issue/ws/SearchResponseFormat.java | 13 +------ .../server/issue/ws/SetSeverityAction.java | 4 +++ .../sonar/server/issue/ws/SetTagsAction.java | 5 ++- .../sonar/server/issue/ws/SetTypeAction.java | 4 +++ .../server/issue/ws/add_comment-example.json | 6 +--- .../sonar/server/issue/ws/assign-example.json | 7 +--- .../issue/ws/delete_comment-example.json | 6 +--- .../issue/ws/do_transition-example.json | 7 +--- .../server/issue/ws/edit_comment-example.json | 6 +--- .../server/issue/ws/set_severity-example.json | 7 +--- .../server/issue/ws/set_tags-example.json | 3 -- .../server/issue/ws/set_type-example.json | 7 +--- .../issue/ws/SearchActionMediumTest.java | 15 -------- sonar-ws/src/main/protobuf/ws-issues.proto | 10 +++--- 18 files changed, 37 insertions(+), 113 deletions(-) diff --git a/it/it-tests/src/test/java/it/issue/IssueSearchTest.java b/it/it-tests/src/test/java/it/issue/IssueSearchTest.java index 5c4007cf222..cc8f3f8031f 100644 --- a/it/it-tests/src/test/java/it/issue/IssueSearchTest.java +++ b/it/it-tests/src/test/java/it/issue/IssueSearchTest.java @@ -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 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 issues = searchByRuleKey("xoo:OneBugIssuePerLine"); @@ -304,11 +275,4 @@ public class IssueSearchTest extends AbstractIssueTest { return newAdminWsClient(ORCHESTRATOR).issues().search(request); } - private static Component findComponent(Collection components, String key) { - return components.stream() - .filter(input -> key.equals(input.key())) - .findFirst() - .orElseThrow(() -> new IllegalStateException("Component key not found: " + key)); - } - } diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/AddCommentAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/AddCommentAction.java index b056349b8f3..12de91a95f2 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/AddCommentAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/AddCommentAction.java @@ -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.
" + "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); diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/AssignAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/AssignAction.java index cdb9fc28346..f4c4792d378 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/AssignAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/AssignAction.java @@ -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); diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/DoTransitionAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/DoTransitionAction.java index 691f3750069..f7021444718 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/DoTransitionAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/DoTransitionAction.java @@ -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.
" + "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); diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseFormat.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseFormat.java index e309be3cdbb..4ea2c89a741 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseFormat.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseFormat.java @@ -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; diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetSeverityAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetSeverityAction.java index a775df2b775..8af7217ce4b 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetSeverityAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetSeverityAction.java @@ -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 { "
  • 'Administer Issues' rights on project of the specified issue
  • " + "") .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); diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetTagsAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetTagsAction.java index ed9c43e948f..0df9128e171 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetTagsAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetTagsAction.java @@ -72,7 +72,10 @@ public class SetTagsAction implements IssuesWsAction { .setSince("5.1") .setDescription("Set tags on an issue.
    " + "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) diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetTypeAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetTypeAction.java index 34101227721..4fde4097328 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetTypeAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetTypeAction.java @@ -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 { "
  • 'Administer Issues' rights on project of the specified issue
  • " + "") .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); diff --git a/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/add_comment-example.json b/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/add_comment-example.json index bc58343b9ec..c87e0cd9789 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/add_comment-example.json +++ b/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/add_comment-example.json @@ -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,16 +52,13 @@ }, "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, diff --git a/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/assign-example.json b/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/assign-example.json index bc58343b9ec..412ea524298 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/assign-example.json +++ b/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/assign-example.json @@ -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,19 +52,15 @@ }, "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, diff --git a/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/delete_comment-example.json b/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/delete_comment-example.json index bc58343b9ec..7cab6160070 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/delete_comment-example.json +++ b/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/delete_comment-example.json @@ -53,19 +53,15 @@ }, "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, diff --git a/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/do_transition-example.json b/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/do_transition-example.json index bc58343b9ec..412ea524298 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/do_transition-example.json +++ b/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/do_transition-example.json @@ -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,19 +52,15 @@ }, "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, diff --git a/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/edit_comment-example.json b/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/edit_comment-example.json index bc58343b9ec..7cab6160070 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/edit_comment-example.json +++ b/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/edit_comment-example.json @@ -53,19 +53,15 @@ }, "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, diff --git a/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/set_severity-example.json b/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/set_severity-example.json index bc58343b9ec..412ea524298 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/set_severity-example.json +++ b/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/set_severity-example.json @@ -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,19 +52,15 @@ }, "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, diff --git a/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/set_tags-example.json b/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/set_tags-example.json index bc58343b9ec..4f2e2f1ef21 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/set_tags-example.json +++ b/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/set_tags-example.json @@ -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, diff --git a/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/set_type-example.json b/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/set_type-example.json index bc58343b9ec..412ea524298 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/set_type-example.json +++ b/server/sonar-server/src/main/resources/org/sonar/server/issue/ws/set_type-example.json @@ -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,19 +52,15 @@ }, "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, diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java index 2f4a430d5e1..1d873091674 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java @@ -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(); diff --git a/sonar-ws/src/main/protobuf/ws-issues.proto b/sonar-ws/src/main/protobuf/ws-issues.proto index 4e31149efcf..30a54ddbd34 100644 --- a/sonar-ws/src/main/protobuf/ws-issues.proto +++ b/sonar-ws/src/main/protobuf/ws-issues.proto @@ -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 -- 2.39.5