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 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 (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.
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).
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.
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.
Using Codacy Quality to track your code coverage will save you time, improve the quality of your code, and give you the peace of mind that your code is up to standards. Try it out and see the difference it makes in your code review process. Start a free 14-day trial of Codacy Quality today!