Browse Source

SONAR-7333 DB migration to set ISSUES.ISSUE_TYPE

tags/5.5-M6
Simon Brandhof 8 years ago
parent
commit
8dd5740bde
20 changed files with 326 additions and 18 deletions
  1. 2
    3
      server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java
  2. 2
    3
      server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java
  3. 0
    1
      server/sonar-server/src/main/java/org/sonar/server/user/index/UserIndexer.java
  4. 1
    1
      server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java
  5. 17
    0
      server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_facets.json
  6. 31
    0
      server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1107_feed_issues_types.rb
  7. 6
    0
      sonar-core/src/main/java/org/sonar/core/issue/IssueType.java
  8. 50
    0
      sonar-core/src/test/java/org/sonar/core/issue/IssueTypeTest.java
  9. 1
    1
      sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java
  10. 3
    1
      sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java
  11. 91
    0
      sonar-db/src/main/java/org/sonar/db/version/v55/FeedIssueTypes.java
  12. 1
    1
      sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql
  13. 1
    0
      sonar-db/src/test/java/org/sonar/db/issue/IssueDaoTest.java
  14. 1
    1
      sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java
  15. 79
    0
      sonar-db/src/test/java/org/sonar/db/version/v55/FeedIssueTypesTest.java
  16. 2
    2
      sonar-db/src/test/java/org/sonar/db/version/v55/FeedRulesLongDateColumnsTest.java
  17. 2
    0
      sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/get_by_key.xml
  18. 29
    0
      sonar-db/src/test/resources/org/sonar/db/version/v55/FeedIssueTypesTest/schema.sql
  19. 1
    1
      sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinition.java
  20. 6
    3
      sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssueFilterParameters.java

+ 2
- 3
server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java View File

@@ -44,9 +44,6 @@ import org.sonar.api.web.UserRole;
import org.sonar.core.issue.DefaultIssue;
import org.sonar.core.issue.DefaultIssueBuilder;
import org.sonar.core.issue.IssueChangeContext;
import org.sonar.core.issue.IssueType;
import org.sonar.server.issue.workflow.IssueWorkflow;
import org.sonar.server.issue.workflow.Transition;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.db.component.ComponentDto;
@@ -59,6 +56,8 @@ import org.sonar.server.issue.actionplan.ActionPlanService;
import org.sonar.server.issue.index.IssueDoc;
import org.sonar.server.issue.index.IssueIndex;
import org.sonar.server.issue.notification.IssueChangeNotification;
import org.sonar.server.issue.workflow.IssueWorkflow;
import org.sonar.server.issue.workflow.Transition;
import org.sonar.server.notification.NotificationManager;
import org.sonar.server.source.SourceService;
import org.sonar.server.user.UserSession;

+ 2
- 3
server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java View File

@@ -20,7 +20,6 @@
package org.sonar.server.issue.ws;

import com.google.common.base.Function;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.Lists;
import com.google.common.io.Resources;
import java.util.Collection;
@@ -38,7 +37,6 @@ import org.sonar.api.server.ws.WebService;
import org.sonar.api.server.ws.WebService.Param;
import org.sonar.api.utils.Paging;
import org.sonar.core.issue.IssueType;
import org.sonar.server.rule.RuleKeyFunctions;
import org.sonar.server.es.Facets;
import org.sonar.server.es.SearchOptions;
import org.sonar.server.es.SearchResult;
@@ -47,6 +45,7 @@ import org.sonar.server.issue.IssueQueryService;
import org.sonar.server.issue.IssueService;
import org.sonar.server.issue.index.IssueDoc;
import org.sonar.server.issue.index.IssueIndex;
import org.sonar.server.rule.RuleKeyFunctions;
import org.sonar.server.user.UserSession;
import org.sonarqube.ws.Issues.SearchWsResponse;
import org.sonarqube.ws.client.issue.IssueFilterParameters;
@@ -347,7 +346,7 @@ public class SearchAction implements IssuesWsAction {
addMandatoryValuesToFacet(facets, IssueFilterParameters.RULES, request.getRules());
addMandatoryValuesToFacet(facets, IssueFilterParameters.LANGUAGES, request.getLanguages());
addMandatoryValuesToFacet(facets, IssueFilterParameters.TAGS, request.getTags());
addMandatoryValuesToFacet(facets, IssueFilterParameters.TYPES, request.getTypes());
addMandatoryValuesToFacet(facets, IssueFilterParameters.TYPES, IssueType.ALL_NAMES);
List<String> actionPlans = Lists.newArrayList("");
List<String> actionPlansFromRequest = request.getActionPlans();
if (actionPlansFromRequest != null) {

+ 0
- 1
server/sonar-server/src/main/java/org/sonar/server/user/index/UserIndexer.java View File

@@ -21,7 +21,6 @@ package org.sonar.server.user.index;

import java.util.Iterator;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.update.UpdateRequest;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.server.es.BaseIndexer;

+ 1
- 1
server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java View File

@@ -358,7 +358,7 @@ public class SearchActionMediumTest {
userSessionRule.login("john");
WsTester.Result result = wsTester.newGetRequest(IssuesWs.API_ENDPOINT, SearchAction.SEARCH_ACTION)
.setParam("resolved", "false")
.setParam(WebService.Param.FACETS, "statuses,severities,resolutions,projectUuids,rules,fileUuids,assignees,languages,actionPlans")
.setParam(WebService.Param.FACETS, "statuses,severities,resolutions,projectUuids,rules,fileUuids,assignees,languages,actionPlans,types")
.execute();
result.assertJson(this.getClass(), "display_facets.json");
}

+ 17
- 0
server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_facets.json View File

@@ -138,5 +138,22 @@
"count": 1
}
]
},
{
"property": "types",
"values": [
{
"val": "CODE_SMELL",
"count": 1
},
{
"val": "BUG",
"count": 0
},
{
"val": "VULNERABILITY",
"count": 0
}
]
}
]}

+ 31
- 0
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1107_feed_issues_types.rb View File

@@ -0,0 +1,31 @@
#
# SonarQube, open source software quality management tool.
# Copyright (C) 2008-2014 SonarSource
# mailto:contact AT sonarsource DOT com
#
# SonarQube is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# SonarQube is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#

#
# SonarQube 5.5
# MMF-141
#
class FeedIssuesTypes < ActiveRecord::Migration

def self.up
execute_java_migration('org.sonar.db.version.v55.FeedIssueTypes')
end

end

+ 6
- 0
sonar-core/src/main/java/org/sonar/core/issue/IssueType.java View File

@@ -19,6 +19,10 @@
*/
package org.sonar.core.issue;

import com.google.common.base.Enums;
import com.google.common.collect.Lists;
import java.util.List;

import static java.lang.String.format;

public enum IssueType {
@@ -46,4 +50,6 @@ public enum IssueType {
}
throw new IllegalArgumentException(format("Unsupported value for db column ISSUES.ISSUE_TYPE: %d", dbConstant));
}

public static List<String> ALL_NAMES = Lists.transform(Lists.newArrayList(values()), Enums.stringConverter(IssueType.class).reverse());
}

+ 50
- 0
sonar-core/src/test/java/org/sonar/core/issue/IssueTypeTest.java View File

@@ -0,0 +1,50 @@
/*
* SonarQube
* Copyright (C) 2009-2016 SonarSource SA
* mailto:contact AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.core.issue;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import static org.assertj.core.api.Assertions.assertThat;

public class IssueTypeTest {

@Rule
public ExpectedException expectedException = ExpectedException.none();

@Test
public void test_valueOf_db_constant() {
assertThat(IssueType.valueOf(1)).isEqualTo(IssueType.CODE_SMELL);
assertThat(IssueType.valueOf(2)).isEqualTo(IssueType.BUG);
}

@Test
public void valueOf_throws_ISE_if_unsupported_db_constant() {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("Unsupported value for db column ISSUES.ISSUE_TYPE: 4");
IssueType.valueOf(4);
}

@Test
public void test_ALL_NAMES() {
assertThat(IssueType.ALL_NAMES).containsOnly("BUG", "VULNERABILITY", "CODE_SMELL");
}
}

+ 1
- 1
sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java View File

@@ -29,7 +29,7 @@ import org.sonar.db.MyBatis;

public class DatabaseVersion {

public static final int LAST_VERSION = 1106;
public static final int LAST_VERSION = 1107;

/**
* The minimum supported version which can be upgraded. Lower

+ 3
- 1
sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java View File

@@ -72,6 +72,7 @@ import org.sonar.db.version.v54.RemovePreviewPermission;
import org.sonar.db.version.v55.AddIssuesType;
import org.sonar.db.version.v55.AddRulesLongDateColumns;
import org.sonar.db.version.v55.DeleteMeasuresWithCharacteristicId;
import org.sonar.db.version.v55.FeedIssueTypes;
import org.sonar.db.version.v55.FeedRulesLongDateColumns;

public class MigrationStepModule extends Module {
@@ -143,7 +144,8 @@ public class MigrationStepModule extends Module {
AddRulesLongDateColumns.class,
FeedRulesLongDateColumns.class,
DeleteMeasuresWithCharacteristicId.class,
AddIssuesType.class
AddIssuesType.class,
FeedIssueTypes.class
);
}
}

+ 91
- 0
sonar-db/src/main/java/org/sonar/db/version/v55/FeedIssueTypes.java View File

@@ -0,0 +1,91 @@
/*
* SonarQube
* Copyright (C) 2009-2016 SonarSource SA
* mailto:contact AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.db.version.v55;

import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import java.sql.SQLException;
import java.util.List;
import org.sonar.api.utils.System2;
import org.sonar.core.issue.IssueType;
import org.sonar.db.Database;
import org.sonar.db.version.BaseDataChange;
import org.sonar.db.version.MassUpdate;
import org.sonar.db.version.MassUpdate.Handler;
import org.sonar.db.version.Select.Row;
import org.sonar.db.version.SqlStatement;

import static com.google.common.collect.Lists.newArrayList;
import static org.apache.commons.lang.StringUtils.defaultString;

/**
* Duplicates RuleTagsToTypeConverter from API on purpose. Db migration must be isolated and must not
* depend on external code that may evolve over time.
*
* https://jira.sonarsource.com/browse/MMF-141
*/
public class FeedIssueTypes extends BaseDataChange {

private final long now;

public FeedIssueTypes(Database db, System2 system) {
super(db);
this.now = system.now();
}

@Override
public void execute(Context context) throws SQLException {
final Splitter tagSplitter = Splitter.on(',');
final Joiner tagJoiner = Joiner.on(',').skipNulls();

MassUpdate update = context.prepareMassUpdate().rowPluralName("issues");
update.select("SELECT id, tags FROM issues WHERE issue_type IS NULL OR issue_type=0");
update.update("UPDATE issues SET issue_type=?, tags=?, updated_at=? WHERE id=?");
update.execute(new Handler() {
@Override
public boolean handle(Row row, SqlStatement update) throws SQLException {
long id = row.getLong(1);

// See algorithm to deduce type from tags in RuleTagsToTypeConverter
List<String> tags = newArrayList(tagSplitter.split(defaultString(row.getNullableString(2))));
IssueType type = tagsToType(tags);
tags.remove("bug");
tags.remove("security");

update.setInt(1, type.getDbConstant());
update.setString(2, tagJoiner.join(tags));
update.setLong(3, now);
update.setLong(4, id);
return true;
}
});
}

static IssueType tagsToType(List<String> tags) {
IssueType type = IssueType.CODE_SMELL;
if (tags.contains("bug")) {
type = IssueType.BUG;
} else if (tags.contains("security")) {
type = IssueType.VULNERABILITY;
}
return type;
}

}

+ 1
- 1
sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql View File

@@ -381,7 +381,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1100');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1101');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1102');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1103');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1106');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1107');

INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, EXTERNAL_IDENTITY, EXTERNAL_IDENTITY_PROVIDER, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT, REMEMBER_TOKEN, REMEMBER_TOKEN_EXPIRES_AT) VALUES (1, 'admin', 'Administrator', '', 'admin', 'sonarqube', 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '1418215735482', '1418215735482', null, null);
ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2;

+ 1
- 0
sonar-db/src/test/java/org/sonar/db/issue/IssueDaoTest.java View File

@@ -106,6 +106,7 @@ public class IssueDaoTest {
assertThat(issue.getRuleId()).isEqualTo(500);
assertThat(issue.getLanguage()).isEqualTo("java");
assertThat(issue.getSeverity()).isEqualTo("BLOCKER");
assertThat(issue.getType()).isEqualTo(2);
assertThat(issue.isManualSeverity()).isFalse();
assertThat(issue.getMessage()).isNull();
assertThat(issue.getLine()).isEqualTo(200);

+ 1
- 1
sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java View File

@@ -29,6 +29,6 @@ public class MigrationStepModuleTest {
public void verify_count_of_added_MigrationStep_types() {
ComponentContainer container = new ComponentContainer();
new MigrationStepModule().configure(container);
assertThat(container.size()).isEqualTo(55);
assertThat(container.size()).isEqualTo(56);
}
}

+ 79
- 0
sonar-db/src/test/java/org/sonar/db/version/v55/FeedIssueTypesTest.java View File

@@ -0,0 +1,79 @@
/*
* SonarQube
* Copyright (C) 2009-2016 SonarSource SA
* mailto:contact AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.db.version.v55;

import java.util.Arrays;
import java.util.Collections;
import org.junit.Rule;
import org.junit.Test;
import org.sonar.api.utils.System2;
import org.sonar.core.issue.IssueType;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
import org.sonar.db.issue.IssueDto;
import org.sonar.db.version.MigrationStep;

import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.sonar.db.version.v55.FeedIssueTypes.tagsToType;

public class FeedIssueTypesTest {

@Rule
public DbTester db = DbTester.createForSchema(System2.INSTANCE, FeedIssueTypesTest.class, "schema.sql");

@Test
public void test_tagsToType() {
assertThat(tagsToType(asList("misra", "bug"))).isEqualTo(IssueType.BUG);
assertThat(tagsToType(asList("misra", "security"))).isEqualTo(IssueType.VULNERABILITY);

// "bug" has priority on "security"
assertThat(tagsToType(asList("security", "bug"))).isEqualTo(IssueType.BUG);

// default is "code smell"
assertThat(tagsToType(asList("clumsy", "spring"))).isEqualTo(IssueType.CODE_SMELL);
assertThat(tagsToType(Collections.<String>emptyList())).isEqualTo(IssueType.CODE_SMELL);
}

@Test
public void test_migration() throws Exception {
try (DbSession dbSession = db.getSession()) {
IssueDto codeSmell = new IssueDto().setKee("code_smell").setTags(Arrays.asList("clumsy", "spring"));
IssueDto withoutTags = new IssueDto().setKee("without_tags");
IssueDto bug = new IssueDto().setKee("bug").setTags(Arrays.asList("clumsy", "bug"));
db.getDbClient().issueDao().insert(dbSession, codeSmell, withoutTags, bug);
dbSession.commit();

MigrationStep underTest = new FeedIssueTypes(db.database(), mock(System2.class));
underTest.execute();

assertType("code_smell", IssueType.CODE_SMELL);
assertType("without_tags", IssueType.CODE_SMELL);
assertType("bug", IssueType.BUG);
}
}

private void assertType(String issueKey, IssueType expectedType) {
Number type = (Number)db.selectFirst("select * from issues where kee='" + issueKey + "'").get("ISSUE_TYPE");
assertThat(type.intValue()).isEqualTo(expectedType.getDbConstant());
}

}

+ 2
- 2
sonar-db/src/test/java/org/sonar/db/version/v55/FeedRulesLongDateColumnsTest.java View File

@@ -39,7 +39,7 @@ public class FeedRulesLongDateColumnsTest {

System2 system = mock(System2.class);

MigrationStep migration = new FeedRulesLongDateColumns(db.database(), system);
MigrationStep underTest = new FeedRulesLongDateColumns(db.database(), system);

@Before
public void setUp() throws Exception {
@@ -50,7 +50,7 @@ public class FeedRulesLongDateColumnsTest {
public void execute() throws Exception {
db.prepareDbUnit(getClass(), "execute.xml");

migration.execute();
underTest.execute();

assertThat(db.countSql("select count(*) from rules where created_at_ms is not null and updated_at_ms is not null")).isEqualTo(3);
// Only 1 rules not updated

+ 2
- 0
sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/get_by_key.xml View File

@@ -24,6 +24,7 @@
created_at="1400000000000"
updated_at="1450000000000"
locations="[null]"
issue_type="2"
/>

<issues
@@ -50,6 +51,7 @@
created_at="1400000000000"
updated_at="1450000000000"
locations="[null]"
issue_type="2"
/>

</dataset>

+ 29
- 0
sonar-db/src/test/resources/org/sonar/db/version/v55/FeedIssueTypesTest/schema.sql View File

@@ -0,0 +1,29 @@
CREATE TABLE "ISSUES" (
"ID" BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
"KEE" VARCHAR(50) UNIQUE NOT NULL,
"COMPONENT_UUID" VARCHAR(50),
"PROJECT_UUID" VARCHAR(50),
"RULE_ID" INTEGER,
"SEVERITY" VARCHAR(10),
"MANUAL_SEVERITY" BOOLEAN NOT NULL,
"MESSAGE" VARCHAR(4000),
"LINE" INTEGER,
"EFFORT_TO_FIX" DOUBLE,
"TECHNICAL_DEBT" INTEGER,
"STATUS" VARCHAR(20),
"RESOLUTION" VARCHAR(20),
"CHECKSUM" VARCHAR(1000),
"REPORTER" VARCHAR(255),
"ASSIGNEE" VARCHAR(255),
"AUTHOR_LOGIN" VARCHAR(255),
"ACTION_PLAN_KEY" VARCHAR(50) NULL,
"ISSUE_ATTRIBUTES" VARCHAR(4000),
"TAGS" VARCHAR(4000),
"ISSUE_CREATION_DATE" BIGINT,
"ISSUE_CLOSE_DATE" BIGINT,
"ISSUE_UPDATE_DATE" BIGINT,
"CREATED_AT" BIGINT,
"UPDATED_AT" BIGINT,
"LOCATIONS" BLOB(167772150),
"ISSUE_TYPE" TINYINT
);

+ 1
- 1
sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinition.java View File

@@ -929,7 +929,7 @@ public interface RulesDefinition {
this.status = newRule.status;
this.debtRemediationFunction = newRule.debtRemediationFunction;
this.effortToFixDescription = newRule.effortToFixDescription;
this.type = (newRule.type == null ? RuleTagsToTypeConverter.convert(newRule.tags) : newRule.type);
this.type = newRule.type == null ? RuleTagsToTypeConverter.convert(newRule.tags) : newRule.type;
this.tags = ImmutableSortedSet.copyOf(Sets.difference(newRule.tags, RuleTagsToTypeConverter.RESERVED_TAGS));
ImmutableMap.Builder<String, Param> paramsBuilder = ImmutableMap.builder();
for (NewParam newParam : newRule.paramsByKey.values()) {

+ 6
- 3
sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssueFilterParameters.java View File

@@ -75,9 +75,12 @@ public class IssueFilterParameters {

public static final String FACET_ASSIGNED_TO_ME = "assigned_to_me";

public static final List<String> ALL = ImmutableList.of(ISSUES, SEVERITIES, STATUSES, RESOLUTIONS, RESOLVED, COMPONENTS, COMPONENT_ROOTS, RULES, ACTION_PLANS, REPORTERS, TAGS, TYPES,
ASSIGNEES, LANGUAGES, ASSIGNED, PLANNED, HIDE_RULES, CREATED_AT, CREATED_AFTER, CREATED_BEFORE, CREATED_IN_LAST, COMPONENT_UUIDS, COMPONENT_ROOT_UUIDS, FACET_MODE,
PROJECTS, PROJECT_UUIDS, PROJECT_KEYS, COMPONENT_KEYS, MODULE_UUIDS, DIRECTORIES, FILE_UUIDS, AUTHORS, HIDE_COMMENTS, PAGE_SIZE, PAGE_INDEX, SORT, ASC);
public static final List<String> ALL = ImmutableList.of(ISSUES, SEVERITIES, STATUSES, RESOLUTIONS, RESOLVED,
COMPONENTS, COMPONENT_ROOTS, RULES, ACTION_PLANS, REPORTERS, TAGS, TYPES,
ASSIGNEES, LANGUAGES, ASSIGNED, PLANNED, HIDE_RULES, CREATED_AT, CREATED_AFTER, CREATED_BEFORE, CREATED_IN_LAST,
COMPONENT_UUIDS, COMPONENT_ROOT_UUIDS, FACET_MODE,
PROJECTS, PROJECT_UUIDS, PROJECT_KEYS, COMPONENT_KEYS, MODULE_UUIDS, DIRECTORIES, FILE_UUIDS, AUTHORS,
HIDE_COMMENTS, PAGE_SIZE, PAGE_INDEX, SORT, ASC);

public static final List<String> ALL_WITHOUT_PAGINATION = ImmutableList.copyOf(Iterables.filter(ALL, new Predicate<String>() {
@Override

Loading…
Cancel
Save