Cocov

Blocking PRs using Cocov Results

Last updated Feb 26, 2024

While Cocov is able to emit checks for Commits, and therefore, Pull Requests, extra configuration is required to ensure GitHub actually prevents offending changes from being merged. First, refer to their documentation regarding Branch Protection, and then make sure to review the section regarding Status Checks Requirements.

Depending on features enabled on your Manifest File, two contexts will be reported back to GitHub on a given commit/pull request:

GitHub PR Checklist

  • cocov: Emitted when checks are configured, it will assume a positive or negative state depending on the number of issues reported by checks. At the moment, this is not configurable, meaning that a single issue encountered will cause this status to be marked as failing. However, issues can be ignored.
  • cocov/coverage: Emitted when a CI pipeline submits coverage information to the instance using the Coverage Reporter, displays the current coverage percentage, and conditionally fails based on what is defined on the Manifest File.

After confirming that checks are being correctly reported, access the repository’s Branch Protection settings, and check the Require status checks to pass before merging, adding Cocov’s contexts you intend to use on the box below. For instance:

GitHub's Branch Protection settings