Repository navigation
fix(smoke): a pipe into grep -q no longer fails a check that passed (0.23.0) - #24
Conversation
…0.23.0) The worker, worker-turbo and workers-assets-turbo verify-deploy jobs ran the product's smokeCommand under `set -o pipefail`. Every baseline asserts with `echo "$html" | grep -q x` or `curl | grep -q x`; grep -q exits at its first match, the writer dies of SIGPIPE (141), and pipefail turns that into a failure. Once the page outgrows the 64 KiB pipe buffer this fails on every attempt, so the retry budget only delays the red: screwfast's 126 KB home page failed smoke on stage and prod while both sites served correctly. Each attempt now runs in a subshell with pipefail off (a failed fetch still fails: grep sees no input), and every failed attempt logs its exit code, naming SIGPIPE when it is 141. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0f6d846e2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # attempt, once the page outgrows the 64 KiB pipe buffer. Without pipefail | ||
| # a failed fetch still fails: grep sees no input and finds nothing. | ||
| smoke() ( | ||
| set +o pipefail |
There was a problem hiding this comment.
Preserve upstream failures when suppressing SIGPIPE
When a supplied smokeCommand pipes a fetch into grep -q, a fetch that emits matching content and then fails can be treated as successful: this disables pipefail, so grep's zero status hides the fetch failure and the deployment passes smoke. Preserve non-SIGPIPE producer failures while ignoring the expected broken-pipe status; the same change appears in the turbo and assets-turbo jobs.
Useful? React with 👍 / 👎.
Why
screwfast-site-and-docs-2deployed fine to stage and prod, and both sites serve correctly, butsmokefailed 10 of 10 times on two separate attempts.The cause is not propagation. The smoke step runs with
set -uo pipefail, and screwfast's smoke command asserts withecho "${html}" | grep -q 'hreflang="fr"'. The home page is 126 KB.grep -qexits at the first match in<head>,echodies of SIGPIPE writing the rest (exit 141), andpipefailfails the check. It fails on every attempt, so the retry budget only delays the red.About 30 baselines'
component.yamlfiles use| grep -q. Each one breaks as soon as the page it checks passes 64 KiB.What
In
cloudflare-worker,cloudflare-worker-turboandcloudflare-workers-assets-turboverify-deploy:set +o pipefail. A failed fetch still fails, because grep gets no input.The
cloudflare-pagesandcloudflare-pages-turbosmoke steps don't set pipefail and are unchanged.Verified
scripts/verify.shpasses.grep -q no-such-text) still fails:failed (exit 1).Consumers pick this up by bumping their
stack-tectonicOCI ref to0.23.0after the release.🤖 Generated with Claude Code