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 merge

Before to start

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

Connection User

GitHub doesn't allow the author of a Pull Request (PR) to approve it, therefore the quality gate will fully work only if a dedicated connection user for Clayton is configured for your project.
Please have a look at our Help Article to learn how to set up a new connection user.

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.

Steps

  1. Set up a dedicated connection user for Clayton (ref. here)

  2. In your repository settings in Azure DevOps, go under Project Settings > Repositories > Select your repository > Policies

  3. From Branch Policies, select the branch you want to protect

  4. From the section Automatically included reviewers, add Clayton (integration user)

Did this answer your question?