Hey.
I implemented SonarCloud in our build process recently. I got a stable configuration for SonarCloud which works fine so far.
For scanning, I use the parameters sonar.projectKey, sonar.organization, sonar.host.url, sonar.branch.name, sonar.branch.target and sonar.login.
SonarCloud scans every built branch and even shows the results in the related pull request (we are using Bitbucket). Whats missing now are comments by sonar inside the pull request, telling the developer what he has to improve. For this, I included the following parameters to the scanning process: sonar.pullrequest.branch, sonar.pullrequest.base, sonar.pullrequest.provider, sonar.pullrequest.bitbucketcloud.owner, sonar.pullrequest.bitbucketcloud.repository, sonar.pullrequest.key. I also removed the params sonar.branch.name, sonar.branch.target since they seem to be in conflict with the other parameters.
After the scanning process is finished, SonarCloud shows that there was a problem with scanning. After googling I found out, that there seems to be a problem with owner and repository, since it required the related UUIDs and not the clear names.
I found the owner UUID by using
curl https://api.bitbucket.org/2.0/teams/teamname
I can’t get the repository UUID by using
curl https://api.bitbucket.org/2.0/repositories/teamname/repositoryname
since access is forbidden.
How do I get the UUID of that project? Do I need to authenticate with OAuth?
Another question is, is it possible make a merge check for Bitbucket? E.g. pull request does not match SonarClouds quality gates, so it can not be merged into target branch?
Best regards,
Ben