Repository navigation
Description
Found while running the local gate for #185 stage 3, on a branch that touches only
internal/compression and internal/storage/s3.
What happens
./scripts/coverage-gate.sh fails on sdks/c on darwin and passes on linux, for the
same commit:
darwin: FAIL sdks/c — 11.9%, below its floor of 12%
linux: ok sdks/c 12.1% (floor 12%)
sdks/c has exactly two Go files, no build tags, and no GOOS reference, so nothing
in the source selects per platform. The profiles disagree on the denominator:
| statements | covered | ratio | |
|---|---|---|---|
| darwin | 243 | 29 | 11.93% |
| linux | 248 | 30 | 12.10% |
Five more statements exist on linux and one more of them is covered. The package is
cgo (import "C" with a C preamble), and cgo is where a platform gets to change the
statement count without any Go source doing so — the same mechanism that makes gosec
report this package's findings against a generated intermediate, which
security.yml already has a filter for.
Why it matters
Two separate problems, and the second is the one with teeth.
-
The floor is not locally verifiable. Anyone running the gate before pushing sees
a red cell they did not cause and cannot fix, which trains them to ignore the gate's
output — the failure mode a gate exists to prevent..coverage-floorsline 410
records this floor as "verified rather than reasoned", and it was: 12.1% is a real
linux measurement. It just is not reproducible anywhere else. -
0.1% of headroom is one line. At 248 statements, 12% is 29.76 statements, so
30 covered is the minimum integer that clears the floor. Adding a single uncovered
statement tosdks/c/main.goturns CI red, and the diagnosis for whoever hits it is
a percentage two decimal places from its floor in a package they probably were not
thinking about.
Options
- Drop the floor to 11. It is the honest number: the lowest measurement any
supported platform produces, minus rounding..coverage-floorsline 410 explains why
11 was rejected before — an earlier 11.0% reading was invalidated — but that argument
was about a stale measurement, not about cross-platform spread, which was not known
then. Cheapest fix, and it costs one statement of strictness in a package covered at
12%. - Exempt
sdks/cfrom the floor and gate it on the C test suite instead. Line 428
already notes the real tests are insdks/c/tests, which is not ago testtarget,
so the 12% number was never measuring the thing that tests this SDK. This is the
correct fix and the expensive one. - Make the gate report the platform it measured on. Does not fix either problem but
makes the next person's confusion five seconds long instead of twenty minutes.
Recommendation: drop the floor to 11 now, and treat wiring the C suite into CI as the
real answer. Related: #361 is what made the coverage job's cgo posture explicit enough
to floor this package at all.
Activity