Skip to content

Preserve all deployment-affecting CLI flags in the interactive deploy config flow - #14055

Merged
dario-piotrowicz merged 4 commits into
mainfrom
dario/compat-flags-not-being-passed-fix-followup
Jun 6, 2026
Merged

Preserve all deployment-affecting CLI flags in the interactive deploy config flow#14055
dario-piotrowicz merged 4 commits into
mainfrom
dario/compat-flags-not-being-passed-fix-followup

Conversation

@dario-piotrowicz

Copy link
Copy Markdown
Member

When running wrangler deploy without a config file and going through the interactive setup flow, CLI flags beyond --compatibility-flags (such as --routes, --triggers, --var, --define, --alias, --jsx-factory, --jsx-fragment, --tsconfig, --minify, --upload-source-maps, --no-bundle, --logpush, --keep-vars, --legacy-env, and --dispatch-namespace) were silently dropped. These flags are now persisted to the generated wrangler.jsonc config file (where a config field equivalent exists) and included in the suggested CLI command when the user declines config file generation.


  • 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: fixing DX in a self-explanatory way

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

@changeset-bot

changeset-bot Bot commented May 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b9ca284

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

This PR includes changesets to release 4 packages
Name Type
wrangler Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch
@cloudflare/wrangler-bundler 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

@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

✅ All changesets look good

@ask-bonk

ask-bonk Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

OK that's fine. The args.var comes from yargs as an array type, and the .length check handles empty arrays correctly.

Now let me assess the overall code quality. The implementation looks solid:

  1. The type definition DeployConfigFlags correctly lists all the new flags
  2. The config file writing correctly maps CLI flags to their config field equivalents (using the right field names like no_bundle for --no-bundle, upload_source_maps for --upload-source-maps, etc.)
  3. The CLI suggestion correctly reconstructs the command line flags
  4. collectKeyValues is properly used for --var, --define, and --alias which all use key:value format
  5. Tests are thorough and cover both config-write and CLI-suggestion paths for each new flag
  6. The test file move from core.test.ts to deploy-interactive-prompts.test.ts is clean — all tests are preserved verbatim

I don't see any logic bugs, security issues, backward compatibility violations, or incorrect API behavior. The code is well-structured and the tests are comprehensive.

LGTM

github run

@pkg-pr-new

pkg-pr-new Bot commented May 27, 2026

Copy link
Copy Markdown
create-cloudflare

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

@cloudflare/deploy-helpers

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-auth

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

@cloudflare/wrangler-bundler

npm i https://pkg.pr.new/@cloudflare/wrangler-bundler@14055

commit: b9ca284

@dario-piotrowicz
dario-piotrowicz marked this pull request as ready for review May 27, 2026 09:49
@workers-devprod
workers-devprod requested review from a team and edmundhung and removed request for a team May 27, 2026 09:49
@workers-devprod

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • .changeset/preserve-all-deploy-flags-in-autoconfig.md: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/deploy/core.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/deploy/deploy-interactive-prompts.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/deploy/autoconfig.ts: [@cloudflare/wrangler]

devin-ai-integration[bot]

This comment was marked as resolved.

@dario-piotrowicz
dario-piotrowicz force-pushed the dario/compat-flags-not-being-passed-fix-followup branch from 1cdae4e to 35d4231 Compare May 27, 2026 10:32
@petebacondarwin
petebacondarwin marked this pull request as draft June 5, 2026 11:55
@dario-piotrowicz
dario-piotrowicz force-pushed the dario/compat-flags-not-being-passed-fix-followup branch from 35d4231 to 45993e5 Compare June 5, 2026 12:31
@dario-piotrowicz
dario-piotrowicz marked this pull request as ready for review June 5, 2026 13:14
@workers-devprod

workers-devprod commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

Comment thread .changeset/preserve-all-deploy-flags-in-autoconfig.md Outdated
Comment thread packages/wrangler/src/deploy/autoconfig.ts
Comment thread packages/wrangler/src/deploy/autoconfig.ts

@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 Jun 6, 2026
@dario-piotrowicz
dario-piotrowicz merged commit 8923f97 into main Jun 6, 2026
68 of 69 checks passed
@dario-piotrowicz
dario-piotrowicz deleted the dario/compat-flags-not-being-passed-fix-followup branch June 6, 2026 15:42
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Jun 6, 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.

3 participants