# Configuring GitLab project binding

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: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
