Skip to content

Force npm for wrangler-action's own install, not pnpm auto-detect - #15

Merged
gpmayorga merged 1 commit into
mainfrom
claude/fix-promote-rollback-pnpm-detect
Sep 11, 2026
Merged

gpmayorga merged 1 commit into
mainfrom
claude/fix-promote-rollback-pnpm-detect

Conversation

@gpmayorga

Copy link
Copy Markdown
Collaborator

This is blocking production promotion right now

promote-production.yml's Shift Production Traffic step is failing on apps-invest:

Error: Unable to locate executable file: pnpm. Please verify either the file path exists
or the file can be found within a directory specified by the PATH environment variable.

Root cause

Neither promote (app-promote-production.yml) nor rollback (app-rollback.yml) run setup-app/pnpm — they only shift Cloudflare traffic on an already-built version, no app build needed. But cloudflare/wrangler-action, when given wranglerVersion, does its own internal wrangler install and auto-detects the package manager from whatever lockfile sits in the checked-out working directory. Both jobs check out the full app repo tree (for the release-tag content / on-main ancestry check), which includes pnpm-lock.yaml — so the action decides to install wrangler via pnpm, which was never set up on that runner.

This has been live since the promote/rollback split was introduced; it just hadn't been exercised until today's real promotion attempts.

Fix

Pin packageManager: npm on both wrangler-action steps, so the install no longer depends on incidental lockfile presence in the checkout.

actions/deploy-app hits the identical wrangler-action code path but isn't broken in practice — every caller of it runs after setup-app's pnpm install (for the actual app build), so pnpm is genuinely on PATH there. Left it untouched to keep this fix minimal to the two jobs that are actually broken; happy to harden it too in a follow-up if preferred.

Verification

  • yamllint clean on both files.
  • Traced wrangler-action's own install behavior (triggered by the wranglerVersion input) against the exact log sequence reported: 🔍 Checking for existing Wrangler installation → 📦 Installing Wrangler → the pnpm error — matches this failure mode precisely.
  • No change to the wrangler commands themselves, the resolve-tag/authorize logic, or any other step.

🤖 Generated with Claude Code


Generated by Claude Code

promote and rollback both fail today: "Error: Unable to locate
executable file: pnpm". Neither job runs setup-app/pnpm — they only
shift Cloudflare traffic on an already-built version, no app build
needed — but wrangler-action's own wrangler install (triggered by
passing wranglerVersion) auto-detects the package manager from the
checked-out repo's lockfile, finds pnpm-lock.yaml, and tries to run
pnpm, which was never installed on this runner.

Pin packageManager: npm on both wrangler-action steps so the install
no longer depends on incidental lockfile presence. actions/deploy-app
hits the same wrangler-action code path but isn't affected in
practice — it always runs after setup-app's pnpm install for the app
build — left alone here to keep this fix minimal.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QZs3qvSwpTvBZEPSqfXQzQ
@gpmayorga
gpmayorga requested a review from hieronx as a code owner September 11, 2026 13:06
@gpmayorga
gpmayorga merged commit d6dcefa into main Sep 11, 2026
3 checks passed
@gpmayorga
gpmayorga deleted the claude/fix-promote-rollback-pnpm-detect branch September 11, 2026 13:14
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.

2 participants