Create a quality gate with Azure DevOps

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

Gabriele Gallo Stampino avatar
Written by Gabriele Gallo Stampino
Updated over a week ago

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 new committed code doesn't introduce problems

  • Ensure issues are addressed before being merged

Before to start

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.

Dedicated Integration User

Please review our Help Article to learn how to set up a dedicated integration user for Clayton.


You can get to branch policy settings with the following:
Project Settings > Repository > Policies > Branch Policies > <Branch Name>.

Screenshot that shows the Branches menu item.

Suggested Setup

  1. Configure the desired number of reviewers that need to approve your PRs

    Example: If all your PRs need to be approved by one of your architects, then configure 2 required reviewers:

    • 1 for your architect

    • 1 for Clayton

  2. A good practice is also to "Reset all code reviewer votes when new changes are pushed" to ensure the new code gets reviewed and approved.

  3. Configure the Clayton Integration User as "Required Reviewer" to ensure your new code complies with the active Clayton's code review criteria configured on your repository.

    Note: Clayton's code review will Pass if:

    1. No issues are detected

    2. Or only WARNING issues (aka non-blocking bugs) are detected.

      You can read more about our Severity Levels here.​

Example of a PR reviewed by Clayton

Did this answer your question?