aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Campomenosi <109955405+benjamin-campomenosi-sonarsource@users.noreply.github.com>2022-09-16 14:49:19 +0200
committersonartech <sonartech@sonarsource.com>2022-09-19 20:03:08 +0000
commit1e1e26d5dc136036fc4cbfde759e4879e098f519 (patch)
treeda7c81e1b6c1a60b5e08da50f405d14dd14665ad
parent2030fa060a172f6e6eae760ed0abb993efb32755 (diff)
downloadsonarqube-1e1e26d5dc136036fc4cbfde759e4879e098f519.tar.gz
sonarqube-1e1e26d5dc136036fc4cbfde759e4879e098f519.zip
SONAR-17271 update issue from github webhook
-rw-r--r--server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/scanning/alert/GithubScanningAlertState.java9
-rw-r--r--server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/IssueUpdater.java3
2 files changed, 4 insertions, 8 deletions
diff --git a/server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/scanning/alert/GithubScanningAlertState.java b/server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/scanning/alert/GithubScanningAlertState.java
index 625799d34fd..547ccda0b13 100644
--- a/server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/scanning/alert/GithubScanningAlertState.java
+++ b/server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/scanning/alert/GithubScanningAlertState.java
@@ -23,15 +23,10 @@ import com.google.gson.annotations.SerializedName;
import javax.annotation.Nullable;
public class GithubScanningAlertState {
- protected static final String GH_OPEN = "open";
- protected static final String GH_DISMISSED = "dismissed";
- protected static final String GH_WONTFIX = "won't fix";
- protected static final String GH_FALSE_POSITIVE = "false positive";
-
@SerializedName("state")
- private String state;
+ private final String state;
@SerializedName("dismissed_reason")
- private String dismissedReason;
+ private final String dismissedReason;
public GithubScanningAlertState(String state, @Nullable String dismissedReason) {
this.state = state;
diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/IssueUpdater.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/IssueUpdater.java
index ceb3870e7a3..741726e68e6 100644
--- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/IssueUpdater.java
+++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/IssueUpdater.java
@@ -111,7 +111,8 @@ public class IssueUpdater {
// name of rule is displayed in notification, rule must therefor be present
|| ruleDto == null
// notification are not supported on PRs
- || !hasNotificationSupport(branchDto)) {
+ || !hasNotificationSupport(branchDto)
+ || context.fromAlm()) {
return issueDto;
}