but it has not enough detail for me regarding having wrong link in the widget on the pull request page in Bitbucket (the link is displayed in the widget sonarcloud signals it red/failed).
I’m pretty sure I’m missing some configuration directives here, the blog post from April wrote about some updates for Bitbucket Cloud so I guess I’m perhaps just looking for these.
OK, so assuming that you are using Bitbucket Pipelines, I guess I know what’s happening:
You created a branch on which you pushed some code
Pipelines triggered a build: this branch got analyzed and you have results in SonarCloud - great
Then you created a PR on that branch in Bitbucket Cloud, and : the link is not valid
If this is the path you followed, the reason why the link is not valid is that Bitbucket Pipelines does not trigger a build when you create a PR:
This explains why you don’t see the PR in SonarCloud Web UI
Which in turn explains why the “See all issues on SonarCloud” link is not valid
If you push a new change on your branch, then Pipelines will trigger a build, the PR will appear in SonarCloud and the link will then be valid. (Hopefully!)
I’m going forward in baby steps. Found out, that in Administration (Settings) for Pull Requests the provider was not set. I did set it to Bitbucket.
But so far for that project I don’t see any pull requests in the branch view. If the Short-Lived Branches are created for every pull request, could that be in conflict with the Pull Request Feature?
I guess I also need to do some settings w/ the properties file while Sonar Scanning, right?
/e: I’m getting closer, first pull request in the drop-down list
I’ve problems to obtain the value for sonar.pullrequest.key inside am Bitbucket Cloud pipeline. Do you have any idea about that?
/e: I could solve that now . As we have PHP quite centrally I created a curl + php script. Searching the open pullrequests for the branch in the bitbucket cloud pipeline via the Bitbucket Cloud REST API.
I also set the target branch, but it seems that this one is ignored.It should be develop but somehow Sonarcloud hangs on the master branch as the default branch. Any ideas on how to control that in detail?
I don’t understand why you need to do all this. If you’re using Bitbucket Pipeline, SonarCloud knows how to get those information directly out of the Pipeline environment variable, you should not have to worry about this. Did you look at the sample project listed in the FAQ of https://sonarcloud.io/documentation/integrations/bitbucketcloud?
It is so maybe because I’ve overlooked the mvn (maven?) command. Which container image that is, the default Bitbucker Cloud Pipline one that is 2TB+?
What do I do if I don’t want to run mvn?
I have found not Bitbucket Cloud Pipeline Environment Variable which transports the Bitbucket Pull Request ID
Could it be an issue that we’re running Bitbucket Cloud Pipelines in alpha?
/e: I’d like to follow as closely as possible to the reference you’ve linked, I guess I’m just missing which image that is. I guess that image will also do the scanning so a good out of the box solution. Please enlighten me