For the latest updates and improvements in production, open docs.codacy.com instead.
Using gate policies#
Gate policies help you ensure that Codacy uses the same quality gates across your organization repositories.
Codacy provides a built-in gate policy, Codacy Gate Policy, which sets minimum quality levels for pull requests and commits. The following screenshot displays the default configuration values:
By default, Codacy applies the Codacy Gate Policy automatically to newly added repositories. You can then create new gate policies with different quality gates and make them the default for your organization.
Creating a new gate policy#
To create a new gate policy for your organization:
-
Open your organization Policies page, tab Gate policies.
-
Click the button Create new gate policy at the top right-hand corner of the page. This opens a window with the gate policy creation form.
-
Enter a unique name and click Create gate policy.
-
Set the values for the quality gates and click Next: Select and apply to repositories.
-
Select existing repositories that should follow the gate policy and click Save and apply gate policy.
Codacy will start using the new gate policy on the next analysis of each selected repository.
Setting a gate policy as default#
To set a gate policy as default:
-
Open your organization Policies page, tab Gate policies.
-
Toggle Make default on the relevant gate policy card.
Note
Only one gate policy at a time can be the default gate policy.
Codacy will start applying the default gate policy to newly added repositories.
Editing a gate policy#
To edit the quality gates of an existing gate policy or change the repositories that follow that gate policy:
-
Open your organization Policies page, tab Gate policies.
-
Click the edit icon on the gate policy card.
-
Edit the current quality gate values and click the button Next: Select and apply to repositories.
Note
You can't change the quality gate values of the built-in Codacy Gate Policy.
-
Edit the list of repositories that follow the gate policy.
-
Click the button Save and apply gate policy to save your changes to the gate policy.
Codacy will start using the updated gate policy on the next analysis of each selected repository.
If you stop applying a gate policy to a repository, Codacy restores the previous quality gates of that repository.
Deleting a gate policy#
Note
You can't delete the built-in Codacy Gate Policy.
To delete an organization gate policy:
-
Open your organization Policies page, tab Gate policies.
-
Click the trash can icon on the gate policy card and confirm.
When you delete a gate policy:
-
Codacy restores the previous quality gates of each repository following that gate policy.
-
If the deleted gate policy was the default for your organization, Codacy makes the built-in Codacy Gate Policy the default.
Share your feedback 📢
Did this page help you?
Thanks for the feedback! Is there anything else you'd like to tell us about this page?
255 characters left
We're sorry to hear that. Please let us know what we can improve:
255 characters left
Alternatively, you can create a more detailed issue on our GitHub repository.
Thanks for helping improve the Codacy documentation.
Edit this page on GitHub if you notice something wrong or missing.
If you have a question or need help please contact support@codacy.com.