Skip to content

Commit 9a20b75

Browse files
PLUGINAPI-155 Add issue internal tags (#246)
Co-authored-by: antoine.vinot <antoine.vinot@sonarsource.com>
1 parent 3ed5768 commit 9a20b75

3 files changed

Lines changed: 43 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 13.1
4+
* Introduce support for internal tags on issues:
5+
* Introduce `org.sonar.api.batch.sensor.issue.Issue.internalTags()`
6+
* Introduce `org.sonar.api.batch.sensor.issue.NewIssue.addInternalTag(String tag)`
7+
* Introduce `org.sonar.api.batch.sensor.issue.NewIssue.addInternalTags(Collection<String> tags)`
8+
* Introduce `org.sonar.api.batch.sensor.issue.NewIssue.setInternalTags(@Nullable Collection<String> tags)`
9+
310
## 13.0
411
* Remove deprecated complexity metrics:
512
* `org.sonar.api.measures.CoreMetrics.FILE_COMPLEXITY`.

plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/Issue.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.util.Map;
2424
import java.util.Optional;
2525
import javax.annotation.CheckForNull;
26+
import org.sonar.api.Beta;
2627
import org.sonar.api.batch.rule.Severity;
2728
import org.sonar.api.batch.sensor.Sensor;
2829
import org.sonar.api.batch.sensor.issue.NewIssue.FlowType;
@@ -112,4 +113,13 @@ interface Flow {
112113
*/
113114
@CheckForNull
114115
List<String> codeVariants();
116+
117+
/**
118+
* Technical tags for the issue - for internal use only.
119+
* This API is experimental and can be changed or dropped at any time.
120+
*
121+
* @since 13.1
122+
*/
123+
@Beta
124+
List<String> internalTags();
115125
}

plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/NewIssue.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*/
2020
package org.sonar.api.batch.sensor.issue;
2121

22+
import java.util.Collection;
2223
import javax.annotation.Nullable;
2324
import org.sonar.api.batch.rule.Severity;
2425
import org.sonar.api.batch.sensor.Sensor;
@@ -149,4 +150,29 @@ enum FlowType {
149150
*/
150151
NewIssue setCodeVariants(@Nullable Iterable<String> codeVariants);
151152

153+
/**
154+
* Register an internal tag for this issue.
155+
*
156+
* @param tag a String tag
157+
* @since 13.1
158+
*/
159+
NewIssue addInternalTag(String tag);
160+
161+
/**
162+
* Register a collection of internal tags for this issue.
163+
*
164+
* @param tag a Collection of String tags
165+
* @since 13.1
166+
*/
167+
NewIssue addInternalTags(Collection<String> tags);
168+
169+
/**
170+
* Set the internal tags for this issue.
171+
* This will override any previously set internal tags.
172+
*
173+
* @param tags a Collection of String tags
174+
* @since 13.1
175+
*/
176+
NewIssue setInternalTags(@Nullable Collection<String> tags);
177+
152178
}

0 commit comments

Comments
 (0)