Skip to content

ci: enforce formatting, and reformat the file that proved it was not - #910

Merged
bpalermo merged 9 commits into
mainfrom
fix/906-enforce-format
Sep 23, 2026
Merged

bpalermo merged 9 commits into
mainfrom
fix/906-enforce-format

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Closes #906.

The finding

make format-check was red on main. e2e/multiprotocol.sh landed in #901 with two-space indentation against shfmt's tabs, with ci and proxy both green, and sat unformatted.

The cause: no job ran the formatter. ci.yaml had twelve jobs — changes, diff, chart-version-bump, deps-audit, shell, envoy-api-parity, proxy-pin, test, race, integration, e2e, ci — and none invoked //:format.check. The only reference to it in the entire repo was the Makefile target.

So the repo had formatters configured in bazel/format/BUILD.bazel, a documented make format-check in CLAUDE.md, and nothing that made either matter.

Why this is the #853 family

A check that exists, is documented, and never runs. Its greenness carried no information because it was never capable of turning red — the same shape as the shellcheck aspect that linted zero files (#853) and the counter whose zero meant nothing because it was unseeded (#882).

One detail worth recording, because it is what made this easy to miss: the shell job did shellcheck that exact file, and passed. Lint coverage was real; format coverage was absent. A green shell job is not evidence a file was formatted.

The job

Modelled on shell, including its anti-vacuity discipline. It asserts the set of languages the formatter actually ran, not merely the exit code — //:format.check prints one Formatted <language> line per configured language and exits 0 regardless of how much it inspected, so a language quietly dropped from bazel/format/BUILD.bazel would otherwise leave this job green while checking less than it claims.

Added to the required ci aggregate gate. control_plane matches **, so it runs on any non-proxy change.

Both arms demonstrated red before being trusted

1 — formatting violation (appended an unformatted block to a real script):

::error::formatting violations — run 'make format' and commit the result

2 — anti-vacuity arm (fed the checker's output with Shell removed, exit code still 0, simulating a language dropped from the config):

::error::the formatter never ran for: Shell
exit=1

Restored → green:

formatter ran for all 4 configured languages

The reformat

bazel run //:format touched exactly one file — e2e/multiprotocol.sh, 28 insertions / 19 deletions, whitespace only. That it is the sole offender is itself mild evidence the tree was otherwise kept clean by hand.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

bpalermo and others added 2 commits September 23, 2026 07:11
`make format-check` was red on main. `e2e/multiprotocol.sh` landed in #901
with two-space indentation against shfmt's tabs, CI green, and sat
unformatted.

The cause is that NO job ran the formatter. ci.yaml had twelve jobs and none
of them invoked //:format.check; the only reference to it anywhere in the
repo was the Makefile target. So the repo had formatters configured
(gofumpt, buildifier, shfmt, buf in bazel/format/BUILD.bazel), a documented
`make format-check` in CLAUDE.md, and nothing that made either matter.

This is the #853 family again: a check that exists, is documented, and never
runs. Its greenness carried no information because it was never capable of
turning red.

What made it easy to miss is worth recording: the `shell` job DID shellcheck
that exact file, and passed. Lint coverage was real; format coverage was
absent. A green shell job is not evidence a file was formatted.

The new job asserts the SET OF LANGUAGES the formatter ran, not just its exit
code. //:format.check prints one "Formatted <language>" line per configured
language and exits 0 regardless of how much it inspected, so a language
dropped from bazel/format/BUILD.bazel would otherwise leave the job green
while checking less than it claims. That is the same tripwire the shell job
uses for its empty query.

Both arms demonstrated red before being trusted:

  formatting violation  -> ::error::formatting violations — run 'make format'
  language dropped      -> ::error::the formatter never ran for: Shell

and green once restored.

Closes #906

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo enabled auto-merge (squash) September 23, 2026 10:13
@bpalermo
bpalermo merged commit 7de67d2 into main Sep 23, 2026
23 checks passed
@bpalermo
bpalermo deleted the fix/906-enforce-format branch September 23, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI never runs format-check, so unformatted code lands on main (e2e/multiprotocol.sh did)

1 participant