Repository navigation
feat(worker-turbo): skipResourceProvisioning turns off wrangler's resource check (0.21.0) - #22
Merged
Merged
Conversation
…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
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.
Why
wrangler 4 provisions resources by default on every
wrangler deploy(--x-provisiondefaults to true). For an R2 bucket binding, that means aGET /accounts/<id>/r2/buckets/<name>before the upload, unless the deployed Worker already has the same binding. The brokeredworkers-deploytoken has no R2 permission. So the first deploy of a Worker that gains an R2 binding fails withAuthentication error [code: 10000]on that path, afterwire-livehas already passed.This happened on sourceplane/lumen-payload's CMS: main run 40659792149 failed its stage and prod
cmslanes atdeploy. The bucket itself is Terraform's (cloudflare-r2-cms), so wrangler's check adds nothing there.What
cloudflare-worker-turbogets an optional boolean parameter,skipResourceProvisioning(defaultfalse). Whentrue, the deploy step passes--x-provision=falsetowrangler deploy. When it is absent orfalse, the command is unchanged, so no consumer changes behaviour until it opts in.scripts/verify.shstage 7 plans two fixture workers on thedeployprofile 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 samewrangler deploy --config … --env …command. With the flag line removed from the template, the check fails:verify: cloudflare-worker-turbo deploy ignores skipResourceProvisioning: true.docs/verification.mddescribe the parameter and the new stage.stack.yamlgoes from 0.20.1 to 0.21.0.Verification
./scripts/verify.shpasses locally (orun 2.86.0).R2_MEDIA:GET …/r2/buckets/<name>and fails withAuthentication error [code: 10000], the same error as in CI.--x-provision=false, it makes no R2 call. It uploads the script with{"name":"R2_MEDIA","type":"r2_bucket","bucket_name":…}and deploys.--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_bucketbinding 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