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.
- Enforce code quality consistency accros the entire project
- Ensure that new committed code doesn't introduce problems
- Ensure issues are addressed before being merge
Before to start
Before proceed on creating a quality gate in your VCS for your repo, you must enable the Clayton Automation and create a dedicate Clayton connection user for your project.
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.
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.
- Set up a dedicated connection user for Clayton (ref. here)
- In your repository settings in GitHub, go under Settings > Branches
- In the Branch protection rules section click on Add rule
- In the Branch name pattern field type the branch name you would like to create the gate for
- Make sure to have at least 1 Required approving reviews
- Click on Save changes
The Require status check can be selected if you want to prevent merge if the entire branch from where the PR has been generated doesn't respect the quality standards defined in Clayton.