Bitbucket Server plugin and PR decoration

Environment:

  • SonarQube Community Edition Version 7.9.3 (build 33349) + mc1arke/sonarqube-community-branch-plugin 1.3.0
  • SonarQube Runner 4.0.2.1873
  • Bitbucket Server v7.2.3
  • Sonar for Bitbucket Server v3.0.1

I have a TeamCity build configured to provide sonar.branch.name property. Branch based analysis works fine, but I have a trouble with PR decoration. When I click “Sonar Issues” link in PR details it shows branch analysis as intended, but when I click “N quality gates failed” a “Sonar Statistics” window appears that shows “Fetching data from SonarQube…” message infinitely. As I see from browser’s Developer Console a request to /rest/sonar4stash/1.0/statistics?pullRequestId=x&repoId=x&fromCache=false returns {“reason”:“app not enabled for this repository”}.

How can I make this work? Do I need to make another build in TeamCity that provides sonar.pullrequest properties? I thought this pullrequest properties values can be provided automatically by your Bitbucket plugin on pull request creation.
Also I’ve tried to force PR analysis by clicking “Execute Sonar analysis” in PR menu, but no luck.

Bitbucket plugin doesn’t provide a link to SonarQube server’s branch analysis results. Is it possible to add that link to “Sonar Issues” window?

Hi there.

We don’t provide support for the Community Branch plugin on this forum.

Do you provide support for “Sonar for Bitbucket Server” here?

Nope, that’s a bit of a different story, but it’s Mibex’s integration! We generally support SonarQube, but if it’s a question about their integration, they’ll know best because they built/support it.

Ah, ok. Didn’t notice that it’s another company. Thank you for clarification.