diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-02-24 11:44:01 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-02-26 14:30:35 +0100 |
commit | bc6df3ab12c13a5da5fbd5105d11e16c08a43639 (patch) | |
tree | 53a67094b6a9acc448d817f5ede1b77fb5ae2282 /sonar-ws | |
parent | 12e70acc1a8cdcbc5e6af31c4c0ed6894435a75c (diff) | |
download | sonarqube-bc6df3ab12c13a5da5fbd5105d11e16c08a43639.tar.gz sonarqube-bc6df3ab12c13a5da5fbd5105d11e16c08a43639.zip |
SONAR-7333 add field "type" to issues (db and elasticsearch)
Diffstat (limited to 'sonar-ws')
3 files changed, 26 insertions, 1 deletions
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 b2ab430dd00..96e71ee495c 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,7 @@ public class IssueFilterParameters { public static final String AUTHORS = "authors"; public static final String LANGUAGES = "languages"; public static final String TAGS = "tags"; + public static final String TYPES = "types"; public static final String ASSIGNED = "assigned"; public static final String PLANNED = "planned"; public static final String HIDE_RULES = "hideRules"; @@ -74,7 +75,7 @@ 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, + 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); 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 171309a17ea..c6520738eb4 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 @@ -61,6 +61,7 @@ public class SearchWsRequest { private List<String> severities; private List<String> statuses; private List<String> tags; + private List<String> types; @CheckForNull public List<String> getActionPlans() { @@ -393,6 +394,16 @@ public class SearchWsRequest { } @CheckForNull + public List<String> getTypes() { + return types; + } + + public SearchWsRequest setTypes(@Nullable List<String> types) { + this.types = types; + return this; + } + + @CheckForNull public List<String> getComponentRootUuids() { return componentRootUuids; } diff --git a/sonar-ws/src/main/protobuf/ws-issues.proto b/sonar-ws/src/main/protobuf/ws-issues.proto index 87a34a07390..077871bebe1 100644 --- a/sonar-ws/src/main/protobuf/ws-issues.proto +++ b/sonar-ws/src/main/protobuf/ws-issues.proto @@ -54,6 +54,17 @@ message Operation { repeated ActionPlan actionPlans = 5; } +enum IssueType { + // Zero is required in order to not get MAINTAINABILITY as default value + // See http://androiddevblog.com/protocol-buffers-pitfall-adding-enum-values/ + UNKNOWN = 0; + + // same name as in Java enum IssueType, + // same index values as in database (see column ISSUES.ISSUE_TYPE) + CODE_SMELL = 1; + BUG = 2; + VULNERABILITY = 3; +} message Issue { optional string key = 1; @@ -90,6 +101,8 @@ message Issue { optional string updateDate = 24; optional string fUpdateAge = 25; optional string closeDate = 26; + + optional IssueType type = 27; } message Transitions { |