Skip to content

feat(worker-turbo): skipResourceProvisioning turns off wrangler's resource check (0.21.0) - #22

Merged
ruehowl merged 1 commit into
mainfrom
claude/worker-turbo-skip-provisioning
Oct 28, 2026
Merged

ruehowl merged 1 commit into
mainfrom
claude/worker-turbo-skip-provisioning

Conversation

@ruehowl

@ruehowl ruehowl commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Why

wrangler 4 provisions resources by default on every wrangler deploy (--x-provision defaults to true). For an R2 bucket binding, that means a GET /accounts/<id>/r2/buckets/<name> before the upload, unless the deployed Worker already has the same binding. The brokered workers-deploy token has no R2 permission. So the first deploy of a Worker that gains an R2 binding fails with Authentication error [code: 10000] on that path, after wire-live has already passed.

This happened on sourceplane/lumen-payload's CMS: main run 40659792149 failed its stage and prod cms lanes at deploy. The bucket itself is Terraform's (cloudflare-r2-cms), so wrangler's check adds nothing there.

What

  • cloudflare-worker-turbo gets an optional boolean parameter, skipResourceProvisioning (default false). When true, the deploy step passes --x-provision=false to wrangler deploy. When it is absent or false, the command is unchanged, so no consumer changes behaviour until it opts in.
  • scripts/verify.sh stage 7 plans two fixture workers on the deploy profile through the packed artifact: one that opts in and one that doesn't. It checks that only the first gets the flag and that both keep the same wrangler deploy --config … --env … command. With the flag line removed from the template, the check fails: verify: cloudflare-worker-turbo deploy ignores skipResourceProvisioning: true.
  • The composition README and docs/verification.md describe the parameter and the new stage.
  • stack.yaml goes from 0.20.1 to 0.21.0.

Verification

  • ./scripts/verify.sh passes locally (orun 2.86.0).
  • wrangler 4.116.0 was run against a local mock of the Cloudflare API, with a Worker that binds R2_MEDIA:
    • Without the flag, it calls GET …/r2/buckets/<name> and fails with Authentication error [code: 10000], the same error as in CI.
    • With --x-provision=false, it makes no R2 call. It uploads the script with {"name":"R2_MEDIA","type":"r2_bucket","bucket_name":…} and deploys.
  • The CMS component was planned through this stack with --trigger github-push-main. Its stage and prod deploy steps render --x-provision=false.

One thing a mock cannot show: whether Cloudflare's script upload accepts an r2_bucket binding from a token that has no R2 permission. The lumen-payload deploy will confirm it once 0.21.0 is released.


Generated by Claude Code

…ource check (0.21.0)

wrangler 4 provisions resources by default on every `wrangler deploy`
(--x-provision defaults to true). For an R2 bucket binding that means a
GET /accounts/<id>/r2/buckets/<name> before the upload, unless the
deployed Worker already carries the same binding. The brokered
workers-deploy token has no R2 permission, so the first deploy of a
Worker that gains an R2 binding fails with "Authentication error
[code: 10000]" on that path, after wire-live has already passed.

Where Terraform components own every resource the bindings name (the
stack's model: wiring resolves the names and IDs), that check adds
nothing. A component can now set `skipResourceProvisioning: true` and
the deploy step passes --x-provision=false. Absent or false keeps
wrangler's default, so no consumer changes behaviour until it opts in.

verify.sh plans an opted-in and a default worker through the packed
artifact and checks only the first gets the flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013JuHbkZCjDrGgHdzCrCRqG
@ruehowl
ruehowl marked this pull request as ready for review October 28, 2026 09:33
@ruehowl
ruehowl merged commit e537411 into main Oct 28, 2026
3 checks passed
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