From 5baff3ee84aa5195995f3b1b0480bac57b527040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zaj=C4=85czkowski?= <148013+szpak@users.noreply.github.com> Date: Sun, 3 Jul 2022 10:44:20 +0200 Subject: [PATCH] [#137][GitLab] Adjust property name to be passed to Sonar Only properties starting with "sonar.analysis." are available from the analysis context: https://docs.sonarqube.org/latest/analysis/analysis-parameters/ --- .../ce/pullrequest/gitlab/GitlabMergeRequestDecorator.java | 2 +- .../ce/pullrequest/gitlab/GitlabMergeRequestDecoratorTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/gitlab/GitlabMergeRequestDecorator.java b/src/main/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/gitlab/GitlabMergeRequestDecorator.java index 15b60c010..812cb9550 100644 --- a/src/main/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/gitlab/GitlabMergeRequestDecorator.java +++ b/src/main/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/gitlab/GitlabMergeRequestDecorator.java @@ -53,7 +53,7 @@ public class GitlabMergeRequestDecorator extends DiscussionAwarePullRequestDecor public static final String PULLREQUEST_GITLAB_PIPELINE_ID = "com.github.mc1arke.sonarqube.plugin.branch.pullrequest.gitlab.pipelineId"; public static final String PULLREQUEST_GITLAB_DONT_FAIL_PIPELINE = - "com.github.mc1arke.sonarqube.plugin.branch.pullrequest.gitlab.dontFailPipeline"; + "sonar.analysis.com.github.mc1arke.sonarqube.plugin.branch.pullrequest.gitlab.dontFailPipeline"; private final GitlabClientFactory gitlabClientFactory; private final MarkdownFormatterFactory formatterFactory; diff --git a/src/test/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/gitlab/GitlabMergeRequestDecoratorTest.java b/src/test/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/gitlab/GitlabMergeRequestDecoratorTest.java index 5169bf49f..215de1410 100644 --- a/src/test/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/gitlab/GitlabMergeRequestDecoratorTest.java +++ b/src/test/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/gitlab/GitlabMergeRequestDecoratorTest.java @@ -658,7 +658,7 @@ void shouldSubmitRequestedPipelineStatusBasedOnPropertiesAndUnresolvedSummaryCom when(analysisDetails.getQualityGateStatus()).thenReturn(QualityGate.Status.ERROR); when(analysisDetails.getCommitSha()).thenReturn("other sha"); when(analysisDetails.getScannerProperty("com.github.mc1arke.sonarqube.plugin.branch.pullrequest.gitlab.pipelineId")).thenReturn(Optional.of("11")); - when(analysisDetails.getScannerProperty("com.github.mc1arke.sonarqube.plugin.branch.pullrequest.gitlab.dontFailPipeline")).thenReturn(dontFailPipelinePropertyValue); + when(analysisDetails.getScannerProperty("sonar.analysis.com.github.mc1arke.sonarqube.plugin.branch.pullrequest.gitlab.dontFailPipeline")).thenReturn(dontFailPipelinePropertyValue); when(analysisSummary.format(any())).thenReturn("Different Summary comment"); when(analysisSummary.getDashboardUrl()).thenReturn("https://sonarqube2.dummy/dashboard?id=projectKey&pullRequest=123");