Commit f28aae3
ci: gate PRs on 100% patch coverage + 95% project floor (#53)
* ci(coverage): gate PRs on 100% patch coverage + 95% project floor
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>
* ci: measure 95% project floor over production code only
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>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 088f61c commit f28aae3
1 file changed
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| |||
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
0 commit comments