Skip to content

[wrangler] Add preview auto-provisioning for KV and R2#14416

Draft
maxwellpeterson wants to merge 3 commits into
cloudflare:mainfrom
maxwellpeterson:mpeterson/preview-auto-provision
Draft

[wrangler] Add preview auto-provisioning for KV and R2#14416
maxwellpeterson wants to merge 3 commits into
cloudflare:mainfrom
maxwellpeterson:mpeterson/preview-auto-provision

Conversation

@maxwellpeterson

@maxwellpeterson maxwellpeterson commented Jun 24, 2026

Copy link
Copy Markdown
Member

wrangler preview can now provision new, per-preview resources for binding-only entries in the previews config block. wrangler preview delete cleans up only those auto-provisioned preview resources and leaves explicitly configured resources untouched. Preview auto-provisioning does not update the previews config block, since resource names and IDs are unique for each preview.

This implementation is incomplete and not intended to be reviewed or merged yet. Auto-provisioning for wrangler preview should support the same set of resources as wrangler deploy. wrangler preview is currently missing a number of resources, including D1 and others.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: wrangler preview is still in private beta

A picture of a cute animal (not mandatory, but encouraged)

@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 653c8e0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
wrangler Minor
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 24, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@14416

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@14416

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14416

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@14416

miniflare

npm i https://pkg.pr.new/miniflare@14416

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@14416

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@14416

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@14416

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@14416

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@14416

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@14416

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@14416

wrangler

npm i https://pkg.pr.new/wrangler@14416

commit: 653c8e0

@maxwellpeterson maxwellpeterson changed the title [wrangler] Add preview KV and R2 provisioning [wrangler] Add preview auto-provisioning for KV and R2 Jun 24, 2026
}

const title = getPreviewResourceName(workerName, previewSlug, kv.binding);
const existing = (await listKVNamespaces(config, accountId)).find(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the existing pattern but we really shouldn't be applying this filter client-side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

2 participants