Repository navigation
ci: fixes and prompt corrections from the nginx-zstd adoption - #41
Merged
Merged
Conversation
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.
|
Warning Your free Security trial is over. An organization admin can activate billing to continue. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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()ininstall-linters.shno longer swallows its own failure; steps 6, 15, 16 and 20 ofci/PROMPT.mdgain the missing warnings and acceptance criteria;ci/tools/remap-checks.pyis added as the remedy for the orphaned-context trap.Severity:
High(CI integrity — a gate that reported clean while unarmed)--checkfailed openreport()placed the|| echo MISSINGfallback inside the command substitution:The fallback feeds
printfand never touchesrc. Every tool routed throughreport()— all ofAPT_TOOLSandPIPX_TOOLS, plusactionlintandzizmor— printedMISSINGand still exited 0. Only thePY_MODULESloop and theTest::Nginxcheck ever setrc=1.lint.ymlgates 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.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-stepsandlint-sync-stampare reference-only and do not port —run-all.shis 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_callmember 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 theghcommands 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 aci.ymlcaller job rather than the README badge. Measured on nginx-zstd-module: a green 18/18 PR left permanently unmergeable, two cycles to diagnose — becausebranches/<branch>/protectionreturns 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.pyThe remedy for that trap. It derives each caller prefix from
ci.ymlitself rather than a hand-written table: for a job whoseuses:names a local workflow, the prefix is that job'sname:when set, else the called workflow's own top-levelname:— 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 fixedci/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 —a90ea3aremoved it deliberately and that reasoning still holds);ci-deep.yml'sscannersjob carrying the same never-fails pattern step 27 fixes insecurity-scanners.yml; step 29's lane budget understating real oversubscription, whose cross-workflow half has no fix inside the step becauseneeds:cannot cross a reusable-workflow-call boundary; andvalgrind.suppshipping 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.shclean — 14 checkers, no skips, no missing tools.lint-prompt-steps.sh: 42 steps defined, all citations in 91 files resolve.ruff checkandruff format --checkclean on the new script.remap-checks.pyverified 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.--no-verify.No soak or campaign run: this diff touches a shell function, prose, and a script that only reads the API unless
--applyis passed.