fix(#4861): restore explicit npx wrangler@ pin in preCommands - #4864
Conversation
PR #4102 changed both site-deploy.yml preCommands blocks from `npx wrangler@<version> ...` to bare `wrangler ...`, based on a review finding that wrangler-action already installs the pinned version and rewrites `wrangler`-prefixed commands to use it. That rewrite only fires when a preCommands line's full string starts with the literal "wrangler" (wrangler-action's execCommands checks command.startsWith("wrangler")). Both preCommands here are compound shell lines starting with `set -eu; ...`, so the rewrite never triggers and bare `wrangler` isn't on $PATH, failing every prod and PR-preview deploy since #4102 merged with "wrangler: not found" (exit 127). Restore the explicit npx invocation in both blocks and document why it must stay explicit, so this doesn't regress again. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 6:14 PM UTC · Completed 6:22 PM UTC |
PR Summary by QodoFix deploy workflow by restoring explicit
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ReviewVerdict: comment Clean, well-scoped fix for a critical production deployment outage. The root cause analysis is accurate and the implementation is correct. No blocking code issues found — the only required action is human approval for the protected path. Correctness
SecurityNo concerns. The change is a net security improvement:
Intent & Coherence
StyleAdded comments follow the existing YAML comment style, indentation, and technical phrasing. The cross-reference pattern ( Docs CurrencyNo documentation was made stale by this PR. One pre-existing staleness issue noted below. Findings
Previous runReviewVerdict: approve Clean, well-scoped fix for a critical production outage. The root cause analysis is accurate and the fix is correct. Correctness
SecurityNo concerns. The secrets handling pattern (write to temp file → Intent & Coherence
StyleAdded comments follow the existing YAML comment style and indentation. The second block's comment cross-references the first block's explanation with DocsNo documentation was made stale by this PR. One pre-existing staleness issue noted below. Low-severity note (pre-existing, not introduced by this PR):
Labels: PR fixes a bug in the CI deploy workflow for the documentation site. |
- Use `npx --no-install wrangler` instead of `npx wrangler@4.110.0` so wranglerVersion remains the single version source of truth - Add `trap 'rm -f "$secrets_file"' EXIT` to guarantee cleanup if wrangler or any earlier command fails under `set -eu` - Add explicit `packageManager: npm` to both steps so the invocation doesn't silently break if cloudflare_site gains a lockfile - Pin the wrangler-action rewrite-rule comment to the verified commit SHA (9acf94a) so bumping the action pin prompts re-verification Assisted-by: Claude (review, fix) Signed-off-by: Wayne Sun <gsun@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 2:53 PM UTC · Completed 3:03 PM UTC |
Summary
Restores the explicit
npx wrangler@4.110.0invocation inside bothpreCommandsblocks in.github/workflows/site-deploy.yml, fixing thewrangler: not foundfailure that has broken every production and PR-preview deploy since PR #4102 merged.Related Issue
Fixes #4861
Changes
.github/workflows/site-deploy.yml: revertwrangler versions secret bulk ...back tonpx wrangler@4.110.0 versions secret bulk ...in both the production-deploy and PR-previewpreCommandsblocks.npx wrangler@pin must stay, to prevent this regressing again.Root cause
PR #4102's second commit changed both
preCommandsblocks from an explicitnpx wrangler@<version> ...invocation to barewrangler ..., based on a review finding thatcloudflare/wrangler-actionalready installs the pinned version and rewriteswrangler-prefixed commands to reuse it.That rewrite (
dist/index.mjs,execCommands()incloudflare/wrangler-action@9acf94a/ v3.15.0) only fires when apreCommandsline's entire string starts with the literal"wrangler":Both
preCommandshere are single compound shell lines (set -eu; secrets_file=...; wrangler versions secret bulk ...; rm -f ...) — by design, per the existing comments, sincepreCommandsruns each newline as a separate/bin/shinvocation and themktemp/write/cleanup sequence needs to share one temp file path. That line starts withset, notwrangler, so the rewrite never triggers, and barewranglerisn't on$PATH— every prod/preview deploy has failed withwrangler: not found(exit 127) since #4102 merged.Testing
make lintpasses (staged changes first)python3 -c "import yaml; yaml.safe_load(...)")mainsucceeds.Checklist
!for breaking changes)