- versions used (SonarQube, Scanner, Plugin, and any relevant extension)
Sonarqube: 8.1-developer-beta
Sonarscanner: 4.0.0
Sonar Jenkins Plugin: 2.11
We have a Problem with the SonarQube Jenkins Plugin and the waitForQualityGate step where successful SonarQube checks are not forwarded to the waitForQualityGate step.
As far as I understood the logic of the Jenkins plugin it makes a POST request to the SonarQube QualityGate API endpoint and checks the status there, which either is SUCCESS or something like IN_PROGRESS. When it is still in progress Jenkins waits for the incoming webhook and reports back to waitForQualityGate step in the pipeline, which works fine.
When the request returns SUCCESS it seems like jenkins doesn’t wait for the webhook, which is fine I guess, but also the waitForQualityGate step in the pipeline doesn’t get notified.
Jenkins Logs:
Full details of the POST was
{"serverUrl":"https://ourhost.com",
"taskId":"AXDEniu_9bDjw4Tv_jLg",
"status":"SUCCESS",
"analysedAt":"2020-0310T13:24:18+0000",
"revision":"8629b3831a759a5d402903558fd33b015caf5045",
"changedAt":"2020-03-10T13:24:18+0000",
"project":{"key":"our-project-key",
"name":"Project name","url":"https://sonarqube.ourhost.com/dashboard?id=our-project-key"},"branch":{"name":"329","type":"PULL_REQUEST","isMain":false,"url":"https://sonarqube.ourhost.com/dashboard?id=our-project-key&pullRequest=329"},"qualityGate":{"name":"Quality Gate","status":"OK","conditions":[...]},"properties":{}}
waitForQualityGate step in Jenkinfile:
...
steps {
timeout(time: 1, unit: 'HOURS') {
waitForQualityGate abortPipeline: true
}
}
...
Expected behaviour:
Jenkins gets notified about the Quality Gate result when the POST-Request had Status: SUCCESS
Actual Behaviour:
Jenkins is stuck in waitForQualityGate after POST-Request had Status: SUCCESS and runs into the timeout or in case Status was IN_PROGRES it waits for the webhook.
Please let us know a solution if there is one.
Thanks.
