I want to find an alternative way for sonar build-breaker plugin and found this article
I followed the steps mentioned and configured the pipeline as
node {
stage('SCM') {
git 'https://github.com/SonarSource/sonar-scanning-examples.git'
}
stage('build & SonarQube Scan') {
withSonarQubeEnv('sonarhost') {
dir("${env.WORKSPACE}/sonarqube-scanner-gradle/gradle-basic"){
sh "pwd"
sh 'dir $WORKSPACE/sonarqube-scanner-gradle/gradle-basic'
sh 'echo ${PWD}'
sh 'gradle tasks --all'
sh 'cd $WORKSPACE/sonarqube-scanner-gradle/gradle-basic'
sh 'echo ${PWD}'
sh 'gradle sonarqube --debug -Dsonar.login=my-login-token'
} // SonarQube taskId is automatically attached to the pipeline context
}
}
// No need to occupy a node
stage("Quality Gate") {
timeout(time: 1, unit: 'HOURS') {
def qg = waitForQualityGate(webhookSecretId: 'my-login-token')
if (qg.status != 'OK') {
error "Pipeline aborted due to quality gate failure: ${qg.status}"
}
}
}
}
The pipeline goes upto timeout(time: 1, unit: âHOURSâ) step and then it fails with the error
Checking status of SonarQube task 'AX_5A5YSuhDrgrHn3OgE' on server 'sonarhost'
org.sonarqube.ws.client.HttpException: Error 404 on http://sonarqube-domain.com:9000/api/ce/task?id=AX_5A5YSuhDrgrHn3OgE :
at org.sonarqube.ws.client.BaseResponse.failIfNotSuccessful(BaseResponse.java:36)
at hudson.plugins.sonar.client.HttpClient.getHttp(HttpClient.java:38)
at hudson.plugins.sonar.client.WsClient.getCETask(WsClient.java:51)
at org.sonarsource.scanner.jenkins.pipeline.WaitForQualityGateStep$Execution.checkTaskCompleted(WaitForQualityGateStep.java:238)
And when i checked the earlier log output, i saw this
Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
09:17:16.205 [INFO] [org.sonarqube.gradle.SonarQubeTask] More about the report processing at http://sonarqube-domain.com:9000/sonar/api/ce/task?id=AX_5A5YSuhDrgrHn3OgE
The link where the report is uploaded and the link at the quality gate step are different
Error 404 on http://sonarqube-domain.com:9000/api/ce/task?id=AX_5A5YSuhDrgrHn3OgE
and
More about the report processing at [http://sonarqube-domain.com:9000/sonar/api/ce/task?id=AX_5A5YSuhDrgrHn3OgE](http://sonarqube-domain.com:9000/sonar/api/ce/task?id=AX_5A5YSuhDrgrHn3OgE)
From where is this link picked up?
How can i fix this.