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.
Self-hosted GitLab is not currently supported for binding. This means that reporting features (merge request decoration) are not supported in this case.
Preventing the merge if the quality gate fails
In GitLab, you can block merge requests if it is failing the quality gate. To do this:
In your GitLab project, go to Your project > Settings > Merge requests.
In the Merge Checks section, select Pipelines must succeed. More information about GitLab’s External status checks can be found in the GitLab Documentation.
Set up the pipeline to fail. It depends on your CI tool:
GitHub Actions: see Failing the workflow when the quality gate fails
Bitbucket Pipelines: see Failing the pipeline job when the quality gate fails
The blocking of pull requests on quality gate failure is not supported for projects on a monorepo.
Related pages
Last updated
Was this helpful?

