Repository navigation
ci: no piped grep -q under pipefail anywhere, and a repo-wide guard for it (#641) - #1425
Merged
Merged
Conversation
…or it (#641) `writer | grep -q` under pipefail is a race: grep exits on the first match, the writer takes SIGPIPE, and the pipeline returns 141, so a needle that WAS present reads as absent. #608 fixed the one instance that fired. The rule was stated only for detect jobs, and the guard scanned one file. - All 23 live sites (not just the four the ticket listed) drop -q and redirect to /dev/null instead. grep without -q drains its input, so the exit status is the same and the writer is never cut off. skills-check-test's pre-fix form stays as its mutation control and carries the exception marker. - scripts/ci/piped-grep-q-check.sh scans every tracked *.sh, ignoring comments and '# piped-grep-q: intentional'. Its self-test must FAIL on a planted violation first. It runs in make check and in rust.yml's ungated layout steps. - ci-and-supply-chain states the rule repo-wide, and tf-helpers-test.sh cross-references it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
terraform plan
|
athvin
temporarily deployed
to
marketing-preview
November 29, 2026 08:42 — with
GitHub Actions
Inactive
Merged
7 tasks done
This branch was previously deployed
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.
Closes #641
What
No shell in the repo pipes into
grep -q.-qand redirects to/dev/null: grep without-qdrains its input, so the exit status is unchanged and the writer is never SIGPIPE'd.skills-check-test.sh's pre-fix form stays as its mutation control, with the exception marker.scripts/ci/piped-grep-q-check.sh, over every tracked*.sh. It ignores comments and lines marked# piped-grep-q: intentional. Its self-test must fail on a planted violation first. It runs inmake checkand in rust.yml's ungated layout steps.detectjobs. tf-helpers-test.sh cross-references it, and CLAUDE.md'smake checklist includes it.Why
Under
pipefail,writer | grep -qreturns 141 when the writer loses the race, so a FOUND match reads as missing. #608 fixed the one that fired. The single-file guard and the detect-only wording left every other script exposed.Proof
make checkexit 0. The guard's self-test caught its own fixture strings on the first full run (they were untracked during the earlier local run), which was fixed by marking them.skills-check-test,workflow-shell-check(-test),actionlint-required-testandalert-path-check-testall pass after the conversion.Risk & rollback
Every converted line keeps its exit semantics. Rollback:
git revert <merge-sha>.Post-merge ledger
Closed by: agent · session
Claude Code:24d16c2e-fec6-49d8-9797-060338df4848onbrians-MacBook-Pro· 2026-11-29T10:41:48Zmainis green with this change on it — the merge SHA, and the runthat proves it. A later head SHA with this commit as an ancestor counts;
a cancelled run with zero jobs does not: — b8cfb25, rust 46243891571 + frontend 46243891587 success
imagesbuilt, or correctly never ran because nothing that goes intoan image changed: — success, run 46243891609
deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion: — run 46243905259 success; scripts only, no runtime change
deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: — infra, devcontainer success on b8cfb25; rust.yml's new ungated guard step ran in that push run
Donethrough the automation rather than byhand, and the issue closed: — Piped
grep -qunder pipefail: 4 live sites, a single-file guard, and a rule scoped too narrowly to find #641 CLOSED by ci: no piped grep -q under pipefail anywhere, and a repo-wide guard for it (#641) #1425 via automation(a skill, a reference, memory) — or nothing new was learned: — ci-and-supply-chain states the rule repo-wide; the guard catches its own fixtures unless marked, which is how it was proven to fire
Specific to this change
Context — plan, discoveries, measurements, files
Plan
Discoveries
Measurements
Files
Decision on the two small-writer sites the ticket asked about (skills-check.sh:
printf '%s' "$desc"andhead -3): converted rather than allowlisted, so the guard needs no per-site reasoning.🤖 Generated with Claude Code