Skip to content

sdks/c's coverage floor cannot be reproduced off linux, and has 0.1% of headroom in CI #517

Open

Description

@scttfrdmn

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.

  1. 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-floors line 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.

  2. 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 to sdks/c/main.go turns 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-floors line 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/c from the floor and gate it on the C test suite instead. Line 428
    already notes the real tests are in sdks/c/tests, which is not a go test target,
    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

  1. added
    type: testing
    priority: low
    effort: small
    area: ci-cd
    on Sep 17, 2026
  2. added this to the Future Work milestone on Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ci-cdeffort: smallpriority: lowtype: testing

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions