I have a project in Sonar Cloud that is linked to my Bitbucket repository. I can see analysis in the source view within Bitbucket. The analysis completed in Sonar Cloud for the branch with the open pull request. When a pull request is opened, the “Code Quality” block is empty. My organization just migrated over to cloud a few weeks ago and this doesn’t appear to be working on any pull requests across many repositories. After adding pull request pipelines into the bitbucket pipelines file I do see the analysis report in the right menu under “Reports” but still nothing in the Code Quality block.
We’re injecting the properties for use by the Gradle plugin like this and then using the sonarqube task to perform the analysis.
Apologies for the late reply and welcome to the community! Let me reiterate so I can understand better what is going on.
You run the analysis in the Bitbucket Pipeline using the gradle task and it finishes with the success?
You do not see that pull request in the SonarCloud UI?
If you are analysing PRs with the given properties I think you are missing sonar.pullrequest.key.
I’ve set the following in my Gradle file and am now getting errors when I view the pull request in Sonarcloud. I’m populating the variables in my pipeline build.
Pull request decoration did not happen. Configuration missing to decorate the Bitbucket Cloud pull request: BitbucketCloudPrConfiguration{owner=null, repository=null, id=186, headSha='eb92e327cfb1', triggerCommitSha=null}
Looks like I’m still missing some configuration. I would expect the integration to populate this information from the Bitbucket environment variables instead of having to set this up manually. What else am I missing?
indeed should be autodetected if run in the BitBucket Pipelines (based on the fact that BITBUCKET_PR_ID is present in the environment).
Can you share with me the logs of the analysis (preferably if you set sonar.verbose=true property) with the first config you provided (the one without sonar.pullrequest.key)? I opened the private thread for that.
The code quality plugin has started working. I have not added any more attributes. Even the repositories where I only am specifying the sonar user, password and org the plugin is working. It seems like there was a fix applied that has resolved the issues.