From: Julien Lancelot Date: Wed, 23 Mar 2016 14:40:13 +0000 (+0100) Subject: SONAR-7473 Drop 'reporter' field from WS X-Git-Tag: 5.5-M12~48 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=391b4f992e44db1ed4f1f05ef62ed3b4c60a24bb;p=sonarqube.git SONAR-7473 Drop 'reporter' field from WS --- 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 e553f972530..2c9e187d271 100644 --- a/it/it-tests/src/test/java/it/issue/IssueSearchTest.java +++ b/it/it-tests/src/test/java/it/issue/IssueSearchTest.java @@ -61,7 +61,7 @@ public class IssueSearchTest extends AbstractIssueTest { private static final String PROJECT_KEY2 = "com.sonarsource.it.samples:multi-modules-sample2"; private static int DEFAULT_PAGINATED_RESULTS = 100; - private static int TOTAL_NB_ISSUES = 273; + private static int TOTAL_NB_ISSUES = 272; @BeforeClass public static void prepareData() { @@ -83,15 +83,6 @@ public class IssueSearchTest extends AbstractIssueTest { // Resolve a issue to test search by status and by resolution adminIssueClient().doTransition(searchRandomIssue().key(), "resolve"); - - // Create a manual issue to test search by reporter - createManualRule(); - adminIssueClient().create( - NewIssue.create().component("com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo") - .rule("manual:invalidclassname") - .line(3) - .severity("CRITICAL") - .message("The name of the class is invalid")); } @After @@ -107,8 +98,8 @@ public class IssueSearchTest extends AbstractIssueTest { @Test public void search_issues_by_component_roots() { assertThat(search(IssueQuery.create().componentRoots("com.sonarsource.it.samples:multi-modules-sample")).list()).hasSize(DEFAULT_PAGINATED_RESULTS); - assertThat(search(IssueQuery.create().componentRoots("com.sonarsource.it.samples:multi-modules-sample:module_a")).list()).hasSize(83); - assertThat(search(IssueQuery.create().componentRoots("com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1")).list()).hasSize(37); + assertThat(search(IssueQuery.create().componentRoots("com.sonarsource.it.samples:multi-modules-sample:module_a")).list()).hasSize(82); + assertThat(search(IssueQuery.create().componentRoots("com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1")).list()).hasSize(36); assertThat(search(IssueQuery.create().componentRoots("unknown")).list()).isEmpty(); } @@ -117,14 +108,14 @@ public class IssueSearchTest extends AbstractIssueTest { public void search_issues_by_components() { assertThat( search(IssueQuery.create().components("com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo")).list()) - .hasSize(35); + .hasSize(34); assertThat(search(IssueQuery.create().components("unknown")).list()).isEmpty(); } @Test public void search_issues_by_severities() { assertThat(search(IssueQuery.create().severities("BLOCKER")).list()).hasSize(8); - assertThat(search(IssueQuery.create().severities("CRITICAL")).list()).hasSize(9); + assertThat(search(IssueQuery.create().severities("CRITICAL")).list()).hasSize(8); assertThat(search(IssueQuery.create().severities("MAJOR")).list()).hasSize(DEFAULT_PAGINATED_RESULTS); assertThat(search(IssueQuery.create().severities("MINOR")).list()).hasSize(DEFAULT_PAGINATED_RESULTS); assertThat(search(IssueQuery.create().severities("INFO")).list()).hasSize(4); @@ -153,17 +144,10 @@ public class IssueSearchTest extends AbstractIssueTest { assertThat(search(IssueQuery.create().assigned(false)).paging().total()).isEqualTo(TOTAL_NB_ISSUES - 1); } - @Test - public void search_issues_by_reporters() { - assertThat(search(IssueQuery.create().reporters("admin")).list()).hasSize(1); - assertThat(search(IssueQuery.create().reporters("unknown")).list()).isEmpty(); - } - @Test public void search_issues_by_rules() { assertThat(search(IssueQuery.create().rules("xoo:OneIssuePerLine")).list()).hasSize(DEFAULT_PAGINATED_RESULTS); assertThat(search(IssueQuery.create().rules("xoo:OneIssuePerFile")).list()).hasSize(8); - assertThat(search(IssueQuery.create().rules("manual:invalidclassname")).list()).hasSize(1); try { assertThat(search(IssueQuery.create().rules("unknown")).list()).isEmpty(); @@ -345,8 +329,7 @@ public class IssueSearchTest extends AbstractIssueTest { ORCHESTRATOR.getServer().adminWsClient().post("/api/rules/create", ImmutableMap.of( "manual_key", "invalidclassname", "name", "InvalidClassName", - "markdown_description", "Invalid class name" - )); + "markdown_description", "Invalid class name")); } } diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQuery.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQuery.java index ed0c82abd0c..dcaae8b6081 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQuery.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQuery.java @@ -66,7 +66,6 @@ public class IssueQuery { private final Collection files; private final Collection views; private final Collection rules; - private final Collection reporters; private final Collection assignees; private final Collection authors; private final Collection languages; @@ -101,7 +100,6 @@ public class IssueQuery { this.files = defaultCollection(builder.files); this.views = defaultCollection(builder.views); this.rules = defaultCollection(builder.rules); - this.reporters = defaultCollection(builder.reporters); this.assignees = defaultCollection(builder.assignees); this.authors = defaultCollection(builder.authors); this.languages = defaultCollection(builder.languages); @@ -171,10 +169,6 @@ public class IssueQuery { return rules; } - public Collection reporters() { - return reporters; - } - public Collection assignees() { return assignees; } @@ -290,7 +284,6 @@ public class IssueQuery { private Collection files; private Collection views; private Collection rules; - private Collection reporters; private Collection assignees; private Collection authors; private Collection languages; @@ -376,11 +369,6 @@ public class IssueQuery { return this; } - public Builder reporters(@Nullable Collection l) { - this.reporters = l; - return this; - } - public Builder assignees(@Nullable Collection l) { this.assignees = l; return this; diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryService.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryService.java index 8ce9913f876..2dfdc5cf434 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryService.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryService.java @@ -104,7 +104,6 @@ public class IssueQueryService { .resolutions(RubyUtils.toStrings(params.get(IssueFilterParameters.RESOLUTIONS))) .resolved(RubyUtils.toBoolean(params.get(IssueFilterParameters.RESOLVED))) .rules(toRules(params.get(IssueFilterParameters.RULES))) - .reporters(RubyUtils.toStrings(params.get(IssueFilterParameters.REPORTERS))) .assignees(buildAssignees(RubyUtils.toStrings(params.get(IssueFilterParameters.ASSIGNEES)))) .languages(RubyUtils.toStrings(params.get(IssueFilterParameters.LANGUAGES))) .tags(RubyUtils.toStrings(params.get(IssueFilterParameters.TAGS))) @@ -176,7 +175,6 @@ public class IssueQueryService { .resolutions(request.getResolutions()) .resolved(request.getResolved()) .rules(stringsToRules(request.getRules())) - .reporters(request.getReporters()) .assignees(buildAssignees(request.getAssignees())) .languages(request.getLanguages()) .tags(request.getTags()) diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java index d73764f45c9..945e5061656 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java @@ -127,7 +127,9 @@ public class IssueIndex extends BaseIndex { LANGUAGES, TAGS, TYPES, - CREATED_AT); + CREATED_AT + ); + // TODO to be documented // TODO move to Facets ? @@ -275,7 +277,6 @@ public class IssueIndex extends BaseIndex { filters.put(IssueIndexDefinition.FIELD_ISSUE_TAGS, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_TAGS, query.tags())); filters.put(IssueIndexDefinition.FIELD_ISSUE_TYPE, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_TYPE, query.types())); filters.put(IssueIndexDefinition.FIELD_ISSUE_RESOLUTION, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_RESOLUTION, query.resolutions())); - filters.put(IssueIndexDefinition.FIELD_ISSUE_REPORTER, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_REPORTER, query.reporters())); filters.put(IssueIndexDefinition.FIELD_ISSUE_AUTHOR_LOGIN, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_AUTHOR_LOGIN, query.authors())); filters.put(IssueIndexDefinition.FIELD_ISSUE_RULE_KEY, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_RULE_KEY, query.rules())); filters.put(IssueIndexDefinition.FIELD_ISSUE_SEVERITY, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_SEVERITY, query.severities())); @@ -404,8 +405,6 @@ public class IssueIndex extends BaseIndex { LANGUAGES, IssueIndexDefinition.FIELD_ISSUE_LANGUAGE, query.languages().toArray()); addSimpleStickyFacetIfNeeded(options, stickyFacetBuilder, esSearch, RULES, IssueIndexDefinition.FIELD_ISSUE_RULE_KEY, query.rules().toArray()); - addSimpleStickyFacetIfNeeded(options, stickyFacetBuilder, esSearch, - REPORTERS, IssueIndexDefinition.FIELD_ISSUE_REPORTER); addSimpleStickyFacetIfNeeded(options, stickyFacetBuilder, esSearch, AUTHORS, IssueIndexDefinition.FIELD_ISSUE_AUTHOR_LOGIN, query.authors().toArray()); diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java index 9c8c2827857..bef890e4a95 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java @@ -87,7 +87,6 @@ import static org.sonarqube.ws.client.issue.IssueFilterParameters.PLANNED; import static org.sonarqube.ws.client.issue.IssueFilterParameters.PROJECTS; import static org.sonarqube.ws.client.issue.IssueFilterParameters.PROJECT_KEYS; import static org.sonarqube.ws.client.issue.IssueFilterParameters.PROJECT_UUIDS; -import static org.sonarqube.ws.client.issue.IssueFilterParameters.REPORTERS; import static org.sonarqube.ws.client.issue.IssueFilterParameters.RESOLUTIONS; import static org.sonarqube.ws.client.issue.IssueFilterParameters.RESOLVED; import static org.sonarqube.ws.client.issue.IssueFilterParameters.RULES; @@ -125,14 +124,16 @@ public class SearchAction implements IssuesWsAction { .setDescription( "Search for issues. Requires Browse permission on project(s).
" + "Since 5.5, response field 'debt' has been renamed to 'effort'.
" + - "Since 5.5, response field 'actionPlan' has been removed") + "Since 5.5, response field 'actionPlan' has been removed.
" + + "Since 5.5, response field 'reporter' has been removed, as manual issue feature has been dropped") .setSince("3.6") .setResponseExample(Resources.getResource(this.getClass(), "example-search.json")); action.addPagingParams(100, MAX_LIMIT); action.createParam(Param.FACETS) .setDescription("Comma-separated list of the facets to be computed. No facet is computed by default.
" + - "Since 5.5, facet 'actionPlans' is deprecated.") + "Since 5.5, facet 'actionPlans' is deprecated.
" + + "Since 5.5, facet 'reporters' is deprecated.") .setPossibleValues(IssueIndex.SUPPORTED_FACETS); action.createParam(FACET_MODE) .setDefaultValue(FACET_MODE_COUNT) @@ -182,9 +183,10 @@ public class SearchAction implements IssuesWsAction { .setDescription("Since 5.5 this parameter is no more used, as action plan feature has been dropped") .setDeprecatedSince("5.5") .setBooleanPossibleValues(); - action.createParam(REPORTERS) - .setDescription("Comma-separated list of reporter logins") - .setExampleValue("admin"); + action.createParam("reporters") + .setDescription("Since 5.5 this parameter is no more used, as manual issue feature has been dropped") + .setExampleValue("admin") + .setDeprecatedSince("5.5"); action.createParam(AUTHORS) .setDescription("Comma-separated list of SCM accounts") .setExampleValue("torvalds@linux-foundation.org"); @@ -356,7 +358,6 @@ public class SearchAction implements IssuesWsAction { } addMandatoryValuesToFacet(facets, ASSIGNEES, assignees); addMandatoryValuesToFacet(facets, FACET_ASSIGNED_TO_ME, singletonList(userSession.getLogin())); - addMandatoryValuesToFacet(facets, REPORTERS, request.getReporters()); addMandatoryValuesToFacet(facets, RULES, request.getRules()); addMandatoryValuesToFacet(facets, LANGUAGES, request.getLanguages()); addMandatoryValuesToFacet(facets, TAGS, request.getTags()); @@ -414,7 +415,6 @@ public class SearchAction implements IssuesWsAction { collector.addComponentUuids(facets.getBucketKeys(FILE_UUIDS)); collector.addComponentUuids(facets.getBucketKeys(MODULE_UUIDS)); collector.addAll(SearchAdditionalField.USERS, facets.getBucketKeys(ASSIGNEES)); - collector.addAll(SearchAdditionalField.USERS, facets.getBucketKeys(REPORTERS)); } private void collectRequestParams(SearchResponseLoader.Collector collector, SearchWsRequest request) { @@ -423,7 +423,6 @@ public class SearchAction implements IssuesWsAction { collector.addComponentUuids(request.getModuleUuids()); collector.addComponentUuids(request.getComponentRootUuids()); collector.addAll(SearchAdditionalField.USERS, request.getAssignees()); - collector.addAll(SearchAdditionalField.USERS, request.getReporters()); } private static SearchWsRequest toSearchWsRequest(Request request) { @@ -455,7 +454,6 @@ public class SearchAction implements IssuesWsAction { .setProjectKeys(request.paramAsStrings(PROJECT_KEYS)) .setProjectUuids(request.paramAsStrings(PROJECT_UUIDS)) .setProjects(request.paramAsStrings(PROJECTS)) - .setReporters(request.paramAsStrings(REPORTERS)) .setResolutions(request.paramAsStrings(RESOLUTIONS)) .setResolved(request.paramAsBoolean(RESOLVED)) .setRules(request.paramAsStrings(RULES)) 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 d9c58d6c444..f3d9f339afb 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 @@ -64,7 +64,7 @@ public class SearchResponseFormat { } public Issues.SearchWsResponse formatSearch(Set fields, SearchResponseData data, - Paging paging, @Nullable Facets facets) { + Paging paging, @Nullable Facets facets) { Issues.SearchWsResponse.Builder response = Issues.SearchWsResponse.newBuilder(); formatPaging(paging, response); @@ -162,9 +162,6 @@ public class SearchResponseFormat { if (!Strings.isNullOrEmpty(dto.getAssignee())) { issueBuilder.setAssignee(dto.getAssignee()); } - if (!Strings.isNullOrEmpty(dto.getReporter())) { - issueBuilder.setReporter(dto.getReporter()); - } if (!Strings.isNullOrEmpty(dto.getResolution())) { issueBuilder.setResolution(dto.getResolution()); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseLoader.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseLoader.java index 56a3949a793..3a6a78349b2 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseLoader.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseLoader.java @@ -171,7 +171,6 @@ public class SearchResponseLoader { componentUuids.add(issue.getComponentUuid()); projectUuids.add(issue.getProjectUuid()); add(RULES, issue.getRuleKey()); - add(USERS, issue.getReporter()); add(USERS, issue.getAssignee()); collectComponentsFromIssueLocations(issue); } diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryServiceTest.java index 8a80c76b37e..f547dfd01e9 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryServiceTest.java @@ -162,7 +162,6 @@ public class IssueQueryServiceTest { assertThat(query.projectUuids()).containsOnly("ABCD"); assertThat(query.moduleUuids()).containsOnly("BCDE"); assertThat(query.fileUuids()).containsOnly("CDEF"); - assertThat(query.reporters()).containsOnly("marilyn"); assertThat(query.assignees()).containsOnly("joanna"); assertThat(query.languages()).containsOnly("xoo"); assertThat(query.tags()).containsOnly("tag1", "tag2"); @@ -490,6 +489,6 @@ public class IssueQueryServiceTest { .setSinceLeakPeriod(true) .setComponentUuids(Collections.singletonList("component-uuid")) .setProjectUuids(Collections.singletonList("project-uuid")) - ); + ); } } diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryTest.java index 1811941a0d6..fbf7d253174 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryTest.java @@ -45,7 +45,6 @@ public class IssueQueryTest { .componentUuids(newArrayList("org/struts/Action.java")) .moduleUuids(newArrayList("org.struts:core")) .rules(newArrayList(RuleKey.of("squid", "AvoidCycle"))) - .reporters(newArrayList("crunky")) .assignees(newArrayList("gargantua")) .languages(newArrayList("xoo")) .tags(newArrayList("tag1", "tag2")) @@ -65,7 +64,6 @@ public class IssueQueryTest { assertThat(query.resolutions()).containsOnly(Issue.RESOLUTION_FALSE_POSITIVE); assertThat(query.componentUuids()).containsOnly("org/struts/Action.java"); assertThat(query.moduleUuids()).containsOnly("org.struts:core"); - assertThat(query.reporters()).containsOnly("crunky"); assertThat(query.assignees()).containsOnly("gargantua"); assertThat(query.languages()).containsOnly("xoo"); assertThat(query.tags()).containsOnly("tag1", "tag2"); @@ -115,7 +113,6 @@ public class IssueQueryTest { .moduleUuids(null) .statuses(null) .assignees(null) - .reporters(null) .resolutions(null) .rules(null) .severities(null) @@ -128,7 +125,6 @@ public class IssueQueryTest { assertThat(query.moduleUuids()).isEmpty(); assertThat(query.statuses()).isEmpty(); assertThat(query.assignees()).isEmpty(); - assertThat(query.reporters()).isEmpty(); assertThat(query.resolutions()).isEmpty(); assertThat(query.rules()).isEmpty(); assertThat(query.severities()).isEmpty(); @@ -145,7 +141,6 @@ public class IssueQueryTest { assertThat(query.moduleUuids()).isEmpty(); assertThat(query.statuses()).isEmpty(); assertThat(query.assignees()).isEmpty(); - assertThat(query.reporters()).isEmpty(); assertThat(query.resolutions()).isEmpty(); assertThat(query.rules()).isEmpty(); assertThat(query.severities()).isEmpty(); diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexTest.java index cccea32a348..1b23e0870a7 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexTest.java @@ -202,19 +202,20 @@ public class IssueIndexTest { assertThat( index.search(IssueQuery.builder(userSessionRule).projectUuids(newArrayList(project.uuid())).moduleUuids(newArrayList(file.uuid())).build(), new SearchOptions()).getDocs()) - .isEmpty(); + .isEmpty(); assertThat( index.search(IssueQuery.builder(userSessionRule).projectUuids(newArrayList(project.uuid())).moduleUuids(newArrayList(module.uuid())).build(), new SearchOptions()).getDocs()) - .hasSize(1); - assertThat(index.search(IssueQuery.builder(userSessionRule).projectUuids(newArrayList(project.uuid())).moduleUuids(newArrayList(subModule.uuid())).build(), new SearchOptions()) - .getDocs()) - .hasSize(2); + .hasSize(1); + assertThat( + index.search(IssueQuery.builder(userSessionRule).projectUuids(newArrayList(project.uuid())).moduleUuids(newArrayList(subModule.uuid())).build(), new SearchOptions()) + .getDocs()) + .hasSize(2); assertThat( index.search(IssueQuery.builder(userSessionRule).projectUuids(newArrayList(project.uuid())).moduleUuids(newArrayList(project.uuid())).build(), new SearchOptions()).getDocs()) - .isEmpty(); + .isEmpty(); assertThat( index.search(IssueQuery.builder(userSessionRule).projectUuids(newArrayList(project.uuid())).moduleUuids(newArrayList("unknown")).build(), new SearchOptions()).getDocs()) - .isEmpty(); + .isEmpty(); } @Test @@ -428,7 +429,7 @@ public class IssueIndexTest { assertThat( index.search(IssueQuery.builder(userSessionRule).resolutions(newArrayList(Issue.RESOLUTION_FALSE_POSITIVE, Issue.RESOLUTION_FIXED)).build(), new SearchOptions()).getDocs()) - .hasSize(2); + .hasSize(2); assertThat(index.search(IssueQuery.builder(userSessionRule).resolutions(newArrayList(Issue.RESOLUTION_FALSE_POSITIVE)).build(), new SearchOptions()).getDocs()).hasSize(1); assertThat(index.search(IssueQuery.builder(userSessionRule).resolutions(newArrayList(Issue.RESOLUTION_REMOVED)).build(), new SearchOptions()).getDocs()).isEmpty(); } @@ -564,20 +565,6 @@ public class IssueIndexTest { assertThat(index.search(IssueQuery.builder(userSessionRule).assigned(null).build(), new SearchOptions()).getDocs()).hasSize(3); } - @Test - public void filter_by_reporters() { - ComponentDto project = ComponentTesting.newProjectDto(); - ComponentDto file = ComponentTesting.newFileDto(project); - - indexIssues( - IssueTesting.newDoc("ISSUE1", file).setReporter("fabrice"), - IssueTesting.newDoc("ISSUE2", file).setReporter("stephane")); - - assertThat(index.search(IssueQuery.builder(userSessionRule).reporters(newArrayList("fabrice", "stephane")).build(), new SearchOptions()).getDocs()).hasSize(2); - assertThat(index.search(IssueQuery.builder(userSessionRule).reporters(newArrayList("fabrice")).build(), new SearchOptions()).getDocs()).hasSize(1); - assertThat(index.search(IssueQuery.builder(userSessionRule).reporters(newArrayList("unknown")).build(), new SearchOptions()).getDocs()).isEmpty(); - } - @Test public void filter_by_authors() { ComponentDto project = ComponentTesting.newProjectDto(); @@ -1047,7 +1034,7 @@ public class IssueIndexTest { IssueTesting.newDoc("F1_1", file1).setLine(null), IssueTesting.newDoc("F1_3", file1).setLine(25), - // file F2 + // file F2 IssueTesting.newDoc("F2_1", file2).setLine(9), IssueTesting.newDoc("F2_2", file2).setLine(109), // two issues on the same line -> sort by key 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 91fcecbd36d..aa04415b7d4 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 @@ -128,7 +128,6 @@ public class SearchActionMediumTest { .setSeverity("MAJOR") .setAuthorLogin("John") .setAssignee("simon") - .setReporter("fabrice") .setTags(asList("bug", "owasp")) .setIssueCreationDate(DateUtils.parseDateTime("2014-09-04T00:00:00+0100")) .setIssueUpdateDate(DateUtils.parseDateTime("2017-12-04T00:00:00+0100")); @@ -222,8 +221,7 @@ public class SearchActionMediumTest { IssueDto issue = IssueTesting.newDto(newRule(), file, project) .setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2") .setAuthorLogin("John") - .setAssignee("simon") - .setReporter("fabrice"); + .setAssignee("simon"); db.issueDao().insert(session, issue); session.commit(); tester.get(IssueIndexer.class).indexAll(); diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/load_additional_fields.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/load_additional_fields.json index 4037df58091..c90e5bfaabe 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/load_additional_fields.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/load_additional_fields.json @@ -3,7 +3,6 @@ { "key": "82fd47d4-b650-4037-80bc-7b112bd4eac2", "assignee": "simon", - "reporter": "fabrice", "actions": [ "comment", "assign", "set_tags", "set_type", "assign_to_me" ], @@ -13,12 +12,6 @@ } ], "users": [ - { - "login": "fabrice", - "name": "Fabrice", - "email": "fabrice@email.com", - "active": true - }, { "login": "simon", "name": "Simon", diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/response_contains_all_fields_except_additional_fields.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/response_contains_all_fields_except_additional_fields.json index e1dcff8afbe..40a46f66b2e 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/response_contains_all_fields_except_additional_fields.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/response_contains_all_fields_except_additional_fields.json @@ -10,7 +10,6 @@ "message": "the message", "effort": "10min", "assignee": "simon", - "reporter": "fabrice", "author": "John", "tags": [ "bug", diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssueFilterParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssueFilterParameters.java index fd443367ebe..dd9da530544 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssueFilterParameters.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssueFilterParameters.java @@ -53,6 +53,11 @@ public class IssueFilterParameters { */ @Deprecated public static final String DEPRECATED_ACTION_PLANS = "actionPlans"; + + /** + * @deprecated since 5.5, manual issue feature has been dropped. + */ + @Deprecated public static final String REPORTERS = "reporters"; public static final String ASSIGNEES = "assignees"; public static final String AUTHORS = "authors"; diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesService.java index aeb9a126811..6b2766e4527 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesService.java @@ -49,7 +49,6 @@ import static org.sonarqube.ws.client.issue.IssueFilterParameters.ON_COMPONENT_O import static org.sonarqube.ws.client.issue.IssueFilterParameters.PROJECTS; import static org.sonarqube.ws.client.issue.IssueFilterParameters.PROJECT_KEYS; import static org.sonarqube.ws.client.issue.IssueFilterParameters.PROJECT_UUIDS; -import static org.sonarqube.ws.client.issue.IssueFilterParameters.REPORTERS; import static org.sonarqube.ws.client.issue.IssueFilterParameters.RESOLUTIONS; import static org.sonarqube.ws.client.issue.IssueFilterParameters.RESOLVED; import static org.sonarqube.ws.client.issue.IssueFilterParameters.RULES; @@ -95,7 +94,6 @@ public class IssuesService extends BaseService { .setParam(PROJECT_KEYS, inlineMultipleParamValue(request.getProjectKeys())) .setParam(PROJECT_UUIDS, inlineMultipleParamValue(request.getProjectUuids())) .setParam(PROJECTS, inlineMultipleParamValue(request.getProjects())) - .setParam(REPORTERS, inlineMultipleParamValue(request.getReporters())) .setParam(RESOLUTIONS, inlineMultipleParamValue(request.getResolutions())) .setParam(RESOLVED, request.getResolved()) .setParam(RULES, inlineMultipleParamValue(request.getRules())) diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/SearchWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/SearchWsRequest.java index 35f4e6d7e4c..057eb155e8c 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/SearchWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/SearchWsRequest.java @@ -52,7 +52,6 @@ public class SearchWsRequest { private List projectKeys; private List projectUuids; private List projects; - private List reporters; private List resolutions; private Boolean resolved; private List rules; @@ -303,16 +302,6 @@ public class SearchWsRequest { return this; } - @CheckForNull - public List getReporters() { - return reporters; - } - - public SearchWsRequest setReporters(@Nullable List reporters) { - this.reporters = reporters; - return this; - } - @CheckForNull public List getResolutions() { return resolutions; diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/issue/SearchWsRequestTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/issue/SearchWsRequestTest.java index 521dfb190b1..3033d88a728 100644 --- a/sonar-ws/src/test/java/org/sonarqube/ws/client/issue/SearchWsRequestTest.java +++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/issue/SearchWsRequestTest.java @@ -320,22 +320,6 @@ public class SearchWsRequestTest { assertThat(underTest.getProjects()).isSameAs(LIST_OF_STRINGS); } - @Test - public void getReporters_returns_null_when_SearchWsRequest_has_just_been_instantiated() { - assertThat(underTest.getReporters()).isNull(); - } - - @Test - public void setReporters_accepts_null() { - underTest.setReporters(null); - } - - @Test - public void getReporters_returns_object_from_setReporters() { - underTest.setReporters(LIST_OF_STRINGS); - assertThat(underTest.getReporters()).isSameAs(LIST_OF_STRINGS); - } - @Test public void getResolutions_returns_null_when_SearchWsRequest_has_just_been_instantiated() { assertThat(underTest.getResolutions()).isNull();