Skip to content

Report coverage on PRs with octocov - #289

Merged
gabrieldeespindula merged 2 commits into
masterfrom
add-octocov-coverage-report
Aug 20, 2026
Merged

Report coverage on PRs with octocov#289
gabrieldeespindula merged 2 commits into
masterfrom
add-octocov-coverage-report

Conversation

@gabrieldeespindula

Copy link
Copy Markdown
Member

Follow-up to #284, which removed the broken qlty integration. This PR adds the coverage reporting that qlty used to provide, using octocov on top of the SimpleCov setup the project already has. It is an alternative to the couve-based flow proposed in #285/#286.

What it does

  • On pull requests: octocov posts a single, auto-updated comment with the project total coverage and the delta vs master, plus a per-file breakdown of the files in the PR scope. The full SimpleCov HTML report (with uncovered lines, file by file) is uploaded as the coverage-html artifact of the run.
  • On pushes to master: octocov stores the coverage report as a workflow artifact (artifact:// datastore), which becomes the baseline that future PRs are compared against.

How

  • .octocov.yml: octocov reads SimpleCov's coverage/.resultset.json natively — no format conversion, no cc-test-reporter binary, no external service. Baseline storage and comparison use GitHub Actions artifacts with the built-in GITHUB_TOKEN (no secrets).
  • Workflow triggers changed from push on every branch to pull_request + push on master — octocov needs the PR context to comment, and the master runs to record the baseline (same trigger change as Post coverage report as a PR comment via couve #285).
  • Job permissions are scoped to the rspec job: pull-requests: write (comment) and actions: read (baseline artifact).
  • The octocov step is skipped on PRs from forks, which get a read-only GITHUB_TOKEN and could not post the comment. Dependabot PRs are fine: the explicit permissions key is honored for them.

Notes

  • The comment on this very PR will show no delta: the baseline only starts existing after this lands on master and the workflow runs there once. From the next PR on, the comment shows master X% → PR Y% (+/-).
  • No coverage gate in this PR. When we want one, it is one line in .octocov.yml (e.g. coverage.acceptable: current >= prev), evaluated against the recorded baseline.

Tested

  • Full suite locally: 291 examples, 0 failures; SimpleCov line coverage 99.5% (3598/3616).
  • octocov v0.75.12 ran locally against the generated .resultset.json with this exact config: parsed it natively and reported 99.5%, exit 0.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

This comment has been minimized.

@gabrieldeespindula
gabrieldeespindula marked this pull request as ready for review August 20, 2026 12:35
@gabrieldeespindula gabrieldeespindula self-assigned this Aug 20, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Code Metrics Report

Coverage Test Execution Time
99.5% 12s

Reported by octocov

@gabrieldeespindula
gabrieldeespindula merged commit 1c84fe4 into master Aug 20, 2026
2 checks passed
@gabrieldeespindula
gabrieldeespindula deleted the add-octocov-coverage-report branch August 20, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant