Start FreeLog in
SonarQube Cloud | Managing your project | Administering your project | DevOps platform integration | Bitbucket Cloud

Setting up the integration of your project with Bitbucket Cloud

On this page

Once your Bitbucket Cloud workspace has been imported to SonarQube Cloud, you can create your SonarQube Cloud project by importing your Bitbucket Cloud repository. The so-created SonarQube Cloud project is bound to its Bitbucket Cloud repository. 

With a bound project, various analysis reporting features are supported in Bitbucket Cloud. This page explains how to set them up.

Reporting the quality gate status and analysis metrics to your pull requests in Bitbucket Cloud

For a bound project, the quality gate status and analysis metrics are reported to your pull requests in Bitbucket Cloud. No additional setup is necessary. 

Screenshot of the pull request quality gate widget in BitBucket.

Preventing the pull request merge if the quality gate fails

If you use Bitbucket Pipelines, see Bitbucket Pipelines. Otherwise, proceed as described below.

If you know how many builds you have for a pull request, you can run your SonarQube Server analysis and not block the pipeline waiting for results. The SonarQube Server Quality Gate will appear in the build for your PR after the analysis results are available.

Define the number of builds to pass in Bitbucket Cloud before allowing pull requests to pass.

You can set the Minimum number of successful builds for the last commit with no failed builds and no in progress in Bitbucket, to the number of builds that run for the pull request.

Reporting analysis metrics in the Bitbucket repository overview

For a bound project, the analysis metrics of the main branch are reported in the Bitbucket repository overview (for more information, see Viewing the issues detected on a pull request in Butbucket Cloud in Viewing and managing issues in your DevOps platform).
To enable this feature, you must enable the Repository Overview widget.

Screenshot of the BitBucket interface with the SonarCloud project analysis results widget.
Enabling the Repository Overview Widget
  1. In Bitbuck Cloud, retrieve your project.
  2. Go to Your Repository > Repository settings > SonarQube Cloud > Settings.
  3. Select Show repository overview widget.
Screenshot of the Bitbucket interface showing how to enable the analysis overview widget.

Was this page helpful?

© 2008-2025 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARQUBE, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License