]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-20796 Use severity/type mapping for BitBucket Cloud
authorJacek Poreda <jacek.poreda@sonarsource.com>
Thu, 26 Oct 2023 15:52:13 +0000 (17:52 +0200)
committersonartech <sonartech@sonarsource.com>
Mon, 30 Oct 2023 20:04:03 +0000 (20:04 +0000)
server/sonar-webserver-api/src/main/java/org/sonar/server/qualitygate/changeevent/ChangedIssueImpl.java
server/sonar-webserver-api/src/main/java/org/sonar/server/qualitygate/changeevent/QGChangeEventListener.java

index 60a8bb403d2d42f5e10db042b754234d8de59582..0fbdb9bc9b2a8e779a7ce045a75caaa953f7197b 100644 (file)
  */
 package org.sonar.server.qualitygate.changeevent;
 
+import java.util.Map;
 import java.util.Objects;
 import org.sonar.api.issue.Issue;
+import org.sonar.api.issue.impact.Severity;
+import org.sonar.api.issue.impact.SoftwareQuality;
 import org.sonar.api.rules.RuleType;
 import org.sonar.core.issue.DefaultIssue;
 
 class ChangedIssueImpl implements QGChangeEventListener.ChangedIssue {
   private final String key;
   private final QGChangeEventListener.Status status;
+  private final Map<SoftwareQuality, Severity> impacts;
   private final RuleType type;
   private final String severity;
   private final boolean fromAlm;
@@ -40,6 +44,7 @@ class ChangedIssueImpl implements QGChangeEventListener.ChangedIssue {
     this.status = statusOf(issue);
     this.type = issue.type();
     this.severity = issue.severity();
+    this.impacts = issue.impacts();
     this.fromAlm = fromAlm;
   }
 
@@ -92,6 +97,11 @@ class ChangedIssueImpl implements QGChangeEventListener.ChangedIssue {
     return type;
   }
 
+  @Override
+  public Map<SoftwareQuality, Severity> getImpacts() {
+    return impacts;
+  }
+
   @Override
   public String getSeverity() {
     return severity;
index d0acdcc2f55e3ebb4fc790e7ef8947afa576fd16..f1decc3f375fb692aeee88ff1d03ef95dd1066d3 100644 (file)
 package org.sonar.server.qualitygate.changeevent;
 
 import java.util.EnumSet;
+import java.util.Map;
 import java.util.Set;
+import org.sonar.api.issue.impact.Severity;
+import org.sonar.api.issue.impact.SoftwareQuality;
 import org.sonar.api.rules.RuleType;
 import org.sonar.api.server.ServerSide;
 
@@ -44,6 +47,8 @@ public interface QGChangeEventListener {
 
     RuleType getType();
 
+    Map<SoftwareQuality, Severity> getImpacts();
+
     String getSeverity();
 
     default boolean isNotClosed() {