How to setup Include Code Quality for Bitbucket
Getting started - watch intro video to get high-level concepts
Prerequisites
Bitbucket Datacenter/Server with version 7.0 or newer
SonarQubeâ„¢ Server version 7.7 or newer
Developer Edition or higher | Community Edition | SonarCloudâ„¢ | |
---|---|---|---|
1 | Add a SonarQubeâ„¢ server configuration in the Sonarâ„¢ for Bitbucket app under Bitbucket Admin → Sonarâ„¢.Â
| Follow the same steps as for Developer Edition or higher Community Edition version 7.9.x and 8.3+: | Add a SonarQubeâ„¢ server configuration in the Sonarâ„¢ for Bitbucket app under Bitbucket Admin → Sonarâ„¢.Â
|
2 | Configure Sonar™ Analysis based on your build infrastructure. If you use Bamboo, a seamless integration is possible with our Include Code Quality for Bamboo app. Follow our Sonar™ Analysis Configuration guide and configure the analysis parameters for your SonarQube™ version based on the Analysis Parameter Matrix. Include Code Quality for Bitbucket 6.0 supports multiple SonarQube™ projects for the same repository. To use it, configure the Sonar™ Analysis on sub directories of the repositories | Follow the same steps as for Developer Edition or higher The SonarQube™ Community Edition does not know about branches and pull requests. A separate SonarQube™ project for each branch is used to show SonarQube™ information for pull requests and branches. The app expects Sonar™ project keys in the format | Follow the same steps as for Developer Edition or higher  |
3 | Run a Sonarâ„¢ Analysis on the main branch of the repository where you want to enable the app. Verify that the analysis results are available in SonarQubeâ„¢. | Follow the same steps as for Developer Edition or higher | Follow the same steps as for Developer Edition or higher |
4 | Connect one or more SonarQube™ project to a Repository (Repository → Settings → Sonar™)
| Follow the same steps as for Developer Edition or higher and additionally set:
| Follow the same steps as for Developer Edition or higher |
5 | Enable Sonar™ for Bitbucket in the settings page of your repository (Repository → Settings → Sonar™)
 | Follow the same steps as for Developer Edition or higher and additionally set:
 | Follow the same steps as for Developer Edition or higher |
6 | Go to Repository → Source View of the already analyzed main branch. You should see the issue annotations: If you cannot see Sonar™ issues or test coverage in here, please follow our configuration checklist to find out what went wrong. | Follow the same steps as for Developer Edition or higher | Follow the same steps as for Developer Edition or higher |
7 | Create a new branch and add a commit with some issues in it. Create a pull request from that branch. Your Sonarâ„¢ Analysis Configuration should pick up the new pull request and analyze it correctly. If you cannot see Sonarâ„¢ issues or test coverage in here, please follow our configuration checklist to find out what went wrong. | Follow the same steps as for Developer Edition or higher | Follow the same steps as for Developer Edition or higher |
Â
SONARâ„¢, SONARQUBEâ„¢ and SONARCLOUDâ„¢ are independent and trademarked products and services of SonarSource SA: see sonarsource.com, sonarqube.org, sonarcloud.io.