Join Codacy Product Showcase on July 9th to learn about product updates

Group 370

Meet us at WeAreDevelopers World Congress in Berlin

Group 370

Spotlight Whitepaper by IDC on Importance of Automated Code Review Technologies

Group 370

Now live: introducing Coverage summary on your Git provider!

In this article:
Subscribe to our blog:

You spoke; we listened! We’re very excited to announce you can now see the Coverage summary directly on GitHub as a Pull Request comment!

With this new feature, your code review process is even more seamless. You no longer need to leave GitHub to check your coverage results: you’ll have all the information you need right there on your workflow. Plus, if a user does not have access to Codacy Quality, they will no longer lose time digging for information: all relevant details will be there, in the PR, directly in their environment.

Let’s take a closer look at how to enable and use this exciting new feature!

How to enable Coverage summaries 

To get Coverage summaries, you must first add coverage to your repository. In our documentation, you have a step-by-step guide to help you generate coverage reports, upload data to Codacy Quality, and validate that the coverage setup is complete.

Once you add coverage to your repos, you’ll be able to get Coverage summaries on GitHub. New repositories added to Codacy will have the feature enabled by default, regardless of your plan, but you can easily disable it. For existing repositories, you’ll need to enable the feature.

To enable or disable Coverage summary, go to your repository Settings, tab Integrations, and you’ll see the Coverage summary option. That’s it; you are good to go!

Coverage GitHub integration
Coverage GitHub integration

Coverage summary in action

When you open a PR, you’ll see a comment from Codacy on the GitHub workflow with a summary of your coverage metrics. The summary includes the following:

  • Coverage metrics (coverage variation and diff coverage);
  • Targets and status for the quality gates;
  • Information used to calculate the metrics (number of covered and coverable lines);
  • If a report is missing, an error explaining why we couldn’t calculate Coverage;
  • Links to enable/disable the feature and to change quality gates;
  • Link to see your PR on Codacy UI.

This way, you can conveniently check the Coverage results without ever needing to leave the PR page on GitHub. When there are new coverage results, Codacy will update the last Coverage summary comment if it’s included in the last 5 comments of the PR. Otherwise, Codacy creates a new comment. You’ll always have the most current information.

Let’s see some examples of Coverage summaries.

Normal scenario (coverage variation and diff coverage)

In this scenario, you can see that the coverage variation increased by 10%, and the diff coverage is at 60%. Since the quality gate defined for diff coverage is having at least 95.06%, you’ll get feedback that the current PR is not up to standards in terms of diff coverage.

Normal scenario
Normal scenario of Coverage summary, with Coverage variation and Diff coverage

Normal scenario (coverage variation and diff coverage) without gates

In this scenario, the quality gates are not defined. However, you’ll still be able to see the Coverage summary with the metrics but with no information about the target value.

Normal scenario without gates
Normal scenario of Coverage summary without quality gates

Diff coverage is not applicable

In this scenario, the current PR didn’t add or modify any coverable lines, so the diff coverage was set to ∅ (not applicable).

Diff not applicable
Scenario of Coverage summary when Diff coverage is not applicable

Missing common ancestor

In this scenario, Codacy was not able to calculate coverage variation. However, you’ll still be able to get the summary, and we’ll show you a feedback message that will help you debug the issue.

Missing common ancestor
Scenario of Coverage summary when Codacy is not able to calculate coverage variation

A handy tutorial just for you

To help you get started, we’re sharing a video tutorial showing how the feature works and how you can enable it. Don’t forget to first add coverage to your repository by following the step-by-step guide on our docs page.

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

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


Try Out Our New Coverage Pipeline Featuring Diff Coverage
Timely and constructive feedback in the pull request (PR) flow is essential to maintaining code quality and fostering a culture of continuous...
Diff coverage: we have a new metric and quality gate rule for PRs
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...
January 2023 Product Update 🚀
Hi there 👋,

Automate code
reviews on your commits and pull request

Group 13