Skip to content
This documentation is a preview of the pull request #2301

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:

Codacy built-in gate policy

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:

  1. Open your organization Policies page, tab Gate policies.

  2. 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.

  3. Enter a unique name and click Create gate policy.

    Creating a new gate policy

  4. Set the values for the quality gates and click Next: Select and apply to repositories.

    Selecting the quality gate values for the gate policy

  5. 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.

    Applying the gate policy to repositories

Setting a gate policy as default#

To set a gate policy as default:

  1. Open your organization Policies page, tab Gate policies.

  2. Toggle Make default on the relevant gate policy card.

    Note

    Only one gate policy at a time can be the default gate policy.

    Setting a gate policy as the default

    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:

  1. Open your organization Policies page, tab Gate policies.

  2. Click the edit icon on the gate policy card.

    Editing an existing gate policy

  3. 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.

  4. Edit the list of repositories that follow the gate policy.

  5. 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:

  1. Open your organization Policies page, tab Gate policies.

  2. Click the trash can icon on the gate policy card and confirm.

    Deleting a gate policy

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?

We're sorry to hear that. Please let us know what we can improve:

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.

Last modified July 17, 2023