Repository navigation
fix(wrangler): don't report rollback success after declining changed secrets confirmation - #16269
Closed
yomna-shousha wants to merge 1 commit into
Closed
yomna-shousha wants to merge 1 commit into
yomna-shousha wants to merge 1 commit into
Conversation
…secrets confirmation
Contributor
|
LGTM |
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/codemods
@cloudflare/config
@cloudflare/containers-shared
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/runtime-types
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
This was referenced Oct 15, 2026
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.
Fixes the "Cancelled rollbacks are reported as successful" pain point from the internal Versioned Secrets pain points doc (no GH issue).
When
wrangler rollbackhits the changed-secrets check (API error 10220) and the user declines the "The following secrets have changed…" confirmation, Wrangler printedAborting rollback...but then fell through to the success path:No deployment is made (the original version stays live, as confirmed with
wrangler deployments status), but the output and the "Current Version ID" line say otherwise. I reproduced this against a real Worker with wrangler 4.151.0.Changes
versions/rollback/index.ts:returnaftercli.cancel("Aborting rollback...")in the changed-secrets branch, matching how declining the first "Are you sure…" prompt already behaves.rollback.test.ts:Aborting rollback..., and prints no success message orCurrent Version ID. Fails without the fix.confirm()used the non-interactive fallback (yes) instead of the mocks.?force=truehandler was registered last, and msw ignores query strings and checks the most recently registered handler first, so it answered the first (non-forced) request and the 10220 path never ran. Handlers are now registered in the right order.afterEach(clearDialogs)(as other test files do) so unused prompt mocks fail the test. With the original test file, all three tests fail this check.Not changed (open question)
A cancelled rollback still exits with code
0, the same as declining the first prompt. That means automation can't tell a cancel from a success by exit code. Exiting non-zero on both cancel paths would fix that, but it's a behaviour change, so I've left it out of this PR. Happy to add it if maintainers agree.Note
This is a contribution from an AI agent: OpenCode, Claude Opus 5.5, under human supervision.