Skip to main content
Create a quality gate with GitLab

Learn how to create a quality gate with GitLab that will only let merge code that passes Clayton's reviews.

Gabriele Gallo Stampino avatar
Written by Gabriele Gallo Stampino
Updated yesterday

What is a quality gate?

A quality gate is the best way to enforce a quality policy in your organization. Setting up a quality gate allows you to prevent any code that doesn't pass code reviews, from being merged into certain branches.

Key Benefits

  • Enforce code quality consistency across the entire project

  • Ensure that newly committed code doesn't introduce problems

  • Ensure issues are addressed before being merge

Before to start

Before proceed with creating a quality gate in your VCS for your repo, you must enable Clayton Automation and create a dedicated Clayton connection user for your project.

Enable Automation

Make sure to activate the Clayton Automation to monitor your code and start using webhooks to publish status updates for the PR and branch reviews on your VCS.
Please have a look at the dedicated Help Article to learn how to enable automation.

Configure Clayton as a required approval for your merge requests

Go to GitLab, navigate to your repository's General settings, and expand the Merge request approvals section.
​

Select Add approval rule or Update approval rule (this feature requires a Premium or Ultimate version of GitLab).
​

Add the Clayton connection user to the approvers and ensure the Approvals required field is set to at least 1.
​

  1. Click on Save changes

See the official GitLab documentation here.

Did this answer your question?