GitHub Checks
GitHub Checks is meant to provide meaningful code coverage metrics as close to your workflow as possible. This is done by providing line-by-line coverage on your GitHub pull requests so you can access code coverage insights without leaving your code.
This feature is only available for GitHub users as it leverages GitHub Checks.
Deprecation of GitHub Annotations Due to API Limitations
GitHub Annotations will be deprecated due to the following API constraints:
- The GitHub API does not provide a way to clear annotations once they are sent. Even if subsequent reports processed by Codecov include updated coverage data, previous annotations remain.
- Annotations do not work if "Flags" or "Components" are configured, due to conflicts with these features.
Codecov recommends using our browser extension as a more reliable alternative to annotations.
Annotations in the "Files Changed" View
Notably, lines that you add on a commit without coverage, will show up in your pull request files view with an annotation.
Hiding Annotations in the Files View
Annotations making your code hard to read?
You can always just toggle them on and off with the "a" key
You can always hide annotations in the GitHub Files view by unselecting "Show annotations" in the top right of the file.
This GitHub feature only hides annotations by file, not for the full pull request.
You can also toggle checks on and off by pressing the "a" key.
Annotations in the "Checks" Tab
To see annotations, first, go to the Checks
tab under any pull request.
Look for a patch
status underneath the CodecovChecks
dropdown.
To view coverage information in line with your code, click on the icon to the right side of the annotation.
YAML Configuration for GitHub Checks and Codecov
GitHub Checks and annotations for the patch status are enabled by default for all GitHub users.
Patch
Commit Statuses have to be enabled and set up in order for checks to be present in pull requests.
If you have disabled patch status
in your YAML, Github Checks Annotations will not show up.
If the top-level patch status
in your YAML has paths
or flags
, GitHub Checks Annotations will not show up.
For example, Github Checks Annotations would be off if your YAML was:
coverage:
status:
patch: false
Disabling GitHub Checks Patch Annotations via YAML
Annotations can be disabled using a flag on the top-level section of the codecov.yml file.
github_checks:
annotations: false
Note: If GitHub checks are disabled but statuses are still set up, normal status checks will be used instead.
Self-hosted Codecov Admins
GitHub Checks Patch Annotations may be disabled by default in your instance. If you are not seeing them, and you don't have an entry on your yaml, try setting the above to
true
at either the instance and repo level codecov.yml.
Disabling GitHub Checks completely via YAML
If you want to disable the GitHub checks complete and revert to the older statuses, you can set the following flag on the top-level section of the codecov.yml file.
github_checks: false
If Disabling checks is something that you need or want, we'd love if you could also drop us a ticket explaining how we can improve this feature to better suit your needs.
Updated 2 months ago