Skip to content

ci: fixes and prompt corrections from the nginx-zstd adoption - #41

Merged
eilandert merged 1 commit into
mainfrom
feedback/nginx-zstd-2026-08-22
Aug 22, 2026
Merged

eilandert merged 1 commit into
mainfrom
feedback/nginx-zstd-2026-08-22

Conversation

@eilandert

Copy link
Copy Markdown
Member

Step 33 of the nginx-zstd-module adoption: the one write back to the reference. Nine findings — five fixed in code here, four sent to ci/feedback/ because they need a decision rather than a patch.

TL;DR

The installer's own health check said everything was fine while half the linters were missing, so a repository could pass its lint gate without ever running most of its checkers. Three of the prompt's steps also told an adopter to do something that either cannot be observed or quietly breaks the branch's merge gate.

report() in install-linters.sh no longer swallows its own failure; steps 6, 15, 16 and 20 of ci/PROMPT.md gain the missing warnings and acceptance criteria; ci/tools/remap-checks.py is added as the remedy for the orphaned-context trap.

Severity: High (CI integrity — a gate that reported clean while unarmed)

--check failed open

report() placed the || echo MISSING fallback inside the command substitution:

printf '%-14s %s\n' "$1" "$(command -v "$1" 2>/dev/null || echo MISSING)"

The fallback feeds printf and never touches rc. Every tool routed through report() — all of APT_TOOLS and PIPX_TOOLS, plus actionlint and zizmor — printed MISSING and still exited 0. Only the PY_MODULES loop and the Test::Nginx check ever set rc=1.

lint.yml gates on that exit status, not on the text, so a half-armed toolchain read as a pass and the absent checkers simply never ran. This is the prompt's own "a checker turned no-op" class, occurring inside the installer meant to prevent it.

$ env -i PATH=/usr/bin:/bin HOME=$HOME bash ci/linter/install-linters.sh --check
before: 8 tools MISSING, exit 0
after:  8 tools MISSING, exit 1
after,  full PATH: no MISSING lines, exit 0

Both directions matter: the second control proves the fix does not simply fail everything.

Prompt corrections

Step 6 now requires the exit code to be proven, not just the listing, and states that lint-prompt-steps and lint-sync-stamp are reference-only and do not port — run-all.sh is glob-driven, so not copying them is the whole edit, but the obvious reading is that the set ports 1:1.

Step 15 asked for "a run list showing every member twice" as the barrier-B evidence. That state cannot occur: a workflow_call member yields jobs inside the caller's run, never a second top-level run. An adopter following it literally hunts for an artifact that does not exist. Replaced with the observable form of the same property — one run for the PR event whose job list contains each member twice — with the gh commands that show it.

Steps 16 and 20 both orphan required check contexts, by different routes, and neither warned. The context is <caller job name> / <job name>, so step 16's move behind the orchestrator renames every one of them; step 20's "match spelling character for character" rule renames them again if an adopter applies it to a ci.yml caller job rather than the README badge. Measured on nginx-zstd-module: a green 18/18 PR left permanently unmergeable, two cycles to diagnose — because branches/<branch>/protection returns 404 when the gate is a ruleset, which reads as "no protection configured" rather than "protected by a different mechanism". Both steps now carry the warning, and the ruleset-versus-produced-context diff is an acceptance item.

ci/tools/remap-checks.py

The remedy for that trap. It derives each caller prefix from ci.yml itself rather than a hand-written table: for a job whose uses: names a local workflow, the prefix is that job's name: when set, else the called workflow's own top-level name: — which is what GitHub uses, and why the reference deliberately leaves those caller jobs unnamed. It writes a rollback copy of the ruleset and is a dry run unless --apply.

Matrix job names are templates (Build (${{ matrix.flavor }})) that no static read can render, so an exact miss falls back to the longest non-template leading match. An unmapped context is a hard error, never a guess — making a previously-optional check required is a decision for a human.

Sent to ci/feedback/ instead of fixed

ci/feedback/nginx-zstd-module-2026-08-22.md, four items: no route for a gate the adopter has and the reference does not (explicitly not a request to restore ast-grep — a90ea3a removed it deliberately and that reasoning still holds); ci-deep.yml's scanners job carrying the same never-fails pattern step 27 fixes in security-scanners.yml; step 29's lane budget understating real oversubscription, whose cross-workflow half has no fix inside the step because needs: cannot cross a reusable-workflow-call boundary; and valgrind.supp shipping as the generic circulated nginx file, whose 28 unfilled placeholder blocks name symbols an adopter never links and can mask the module's own errors.

Testing

  • ci/linter/run-all.sh clean — 14 checkers, no skips, no missing tools.
  • lint-prompt-steps.sh: 42 steps defined, all citations in 91 files resolve.
  • ruff check and ruff format --check clean on the new script.
  • remap-checks.py verified against nginx-zstd-module's ruleset 16557047: from the 13 bare pre-remap contexts it reproduces the live remapped set exactly (13/13, compared field by field), and it is idempotent on the already-remapped ruleset — 0 changes, nothing written.
  • pre-commit hooks passed at commit time; no --no-verify.

No soak or campaign run: this diff touches a shell function, prose, and a script that only reads the API unless --apply is passed.

Five findings fixed in code, four sent to ci/feedback/ as decisions.

install-linters.sh --check failed open. report() put the `|| echo MISSING`
fallback inside the command substitution, so it fed printf and never touched
rc. Every tool routed through it -- the whole APT_TOOLS + PIPX_TOOLS set plus
actionlint and zizmor -- printed MISSING and exited 0; only the PY_MODULES loop
and the Test::Nginx check set rc=1. lint.yml gates on that exit code, so a
half-armed toolchain read as a pass and the missing checkers were simply never
run. That is the prompt's own "a checker turned no-op" class, inside the
installer meant to prevent it.

  before: PATH=/usr/bin:/bin ... --check -> 8 tools MISSING, exit 0
  after:  same probe -> exit 1; full PATH -> exit 0, no MISSING lines

PROMPT.md step 6 now requires the exit code to be proven, not just the listing,
and says the two reference-only checkers (lint-prompt-steps, lint-sync-stamp)
do not port.

Step 15's barrier B asked for "a run list showing every member twice", which
cannot occur on GitHub Actions: a workflow_call member yields jobs inside the
caller's run, never a second top-level run. Replaced with the observable form of
the same property -- one run for the PR event whose job list contains each
member twice -- with the gh commands that show it.

Steps 16 and 20 both silently orphan required check contexts, by different
routes, and neither warned. The context is "<caller job name> / <job name>", so
step 16's move behind the orchestrator renames every one of them, and step 20's
"match spelling character for character" rule renames them again if an adopter
applies it to a ci.yml caller job instead of the README badge. Measured on
nginx-zstd-module: a green 18/18 PR left permanently unmergeable, two cycles to
diagnose, because branches/<branch>/protection returns 404 when the gate is a
ruleset -- which reads as "no protection" rather than "protected by a different
mechanism". Both steps now carry the warning and the ruleset-vs-produced-context
diff as an acceptance item.

ci/tools/remap-checks.py is the remedy: it derives each caller prefix from
ci.yml rather than a hand-written table, writes a rollback copy, and is a dry
run unless --apply. Verified against nginx-zstd-module's ruleset 16557047 --
from the 13 bare pre-remap contexts it reproduces the live remapped set exactly,
and it is idempotent on the already-remapped one. Matrix job names are templates
that no static read can render, so an exact miss falls back to the longest
non-template leading match.

Verified: run-all.sh clean (14 checkers, no skips), lint-prompt-steps 42 steps
with all citations resolving, ruff check and format clean.
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Warning

Your free Security trial is over. An organization admin can activate billing to continue.

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 508bb5bb-d600-4164-b417-0832b324da65


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@eilandert
eilandert merged commit 537f28e into main Aug 22, 2026
14 checks passed
@eilandert
eilandert deleted the feedback/nginx-zstd-2026-08-22 branch August 22, 2026 03:12
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.

1 participant