SonarQube Cloud | Managing your project | Administering your project | DevOps platform integration | GitLab
Setting up the integration of your project with GitLab
On this page
Once your GitLab group has been imported to SonarQube Cloud, you can create your SonarQube Cloud project by importing your GitLab repository. The so-created SonarQube Cloud project is bound to its GitLab repository. To bind an unbound project, see Changing the project binding.
Setting up pull request integration
For a bound project, the quality gate status and analysis metrics are reported to your pull requests in GitLab provided:
- Your build script is configured to build on pull request creation and push.
- If you don't use an integrated CI tool, you must set up the pull request parameters manually: see Pull request analysis in Analysis parameters.
- See also Prerequisites for CI-based analysis in Pull request analysis.
Preventing the pull request 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 repository, 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:
Related pages
Was this page helpful?