Skip to main content

Create a quality gate with Azure DevOps

David Martin avatar
Written by David Martin
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 new committed code doesn't introduce problems

  • Ensure issues are addressed before being merged

Before you start

Enable Automation

To automatically monitor your code with Clayton, you need to turn on and select a protection mode. Clayton automatically creates webhooks to monitor relevant events in your repository. You can select your protection mode from the homepage by navigating to Settings and then Protection. From there, you can view the current settings and adjust the protection mode as needed.

You can find out more information about the process on this Help Article

Dedicated Integration User

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

Steps

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?