I’m using SonarQube Enterprise Edition version 22.214.171.124646.
I’m trying to achieve SonarQube integration with BitBucket for PR analysis and decorate PR in BitBucket itself i.e., We want SonarQube to automatically analyze the branch code from bitbucket and display the issues in Bitbucket Pull request itself.
To achieve this I tried the following configuration
- We have generated a personal access token with admin credentials in BitBucket.
- We configured this personal access token and bitbucket url in SonarQube >> Administration >> ALM Integrations
- Clicked on + Icon at right side top to add a project then clicked on bitbucket >> System displayed all the repositories available in bit bucket
So i selected one of the repo and clicked on set up selected repository
- Then system is showing the two options to analyse the repo i) With jenkin ii) Manually
- I selected manullay and followed the process to analyse the branch with following commands
SonarScanner.MSBuild.exe begin /k:“ProjectName” /d:sonar.host.url=“http://xxx.xxx.x.xxx:9000” /d:sonar.login=“username” /d:sonar.password=“password”
MsBuild.exe" “D:\BUILDS\SampleProject.sln” /t:Rebuild
SonarScanner.MSBuild.exe end /d:sonar.login=“username” /d:sonar.password=“password”
- Project Settings >> General Settings >> Pull Request Decoration >> verified whether the Configuration name, Project Key and Repository SLUG are correct or not
I did the above configurations but the following expectation is not reached
- Branch analysis is not happening automatically when there is a change in code in Repository
- Pull Requests are not displaying in Project Settings >> Branches & Pull Requests
- If any new issues in PR those issues should be highlighted in BitBucket Pull request itself
Please let me know if I’m missing anything to achieve my expectations
Thanks & Regards