Home Products Diff coverage: we have a new metric and quality gate rule for...

Diff coverage: we have a new metric and quality gate rule for PRs

Author

Date

Category

We’re excited to announce a new metric and a new quality gate rule for PRs in Codacy 🎉 It’s called diff coverage, and with this new feature, you can now define gates for code coverage and see the diff coverage on your Git provider.

Diff coverage for PRs: a new metric in Codacy

The diff coverage is a new metric to assess the quality of your Pull Requests.

What does diff coverage do

  • It tracks the number of code changes in PRs that are covered by tests;
  • It gives information about your code coverage but scoped to changes in the PR, independently of the overall repository coverage;
  • It is used for grading PRs and can be controlled by quality gates.
Diff coverage metric

Keep on reading to learn more about setting up the quality gates!

Set up a quality gate rule for diff coverage

We know that Codacy lacked good quality settings for coverage. By analyzing PRs with Codacy we could make sure your repo increased or at least maintained the same level of coverage. But what about blocking PRs if they missed your standards for coverage?

Well, we listened to you! We added the ability to define a minimum coverage threshold for pull requests.

Diff coverage quality gate

What diff coverage means for you

  • You can define gates for code coverage (for example, 70% coverage);
  • You can block PRs automatically if the diff coverage of the pull request is lower than the set value;
  • You can see the new diff coverage check on your Git provider.
Git provider blocking PR

Best practice: This feature is particularly useful when your team wants to focus on the coverage of new code or code changes. Do you have a legacy system with low coverage and improving it is a major effort for your team? Use diff coverage to guarantee that new PRs are covered by tests. This will also gradually improve the overall coverage of your repo.

Check out our diff coverage tutorial

To help you get started, we’re sharing a short video tutorial showing how you can set up a quality gate rule for diff coverage. You can also follow the guide on our docs page.

If you have any questions about this feature or need further guidance on setting it up, please let us know. We’d be more than happy to help you!

We’re excited about this release, but your feedback is essential to us! So please give us your thoughts on how we can further improve this feature. Feel free to check our roadmap and submit an idea or contact the support team directly in the in-app chat.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Subscribe to our newsletter

To be updated with all the latest news, offers and special announcements.

Recent posts

21 AI Tools for Developers in 2023

A 2023 survey by Alteryx shows that 31% of companies using tools powered by artificial intelligence (AI) are using them to generate code. When asking...

Codacy Pioneers: A Fellowship Program for Open-Source Creators

Here at Codacy, we recognize the importance of the open-source software (OSS) community and are dedicated to nurturing and supporting it in any way...

AI-Assisted Coding: 7 Pros and Cons to Consider

According to a recent GitHub survey, 92% of developers polled said they are already actively using coding assistants powered by artificial intelligence (AI). AI-assisted...

Now Available. Centralized view of security issues & risk within Codacy

Codacy is empowering engineering teams to bring their security auditing process to the surface. Today we're giving all Codacy...