- SQ version: 7.3
- Jenkins Sonar scanner: 2.8.1
I’m analyzing a .Net project in SonarQube from Jenkins.
The project has a backend and a frontend whose build and analysis is run in 2 parallel stages in Jenkins, publishing the results in 2 separated SQ projects.
Now i’m trying to get the result of the quality gate for each project, to update the status of the Jenkins build accordingly.
But the result i get from waitForQualityGate is incorrect for the second analysis.
Frontend analysis completes first with a warning status, waitForQualityGate returns warn status, ok.
Backend analysis completes second with a failure status, waitForQualityGate returns warn status, ko.
I think the issue comes from “SonarQube taskId is correctly attached to the pipeline context”, as described in https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-jenkins/#header-6
My guess is that the taskId of the frontend analysis is also used for the backend. I did not find a way to manage this waitForQualityGate does not accept any parameter.
I tried posting backend and frontend analysis to the same SQ project to avoid mixing results, but in this case, SQ switches continuously between backend and frontend profiles, only keeping the results of the last analysis (backend in my case).
How should i address this issue?