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 for your project.
Bitbucket requires approvals for the Pull Requests (PRs) from a different user than the author of the PRs. The quality gate with Clayton 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.
In your repository settings in Bitbucket, go under Settings > Branch permissions.
- Set up a dedicated connection user for Clayton (ref. here)
- Select the branch you would like to create the gate for
- Click on Merge checks
- Tick the Check for at least 1 approval from default reviewer checkbox and configure Clayton as the default reviewer
- [if required] Tick the Check for at least 1 approval checkbox for your manual code review
- Click on Save
Only if you are a Premium Bitbucket user you can prevent a merge when there are unresolved merge checks:
- Tick the Prevent a merge with unresolved merge checks checkbox