Hello,
we are facing a problem described as part of this issue: GitLab integration as external status check instead of failing the ci pipeline - SonarQube / Product Manager for a Day - Sonar Community (sonarsource.com).
Quote
The recommendation to prevent merge of MRs containing failing quality gate is to fail the corresponding pipeline.
However, we often have this workflow:
- A quality gate is failing for a change
- Some findings are marked as “won’t fixed” directly in SonarQube
- The quality gate is green again.
With the current proposed integration, this means we have to rebuild the pipeline.
End quote
We have the same kind of workflow. What we are looking for is this: When the quality gate is green again, after choosing “wontfix” on SonarQube for example, there should be an API call to GitLab to trigger or restart the pipeline automatically, such that the merge request decoration is set to what is reported on the SonarQube side. The relevant API call would be this one I think: Pipelines API | GitLab. SonarQube knows where to put the merge request decoration, so it must know about the merge request ID/IID. The specific pipeline could be figured out using the Merge Requests API.
Is there already such a feature? If not, this issue can be seen as a feature request.
SonarQube server details:
- SonarQube 10.6 (build 92116)
- Self-managed, deployed using Docker
GitLab server details:
- GitLab 17.1.6
- Self-managed
Best regards,
Timo Reichl