Codecov

Code coverage done right.®

Welcome to Codecov Documentation. You'll find comprehensive guides and documentation to help you start working with Codecov as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started

Pull Request Comments

Detailed report commented directly into your pull request

The Codecov pull request comment is a highly detailed overview of a pull request. It provides details on the coverage changes in the pull request that help with speeding up code review, and ensuring that pull requests are well tested. The comment is customizable to fit your desired needs.

Codecov Delta

It is important to understand what absolute <relative> (impact) represents. Learn all about the Codecov Delta.

Disable comment

To disable the comment, simply set the comment to false in your codecov.yml, as shown below.

comment: off

You can do this in your Team Yaml, to take effect on all your repositories.

Configuration

comment:
  layout: "reach, diff, flags, files"
  behavior: default
  require_changes: false  # if true: only post the comment if coverage changes
  require_base: no        # [yes :: must have a base report to post]
  require_head: yes       # [yes :: must have a head report to post]
  branches: null

Layout

Customize your comment layout by choosing the order and types of components to include. Below is an example of a layout for reach, diff, flags, files.

  • Reach is a coverage graph embedded into the comment.
  • Diff is the Coverage Diff of the pull request.
  • Flags are a list of user defined Flags, and the impact on their coverage
    • Learn more about setting up Flags.
  • Files are a list of files that are impacted by the pull request (coverage changes, file is new or removed).

Behavior

Choose the way Codecov submits comments in your pull requests.

  • default: update, if exists. Otherwise post new.
  • once: update, if exists. Otherwise post new. Skip if deleted.
  • new: delete old and post new.
  • spammy: post new (do not delete old comments).

Emails will be submitted to all subscribers of the pull request only when posting a new comment. There is no way to disable email notifications. This is a limitation of the [[Service Providers]].

Requiring Changes

You may desire to change when the comment is posted, if any changes are discovered in coverage.

comment:
  require_changes: yes

Comments will now only post when coverage changes. Furthermore, if a comment already exists, and a newer commit results in no coverage change for the entire pull, the comment will be deleted.


What's Next

It is important to learn about the Codecov Delta syntax to fully understand pull request comments.

Codecov Delta