Bitbucket Pull Request Decoration using Bamboo triggered analysis

Hi all, newcomer here

Hi all, newcomer here

We are new to SonarQube, but have managed to mostly integrate it into our environment. We utilize a Bamboo script task (command below) to execute the SonarQube analysis, and are able to successfully view the results on the SonarQube page. This is done for every pull request per the Bamboo job.

Now we are trying to integrate it into Bamboo by doing the ‘Decorate Bamboo Pull request’ per documentation. However, under ‘Bitbucket Server PR Decoration’ states you should update Administration > General Settings > Pull Requests > Integration with Bitbucket Server > Personal access token and > The URL of the Bitbucket Server. Neither of those options eixst however, only ‘Project Key’ and ‘Repository slug’.

Can you please provide clear steps for a newcomer on what I need to do, or am doing wrong? I did look at this other topic Pull Request Decoration with Bitbucket Server and Bamboo which makes me think I need to modify my script command, but then what about the menu options identified under ‘Pull Requests’ the document mentions?

  • SonarQube: Enterprise Edition-Version 7.9.1 LGPL v3
  • Bitbucket v6.10.0
  • Bamboo SonarQube Script task: MSBuild.SonarQube.Runner.exe begin /k:“PROJ” /n:“PROJ” /v:{bamboo.repository.branch.name} /d:sonar.branch.name={bamboo.repository.branch.name} /d:sonar.cs.opencover.reportsPaths=“opencover.xml”

To anyone helping me out. Trying to update the Analysis command per the link I included above, I have updated the Bamboo as listed below. However, while it does still execute the analysis (visible in SonarQube), it does not display anything in Bitbucket. The documentation indicates the next step is to update the Personal Access Token and URL of bitbucket, but those menu options don’t exist.

  • MSBuild.SonarQube.Runner.exe begin /k:“PROJ” /n:“PROJ” /v:{bamboo.repository.branch.name} /d:sonar.cs.opencover.reportsPaths=“opencover.xml” /d:sonar.pullrequest.key={bamboo.repository.pr.key} /d:sonar.pullrequest.branch={bamboo.repository.pr.sourceBranch} /d:sonar.pullrequest.base=${bamboo.repository.pr.targetBranch}

Hi,

Project Key and Repository slug are project-level settings. The docs are telling you to update global-level settings. I know it’s terribly confusing that the menu items at both levels are named “Administration” in 7.9 (that got fixed in the 8 series). You’re looking for the one in the top/black menu bar. If you don’t see it that means you don’t have permissions to it & need to hit up your instance admin.

 
HTH,
Ann

Hi Ann. Thanks for that key point. That helped do the trick.