workers-sdk
workers-sdk copied to clipboard
🐛 BUG: Non-interactive version of `versions deploy` still being interactive
Which Cloudflare product(s) does this pertain to?
Wrangler core
What version(s) of the tool(s) are you using?
wrangler 3.52.0
What version of Node are you using?
22.0.0
What operating system and version are you using?
Mac Sonoma 14.4.1
Describe the Bug
Observed behavior
While running this command to enable gradual deployments and providing version ids and environment, we see that the command trigger the interactive version of it and list all worker versions and expect us to manually select versions
npx wrangler versions deploy version-id-1@50% version-id-2@50% --experimental-versions --env dev
⛅️ wrangler 3.52.0
-------------------
╭ Deploy Worker Versions by splitting traffic between multiple versions
│
├ Your current deployment has 1 version(s):
│
│ (100%) version-id-1
│ Created: 2024-04-25T08:21:22.933291Z
│ Tag: -
│ Message: -
│
╰ Which version(s) do you want to deploy? Use SPACE to select/unselect version(s) and ENTER to submit.
● version-id-2
Created: 2024-04-25T08:38:33.339743Z
Tag: -
Message: -
● version-id-3
Created: 2024-04-25T08:21:22.933291Z
Tag: -
Message: -
Expected behavior
It triggers the gradual deployment without asking any input
Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
No response
Adding the -y flag worked for us
npx wrangler versions deploy --experimental-versions -h
wrangler versions deploy [version-specs..]
Safely roll out new Versions of your Worker by splitting traffic between multiple Versions [beta]
Positionals:
version-specs Shorthand notation to deploy Worker Version(s) [<version-id>@<percentage>..] [array] [default: []]
Flags:
-j, --experimental-json-config Experimental: Support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
Options:
--name Name of the worker [string]
--version-id Worker Version ID(s) to deploy [array]
--percentage Percentage of traffic to split between Worker Version(s) (0-100) [number]
--message Description of this deployment (optional) [string]
-y, --yes Automatically accept defaults to prompts [boolean] [default: false]
--dry-run Don't actually deploy [boolean] [default: false]
Currently, the prompts are shown with the arg provided as the default value to allow the user to confirm/change their response.
Based on user feedback, we should change the behaviour to skip the prompt if the arg is provided when running the command.