We are getting an error trying to do PR Analysis on our system. The error in Sonar says “Failed to create Bitbucket Cloud Quality Report for commit SHA ‘’”.
Our build system is Jenkins pipelines. We self host Jenkins and Sonarqube in Azure; and use Bitbucket cloud.
We cannot get the PR to decorate with errors, along with this error. Also, it looks like the response to the webhook from Sonar is correct, but our build for an intentionally failed PR (to test) won’t fail. This same test worked for our older 7.6 community version with the PR analysis plugin, and also on our current test system with newer 8.9 Sonar.
Are you analyzing the PR as checked out, or as it would be post-merge? I.e. are you doing a local merge commit? If so, that commit won’t exist in the DevOps Platform & so SonarQube won’t be able to decorate it.
The problem was found, it was the Jenkins Pipeline build job which was breaking, using an incorrect git hash. The Jenkins pipeline makes multiple repository pulls and overwrites some of the environment variables being used.
Also, noted that for Sonar 8.9 there is a parameter “sonar.scm.revision” for “Overrides the revision, for instance the Git sha1, displayed in analysis results. By default value is provided by the CI environment or guessed by the checked-out sources” that could be helpful. In this project’s scenario the environment variables were reassigned to correct ones.