SonarQube Developer Edition Version 8.7 (build 41497), Bitbucket Cloud
Analysis running via Bamboo using dotnet-sonarscanner 5.0.4
SonarScanner running against .NET project, everything else working in Sonar UI (project key, pr key etc)
I’m trying to get pull request decoration working
I’ve configured PR handling in Sonar successfully and trying out the new Bitbucket Cloud integration. The analysis status shows up in Bitbucket Cloud PR summary, but the decoration itself fails.
Message in Sonar UI’s PR analysis warnings dialog (second one is about using deprecated sonar.exclusions):
I read about the auto-merge problem from other topic and rebased against master and made sure the UI showed same SHA for top commit in Bitbucket Cloud as in Sonar UI. Is there a way to guess what kind of links (urls) are sent as part of the integration?
The other topic showed different error for invalid SHA if I’m not entirely wrong. Would bitbucket report invalid commit SHA as invalid link now in API?
Here’s an example of error (disabled automatic branch merging in Bamboo):
Failed to create Bitbucket Cloud Quality Report for commit SHA '71d95403bb4a84c02d1e305b191fc768baf9e2ac'
I did some digging into issue, here is possible explanation:
In global settings you have: sonar.core.serverBaseURL variable which can be set to something.
That something MUST be resolvable host (public dns), otherwise you will get from bitbucket: "link is not a valid URL"
I had private dns name for sonarqube, and got that error. Then I tried reset the value to nothing and it worked. Then I set up alternate hostname in public dns and again - it works.
Thank you @Haralds_Ulmanis , awesome detective work! I can confirm that resetting the value of sonar.core.serverBaseURL in Sonar admin settings made the pull decoration work. We had our internal DNS name there.
@dmeneses do you think there’s something that you could tweak in integration that it would allow non-resolvable DNS names or is this a limitation of Bitbucket? Would it cause missing functionality if this would not be sent at all?
@lahma It took me nearly all day That seems 100% bitbucket thing. For some reason it verifies that the host in the link section is resolvable. Not sure if that can be turned off in any way. At least I couldn’t find anything about it.
In general - the only solution (if you want links to issues work) - is to add a public domain host pointing to sonarQube. I did add which points to 10.x.x.x, which is sonarqube. Also I configured that host as serverBaseURL.