Skip to content

Preserve existing secret bindings during Worker deployments - #15964

Merged
jamesopstad merged 3 commits into
mainfrom
james/deploy-keep-secrets
Sep 30, 2026
Merged

jamesopstad merged 3 commits into
mainfrom
james/deploy-keep-secrets

Conversation

@jamesopstad

@jamesopstad jamesopstad commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes cloudflare/cf#70

Preserve existing secret bindings during Worker deployments

Deployments now explicitly inherit unchanged secret bindings from the previous Worker version, including secrets that are not declared in the local configuration. Wrangler already preserved these secrets through backend compatibility behavior; this change makes that behavior explicit and consistent for other consumers of the deploy helpers.


  • 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: internal change

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

@changeset-bot

changeset-bot Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 046aa60

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

This PR includes changesets to release 2 packages
Name Type
@cloudflare/deploy-helpers Patch
@cloudflare/remote-bindings 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

@ask-bonk

ask-bonk Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

@jamesopstad
jamesopstad marked this pull request as ready for review September 30, 2026 10:08
@pkg-pr-new

pkg-pr-new Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
@cloudflare/autoconfig

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

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@15964

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@15964

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@15964

@cloudflare/containers-shared

npm i https://pkg.pr.new/@cloudflare/containers-shared@15964

create-cloudflare

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

@cloudflare/deploy-helpers

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@15964

@cloudflare/pages-shared

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

@cloudflare/runtime-types

npm i https://pkg.pr.new/@cloudflare/runtime-types@15964

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@15964

@cloudflare/workers-auth

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: 046aa60

@workers-devprod
workers-devprod requested review from a team and dario-piotrowicz and removed request for a team September 30, 2026 10:08
@workers-devprod

workers-devprod commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

devin-ai-integration[bot]

This comment was marked as resolved.

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Codeowners reviews satisfied

@jamesopstad
jamesopstad merged commit 4a5ab6c into main Sep 30, 2026
59 checks passed
@jamesopstad
jamesopstad deleted the james/deploy-keep-secrets branch September 30, 2026 12:21
hyperspeed-ci Bot pushed a commit to mauricekleine/mauricekleine.com that referenced this pull request Sep 30, 2026
cf 1.0.0-beta.8 includes the fix for cloudflare/cf#70
(cloudflare/workers-sdk#15964), so this reapplies the cf migration
reverted in #66. A throwaway Worker kept its secret across cf deploy,
cf deploy --prebuilt and cf workers versions create --prebuilt.

The signup secrets are now declared with bindings.secret(), so a deploy
fails instead of shipping without them.

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
mauricekleine added a commit to mauricekleine/fluncle that referenced this pull request Oct 1, 2026
cf 1.0.0-beta.8 keeps existing Worker secrets on deploy (cloudflare/cf#70,
fixed in cloudflare/workers-sdk#15964), so fluncle-web moves from Wrangler
to cf.

- apps/web/cloudflare.config.ts replaces wrangler.jsonc. The Vite plugin
  loads it through experimental.newConfig and writes cf's build output,
  which deploy:cf ships with `cf deploy --prebuilt`.
- @cloudflare/vite-plugin goes to 1.61, the oldest release that reads
  cf's config format and clears minimumReleaseAge.
- The client-chunk purity gate keys on the Vite environment instead of
  the output directory name, which no longer ends in "client".
- Sentry source maps upload from cf's output directories.
- purge-edge-cache reads the zone id from cloudflare.config.ts.

Secrets are not declared with bindings.secret(): declaring any makes local
dev load only declared names from .dev.vars, which drops the E2E stack's
fake endpoints. apps/ci-events stays on Wrangler; cf can't find its hoisted
wrangler bundler, and the relay isn't deployed.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
hyperspeed-ci Bot pushed a commit to mauricekleine/fluncle that referenced this pull request Oct 1, 2026
* chore(web): deploy with the cf CLI

cf 1.0.0-beta.8 keeps existing Worker secrets on deploy (cloudflare/cf#70,
fixed in cloudflare/workers-sdk#15964), so fluncle-web moves from Wrangler
to cf.

- apps/web/cloudflare.config.ts replaces wrangler.jsonc. The Vite plugin
  loads it through experimental.newConfig and writes cf's build output,
  which deploy:cf ships with `cf deploy --prebuilt`.
- @cloudflare/vite-plugin goes to 1.61, the oldest release that reads
  cf's config format and clears minimumReleaseAge.
- The client-chunk purity gate keys on the Vite environment instead of
  the output directory name, which no longer ends in "client".
- Sentry source maps upload from cf's output directories.
- purge-edge-cache reads the zone id from cloudflare.config.ts.

Secrets are not declared with bindings.secret(): declaring any makes local
dev load only declared names from .dev.vars, which drops the E2E stack's
fake endpoints. apps/ci-events stays on Wrangler; cf can't find its hoisted
wrangler bundler, and the relay isn't deployed.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore: exempt cf from the minimum release age

cf 1.0.0-beta.8 is the first release whose deploy keeps Worker secrets
(cloudflare/cf#70), and it is younger than the 3-day minimumReleaseAge,
so CI and Workers Builds could not install it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(web): add the crawler banner to cf's client output

The banner plugin skipped any output directory not ending in "client".
cf's client assets land in .../assets, so browser chunks lost the
banner. Key it on the Vite environment, as the purity gate already is.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* chore(web): generate Worker types with cf

wrangler types read wrangler.jsonc, which this branch removes. typecheck
now runs `cf workers types` first and tsconfig includes its output, so
Env follows cloudflare.config.ts without a committed generated file.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(web): drop deleted source maps from the Worker manifest

With SENTRY_AUTH_TOKEN set, the Sentry plugin deletes the Worker's
source maps after uploading them, but the Vite plugin has already listed
them in worker.config.json. cf deploy --prebuilt reads every listed
module, so the production deploy would fail with "Module not found".

The build now ends with prune-worker-manifest, which drops listed source
maps that no longer exist and fails the build if any other listed module
is missing.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

cf deploy drops existing Worker secrets

3 participants