Skip to content

ci: gate PRs on 100% patch coverage + 95% project floor#149

Open
mastermanas805 wants to merge 2 commits into
masterfrom
ci/patch-coverage-100-gate
Open

ci: gate PRs on 100% patch coverage + 95% project floor#149
mastermanas805 wants to merge 2 commits into
masterfrom
ci/patch-coverage-100-gate

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

  • Adds diff-cover patch-coverage enforcement: every changed line in a PR diff must be covered by a test (--fail-under=100).
  • Enforces a project floor of >=95% total coverage via go tool cover.
  • Go native coverage is converted to Cobertura with gocover-cobertura so diff-cover can read it.
  • fetch-depth: 0 so diff-cover resolves origin/<base_ref>; gated to pull_request events (push has no base_ref).
  • Sibling ../common / ../proto checkout steps preserved — only steps ADDED.

Notes

  • Workflow YAML never appears in the Go coverage report, so diff-cover auto-ignores .github/**; this PR will not fail itself.

New permanent org mandate.

🤖 Generated with Claude Code

claude and others added 2 commits May 22, 2026 09:14
Adds diff-cover patch-coverage enforcement to the coverage workflow: every
changed line in a PR must be covered by a test (--fail-under=100), and total
project coverage must stay >=95%. Go coverage is converted to Cobertura via
gocover-cobertura so diff-cover can read it. fetch-depth: 0 lets diff-cover
resolve origin/<base_ref>; gated to pull_request events. New org mandate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The >=95% project floor was computed over the full coverage.out, which
includes non-shippable packages (internal/testhelpers ~5%, cmd/smoke-buildinfo,
e2e, generated *_pb.go). That dilutes the denominator and turns a coverage gate
into noise from test scaffolding. Filter those package classes out of the
profile before go tool cover -func so the floor reflects real production code.

Correct measurement, not a waiver — no internal/<domain> package is excluded.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 force-pushed the ci/patch-coverage-100-gate branch from 9b24167 to e622f56 Compare May 22, 2026 03:47
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.

2 participants