Configuring GitLab project binding

Setting up GitLab integration features for your project in SonarQube Cloud.

Once your GitLab group has been imported to SonarQube Cloud, you can create your SonarQube Cloud project by importing your GitLab project. The so created SonarQube Cloud project is bound to its GitLab project.

With a bound project, various analysis reporting features are supported on the DevOps platform. This page explains how to set them up.

Setting up merge request integration

For a bound project, the quality gate status and analysis metrics are reported to your merge requests in GitLab provided:

  • Your build script is configured to build on merge request creation and push.

  • If you don't use an integrated CI tool, you must set up the merge request parameters manually, see Analysis parameters for more details.

  • See Prerequisites for CI-based analysis for additional information.

circle-exclamation
chevron-rightPreventing the merge if the quality gate failshashtag

In GitLab, you can block merge requests if it is failing the quality gate. To do this:

  1. In your GitLab project, go to Your project > Settings > Merge requests.

  2. In the Merge Checks section, select Pipelines must succeed. More information about GitLab’s External status checks can be found in the GitLab Documentationarrow-up-right.

  3. Set up the pipeline to fail. It depends on your CI tool:

circle-info

The blocking of pull requests on quality gate failure is not supported for projects on a monorepo.

Last updated

Was this helpful?