> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-cloud/managing-your-projects/administering-your-projects/devops-platform-integration/gitlab.md).

# 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](/sonarqube-cloud/administering-sonarcloud/about-sonarqube-cloud-solution/resources-structure/binding-with-dop.md).

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](/sonarqube-cloud/analyzing-source-code/analysis-parameters.md#pull-request-analysis) for more details.
* See [Pull request analysis](/sonarqube-cloud/analyzing-source-code/pull-request-analysis.md#prerequisites-for-ci-based-analysis) for additional information.

{% hint style="warning" %}
Self-hosted GitLab is not currently supported for binding. This means that reporting features (merge request decoration) are not supported in this case.
{% endhint %}

<details>

<summary>Preventing the merge if the quality gate fails</summary>

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 Documentation](https://docs.gitlab.com/ee/user/project/merge_requests/status_checks.html#block-merges-of-merge-requests-unless-all-status-checks-have-passed).
3. Set up the pipeline to fail. It depends on your CI tool:
   * GitLab CI: see [GitLab CI](/sonarqube-cloud/analyzing-source-code/ci-based-analysis/gitlab-ci.md#failing-the-pipeline-job-when-the-sonarqube-cloud-quality-gate-fails)
   * GitHub Actions: see [Github Actions](/sonarqube-cloud/analyzing-source-code/ci-based-analysis/github-actions-for-sonarcloud.md#failing-workflow-on-quality-gate-failure)
   * Bitbucket Pipelines: see [Bitbucket Pipelines](/sonarqube-cloud/analyzing-source-code/ci-based-analysis/bitbucket-pipelines-for-sonarcloud.md#failing-the-pipeline-job-when-the-quality-gate-fails)

{% hint style="info" %}
The blocking of pull requests on quality gate failure is not supported for projects on a monorepo.
{% endhint %}

</details>

## Related pages <a href="#related-pages" id="related-pages"></a>

* [Getting started with GitLab](/sonarqube-cloud/getting-started/gitlab.md)
* [Importing GitLab group](/sonarqube-cloud/administering-sonarcloud/managing-organization/creating-organization/importing-gitlab-group.md)
* [Creating your project](/sonarqube-cloud/managing-your-projects/administering-your-projects/setting-up-project.md)
* [GitLab CI](/sonarqube-cloud/analyzing-source-code/ci-based-analysis/gitlab-ci.md)
* [Setting your project's permissions](/sonarqube-cloud/managing-your-projects/administering-your-projects/setting-permissions.md)
* [Changing project binding](/sonarqube-cloud/managing-your-projects/administering-your-projects/changing-binding.md)
* [Customizing Information page](/sonarqube-cloud/managing-your-projects/administering-your-projects/customizing-info-page.md)
* [Deleting project](/sonarqube-cloud/managing-your-projects/administering-your-projects/deleting-project.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sonarsource.com/sonarqube-cloud/managing-your-projects/administering-your-projects/devops-platform-integration/gitlab.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
