Commit 78c98ae
ci: gate PRs on 100% patch coverage + 95% project floor (#149)
* 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 (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>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 5909f59 commit 78c98ae
1 file changed
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
| |||
147 | 150 | | |
148 | 151 | | |
149 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 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 | + | |
0 commit comments