Skip to content

Avoid custom domain prompt for same Worker - #15434

Open
yomna-shousha wants to merge 4 commits into
cloudflare:mainfrom
yomna-shousha:yomna/custom-domain-preview-prompt
Open

Avoid custom domain prompt for same Worker#15434
yomna-shousha wants to merge 4 commits into
cloudflare:mainfrom
yomna-shousha:yomna/custom-domain-preview-prompt

Conversation

@yomna-shousha

@yomna-shousha yomna-shousha commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Skip the custom-domain replacement confirmation when a modified custom domain already belongs to the Worker being deployed.
  • Keep the confirmation for domains owned by another Worker.
  • Keep DNS conflict confirmation behavior unchanged.

Context

Repro: deploy a Worker with a custom domain, then add routes[].previews_enabled and redeploy in an interactive terminal. Before this change, Wrangler prompts even though the existing custom domain is already used by the same Worker.

Validation

  • pnpm exec oxfmt --check .changeset/fuzzy-dogs-prompt.md packages/deploy-helpers/src/triggers/deploy.ts packages/deploy-helpers/src/triggers/publish-routes.ts packages/deploy-helpers/tests/publish-custom-domains.test.ts packages/wrangler/src/__tests__/deploy/routes.test.ts
  • git diff --check
  • pnpm --filter @cloudflare/deploy-helpers test run tests/publish-custom-domains.test.ts
  • pnpm --filter wrangler test run src/__tests__/deploy/routes.test.ts -t "should not confirm override if custom domain already belongs to this Worker"

Checklist

  • Tests included/updated
  • Documentation not necessary because: This fixes an unnecessary interactive prompt without changing Wrangler configuration or public APIs.

@changeset-bot

changeset-bot Bot commented Aug 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 88404bb

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

This PR includes changesets to release 5 packages
Name Type
@cloudflare/deploy-helpers Patch
wrangler Patch
@cloudflare/remote-bindings Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-plugin 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

@pkg-pr-new

pkg-pr-new Bot commented Aug 30, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@15434

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@15434

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@15434

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@15434

create-cloudflare

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

@cloudflare/deploy-helpers

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@15434

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@15434

@cloudflare/workers-auth

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: 88404bb

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.

Maybe add a test for Wrangler Environments too? I get a bit nervous seeing just a bare scriptName floating around. Would like to just make sure we're covering Wrangler Environments too (since their name is dynamic).

@GregBrimble

GregBrimble commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Known limitation:

  • pnpm --filter wrangler test run src/tests/deploy/routes.test.ts -t "should not confirm override if custom domain already belongs to this Worker" is blocked in this checkout by existing workspace/test setup failures: writeOutput is not a function and clearOutputFilePath is not a function.

Does that work now? Did you need to rebase or something?

@yomna-shousha
yomna-shousha force-pushed the yomna/custom-domain-preview-prompt branch from ddfdc7a to c10948e Compare September 2, 2026 17:12
@yomna-shousha
yomna-shousha marked this pull request as ready for review September 2, 2026 17:12
@yomna-shousha

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main and reran the targeted test. The old setup failure (writeOutput / clearOutputFilePath) is gone.

The test file path is src/__tests__/deploy/routes.test.ts, so I ran:

pnpm --filter wrangler test run src/__tests__/deploy/routes.test.ts -t "should not confirm override if custom domain already belongs to this Worker"

It passes locally. I rebuilt @cloudflare/workers-utils and @cloudflare/deploy-helpers first because the local checkout needed fresh workspace dist output after the rebase.

@workers-devprod
workers-devprod requested review from a team and penalosa and removed request for a team September 2, 2026 17:13
@workers-devprod

workers-devprod commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • .changeset/fuzzy-dogs-prompt.md: [@cloudflare/wrangler]
  • packages/deploy-helpers/src/triggers/deploy.ts: [@cloudflare/wrangler]
  • packages/deploy-helpers/src/triggers/publish-routes.ts: [@cloudflare/wrangler]
  • packages/deploy-helpers/tests/publish-custom-domains.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/deploy/routes.test.ts: [@cloudflare/wrangler]

@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: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

@yomna-shousha
yomna-shousha force-pushed the yomna/custom-domain-preview-prompt branch 2 times, most recently from 52bdcd8 to e1bec65 Compare September 3, 2026 15:36
@yomna-shousha
yomna-shousha force-pushed the yomna/custom-domain-preview-prompt branch from e1bec65 to 92b5d90 Compare September 3, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

3 participants