Skip to content

Commit

Permalink
[mc1arke#137][GitLab] Adjust property name to be passed to Sonar
Browse files Browse the repository at this point in the history
Only properties starting with "sonar.analysis." are available from the analysis context:
https://docs.sonarqube.org/latest/analysis/analysis-parameters/
  • Loading branch information
szpak committed Jul 3, 2022
1 parent e23009c commit 5baff3e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 5baff3e

Please sign in to comment.