We have a persistent warning message in SonarCloud:
“Pull request decoration did not happen. Please install SonarCloud application on the Bitbucket Cloud repository’s organization or user: ###”
I’m not sure how this is impacting our uploaded analysis, as it still appears to be updating.
Which sort of value are you passing in sonar.pullrequest.bitbucketcloud.owner and sonar.pullrequest.bitbucketcloud.repository ? Some kind of friendly repo/owner name or guids ?
Re-installing: No, if you’re referring to deleting the project from our SonarCloud account and then re-creating it, I don’t want to do that as we’d lose the analysis history
Organization/Project: It’s “instaclustr” and “instaclustr-app”
PR Decoration: Yes, when we previously used SonarQube. Since migrating to SonarCloud, decoration wasn’t supported in the plugin
Build pipeline: We run it via Jenkins and within the pipeline run the Maven Sonar plugin: mvn sonar:sonar --batch-mode --errors -pl -am -Dsonar.projectKey=<key> -Dsonar.organization=<org> -Dsonar.verbose=true -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=<login> -Dsonar.pullrequest.branch=<branch> -Dsonar.pullrequest.base=<base> -Dsonar.pullrequest.key=<key> -Dsonar.pullrequest.bitbucketcloud.repository=<repo> -Dsonar.pullrequest.bitbucketcloud.owner=<owner>
No, I means recreating the Connect App on Bitbucket. (Btw we would not recommend recreating a SonarCloud project, precisely for the reason you mentioned!)
I see, so the SonarCloud project was never successfully decorated, yet.
Are you sure that the UUIDs you are using are correct? Note that according to the documentation, the values should look like {d2615dd4-550d-43e5-80c4-665f951e5d6e}. I point this out because I myself find the enclosing {...} a bit strange, but they must be included, and this may be easy to overlook.
I’m fairly sure the command parameters are correct, as we still have the SonarCloud widget displaying on the Bitbucket PR and it’s last update time matches my test scan.
Where USER is my username on Bitbucket Cloud, TEAMNAME the name of the team of the repo where I have the pull request, and REPONAME is the name of the repo. And then the first value is used for the owner, the second for the repo parameters. Does this match your use case exactly, or what is the difference?
Can you please respond to my last message to confirm your exact steps so I can reproduce? Without that it’s hard to tell what could be going wrong in your case.
A few more questions that might help:
Is the app installed on the team that owns the repository?
When you go to the settings of the repository, then the settings in the SonarCloud section in the sidebar (near the bottom), does the page tell you that the repository is bound?
Getting the UUIDs: Yes, I obtain the UUIDs from the Bitbucket REST API. The repository is a team-owned one, so I get them by querying https://api.bitbucket.org/2.0/repositories//. The repo UUID is from the uuid element, and that same payload also has an owner section with the team UUID (so I use the team UUID and the repo UUID from that one request).
App installed on the team that owns the repository: Yes it is (i.e. the Team -> Settings -> Installed Apps page lists SonarCloud as installed)
SonarCloud repository bound: No, it doesn’t explicitly say it’s bound