Skip to content

feat(wrangler): support long branch names in preview alias generation#10283

Merged
WillTaylorDev merged 1 commit intomainfrom
willtaylor/support-long-branch-names-autogeneration-alias
Aug 8, 2025
Merged

feat(wrangler): support long branch names in preview alias generation#10283
WillTaylorDev merged 1 commit intomainfrom
willtaylor/support-long-branch-names-autogeneration-alias

Conversation

@WillTaylorDev
Copy link
Contributor

@WillTaylorDev WillTaylorDev commented Aug 8, 2025

Updates generatePreviewAlias to truncate long branch names with hash suffixes when they exceed DNS label constraints, instead of returning undefined. This allows preview deployments for branches with longer descriptive names.

Fixes #WC-3840

  • Tests
    • Tests included
    • Tests not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: alias generation is a function of WCI, and is best-effort.
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: v4 feature only

@WillTaylorDev WillTaylorDev requested a review from a team as a code owner August 8, 2025 13:30
@changeset-bot
Copy link

changeset-bot bot commented Aug 8, 2025

🦋 Changeset detected

Latest commit: b8cf380

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

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 8, 2025

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

wrangler

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

commit: b8cf380

Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OOC what happens if the preview alias is already used?

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Aug 8, 2025
Updates generatePreviewAlias to truncate long branch names with hash suffixes
when they exceed DNS label constraints, instead of returning undefined.
This allows preview deployments for branches with longer descriptive names.
@WillTaylorDev WillTaylorDev force-pushed the willtaylor/support-long-branch-names-autogeneration-alias branch from 8c8bc52 to b8cf380 Compare August 8, 2025 13:48
@WillTaylorDev
Copy link
Contributor Author

OOC what happens if the preview alias is already used?

If a preview alias is already used, EWC will point the alias to the present version being uploaded. The hash being suffixed on the end of the alias ensures that branches with the same long prefix will still get distinct aliases.

@WillTaylorDev WillTaylorDev merged commit 80960b9 into main Aug 8, 2025
44 of 46 checks passed
@WillTaylorDev WillTaylorDev deleted the willtaylor/support-long-branch-names-autogeneration-alias branch August 8, 2025 14:49
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants