Skip to content

fix(wrangler): skip versions deploy prompts for args - #13739

Merged
edmundhung merged 2 commits into
mainfrom
edmundhung/fix-versions-deploy-prompts
May 5, 2026
Merged

fix(wrangler): skip versions deploy prompts for args#13739
edmundhung merged 2 commits into
mainfrom
edmundhung/fix-versions-deploy-prompts

Conversation

@edmundhung

Copy link
Copy Markdown
Member

Fixes #5709.


  • 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: bugfix

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

@changeset-bot

changeset-bot Bot commented Apr 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 77e9062

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

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Apr 29, 2026
@edmundhung
edmundhung marked this pull request as ready for review April 29, 2026 20:42
@github-actions

github-actions Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

✅ All changesets look good

@workers-devprod
workers-devprod requested review from a team and emily-shen and removed request for a team April 29, 2026 20:42
@workers-devprod

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • packages/wrangler/src/tests/versions/versions.deploy.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/versions/deploy.ts: [@cloudflare/wrangler]

@ask-bonk

ask-bonk Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

I've thoroughly reviewed the changes. Let me assess the overall quality:

Logic: The core change is clean — when version specs are provided via CLI args (positional or --version-id/--percentage), a new acceptPromptDefaults boolean is set to true, which skips all interactive prompts (version selection, percentage input, deployment message). This directly fixes the bug reported in #5709.

Edge case consideration: The deployment message prompt at line 167 also uses acceptPromptDefaults, which means if you pass version IDs via args but want to provide a custom --message, you'd need to pass it via --message flag (the prompt is skipped). The defaultValue is args.message, so this is fine — if --message is provided it gets used, if not it's skipped (which is the desired behavior for automation).

Rename consistency: The yesFlag parameter rename to acceptDefault is properly applied everywhere in the private functions.

Tests: Three new tests cover the main scenarios — positional version spec without --yes, two versions with explicit percentages without --yes, and --version-id/--percentage without --yes. All correctly assert that the prompts are not shown.

Changeset: Properly formatted patch changeset with clear description.

I don't see any logic bugs, security issues, backward compatibility problems, or incorrect API behavior. The change is straightforward and well-tested.

LGTM

github run

@devin-ai-integration devin-ai-integration Bot 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@emily-shen emily-shen 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.

can we add to the args description that

percentage:{
    ...
    default: 100
    ...
},
"version-specs": {
			describe:
				"Shorthand notation to deploy Worker Version(s) [<version-id>@<percentage>..]. Percentage defaults to 100 if only the version-id is provided.",

@workers-devprod

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@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

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk May 5, 2026
@edmundhung

Copy link
Copy Markdown
Member Author

@emily-shen Updated the description in 9ab7a95

@pkg-pr-new

pkg-pr-new Bot commented May 5, 2026

Copy link
Copy Markdown
create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: 9ab7a95

@edmundhung
edmundhung merged commit 3ceadef into main May 5, 2026
52 of 53 checks passed
@edmundhung
edmundhung deleted the edmundhung/fix-versions-deploy-prompts branch May 5, 2026 16:14
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk May 5, 2026
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.

🐛 BUG: Non-interactive version of versions deploy still being interactive

3 participants