Improve wrangler deploy flow to also check for potential (and likely unintentional) secrets overrides#11389
Conversation
🦋 Changeset detectedLatest commit: de03c97 The changes in this PR will be included in the next version bump. 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 |
wrangler deploy flow to also check for potential (and likely y unintentional) secrets overrideswrangler deploy flow to also check for potential (and likely unintentional) secrets overrides
7328e0d to
9180084
Compare
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
9180084 to
6fe3f86
Compare
|
Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the Depending on your changes, running Notes:
|
|
Does it actually delete it, or just override it? |
Technically always delete it and then add the new value in. When the one in question is an env variable it does look like an override from the user perspective since secrets and variables are shown in the same plain in the dashboard. But when it is a binding, it does look like a delete since bindings are presented in their own dashboard page and the secret in the other page just disappears. |
b041a4b to
d1e10a5
Compare
d1e10a5 to
7e2ff4f
Compare
…y unintentional) secrets overrides
7e2ff4f to
a1f8a59
Compare
| const untypedValue = entry[1]; | ||
|
|
||
| switch (key) { | ||
| case "durable_objects": { |
There was a problem hiding this comment.
This seems like it has potential to go stale as new binding types are added?
There was a problem hiding this comment.
Yes, I had the same exact thought, but I couldn't think of a solution for this... do you have some ideas? 😓
There was a problem hiding this comment.
Can you include a type guard (assert never or something?) to make sure all bindings types are covered?
There was a problem hiding this comment.
No, I don't think a never-assertion is possible here since we do handle all possible keys, if the key happens to be a binding then we return the corresponding array of names otherwise we return an empty array 😕
(it's not like we need to ensure that key is the key for a bindings, since any other key is also valid here)
There was a problem hiding this comment.
Gotcha... I don't want to overindex on this problem since it's probably fine
Co-authored-by: Somhairle MacLeòid <smacleod@cloudflare.com>
Fixes https://jira.cfdata.org/browse/DEVX-2347
Before in case of names overlaps

wrangler deploywould just proceed with the deployment and override your remote secrets, now instead it will do something like this:wrangler deployflow to also check for potential (and likely unintentional) secrets overrides #11405