ci: gate PRs on 100% patch coverage + 95% project floor#24
Open
mastermanas805 wants to merge 2 commits into
Open
ci: gate PRs on 100% patch coverage + 95% project floor#24mastermanas805 wants to merge 2 commits into
mastermanas805 wants to merge 2 commits into
Conversation
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 (cmd/smoke-buildinfo, plus future testhelpers/e2e/generated code). That dilutes the denominator and turns a coverage gate into noise from diagnostic binaries. 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>
529ddcd to
ff60668
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--fail-under=100).go tool cover.gocover-coberturaso diff-cover can read it.fetch-depth: 0so diff-cover resolvesorigin/<base_ref>; gated topull_requestevents (push has nobase_ref).../common/../protocheckout steps preserved — only steps ADDED.Notes
.github/**; this PR will not fail itself.New permanent org mandate.
🤖 Generated with Claude Code