Skip to content

fix: Preserve --compatibility-flags in the interactive deploy config flow - #14039

Merged
dario-piotrowicz merged 1 commit into
mainfrom
dario/compat-flags-not-being-passed-fix
May 26, 2026
Merged

fix: Preserve --compatibility-flags in the interactive deploy config flow#14039
dario-piotrowicz merged 1 commit into
mainfrom
dario/compat-flags-not-being-passed-fix

Conversation

@dario-piotrowicz

@dario-piotrowicz dario-piotrowicz commented May 25, 2026

Copy link
Copy Markdown
Member

Fixes #[insert GH or internal issue link(s)].

When running wrangler deploy without a config file and going through the interactive setup flow, any --compatibility-flags passed on the command line (e.g. --compatibility-flags=nodejs_compat) were lost in two places:

  1. The generated wrangler.jsonc file did not include compatibility_flags.
  2. The suggested CLI command shown when declining the config file write did not include --compatibility-flags.

Both are now fixed. Compatibility flags are persisted to the generated config and included in the suggested command.

Before After
interactive wrangler deploy flow run before the changes interactive wrangler deploy flow run after the changes

  • 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 incorrect behavior

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

@changeset-bot

changeset-bot Bot commented May 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c1b7f69

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

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

@ask-bonk

ask-bonk Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

@github-actions

github-actions Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

✅ All changesets look good

@pkg-pr-new

pkg-pr-new Bot commented May 25, 2026

Copy link
Copy Markdown
create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: c1b7f69

@dario-piotrowicz
dario-piotrowicz marked this pull request as ready for review May 25, 2026 16:21
@workers-devprod
workers-devprod requested review from a team and emily-shen and removed request for a team May 25, 2026 16:22
@workers-devprod

workers-devprod commented May 25, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@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 found 1 potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment thread .changeset/fix-deploy-compatibility-flags-in-autoconfig.md Outdated
@dario-piotrowicz
dario-piotrowicz force-pushed the dario/compat-flags-not-being-passed-fix branch from 3ee458e to c1b7f69 Compare May 25, 2026 16:28
@kiwigitops

Copy link
Copy Markdown

The compatibility-flags fix looks right, but this also changes existing deploy output formatting by adding a leading blank line before the follow-up message in both branches. That is why several entry-point snapshots now have unrelated blank-line changes.

Could the output spacing stay as-is and keep the snapshot updates limited to the compatibility-flags cases? That would make the behavioral change easier to review and avoid changing CLI output for deploy flows that are not involved in this bug.

@dario-piotrowicz

Copy link
Copy Markdown
Member Author

@kiwigitops the leading blank line is a very minor (although unrelated) addition. I could create a separate PR just for that... but that would feel pretty silly to me, moreover the addition of a single newline shouldn't make reviewing this PR that much more complex...

if someone from the team feels that the extra newline is problematic I will move remove it and add it in a followup PR

@kiwigitops

This comment was marked as spam.

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

This is fixing it for a specific flag (and probably one of the most frequent), but the general problem still exists - there are other flags (routes, triggers, keep_vars etc.) where someone might come across this issue again.

@dario-piotrowicz
dario-piotrowicz enabled auto-merge (squash) May 26, 2026 15:20

@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

@dario-piotrowicz
dario-piotrowicz merged commit fee1ce4 into main May 26, 2026
55 checks passed
@dario-piotrowicz
dario-piotrowicz deleted the dario/compat-flags-not-being-passed-fix branch May 26, 2026 15:21
@github-project-automation github-project-automation Bot moved this from Untriaged to Done in workers-sdk May 26, 2026
@dario-piotrowicz

Copy link
Copy Markdown
Member Author

This is fixing it for a specific flag (and probably one of the most frequent), but the general problem still exists - there are other flags (routes, triggers, keep_vars etc.) where someone might come across this issue again.

#14055 🙂

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.

4 participants