Skip to content

Refactor#13845

Draft
emily-shen wants to merge 1 commit into
mainfrom
refactor
Draft

Refactor#13845
emily-shen wants to merge 1 commit into
mainfrom
refactor

Conversation

@emily-shen
Copy link
Copy Markdown
Contributor

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

Describe your change...


  • 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:

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

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2026

⚠️ No Changeset found

Latest commit: cef1e15

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk Bot left a comment

Choose a reason for hiding this comment

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

I'm Bonk, and I've done a quick review of your PR.

This refactoring extracts shared deploy/versions-upload logic into shared.ts, moves autoconfig and open-next delegation into autoconfig.ts, and inlines the core deploy logic from deploy() into deployWorker() inside index.ts.

Issues found (ranked by severity)

  1. Duplicate describe("legacy") block in test file — lines 1132-1141 are an incomplete copy of the block that starts at line 1142. This will cause a parse/syntax error or malformed test structure.

  2. D1 binding special error handler removed — The old deploy() function had a special case that caught API error 10021 with the specific D1 binding message and re-threw a user-friendly error. That handler was deleted from the new deployWorker() in index.ts (compare with the old code around the catch block). The source-mapping logic was kept, but the D1 guard was dropped.

  3. telemetryMessage: true used for missing worker name — Per packages/wrangler/AGENTS.md, telemetryMessage: true sends the user-facing message as the telemetry label and is discouraged when a stable static label is available. The old deploy and versions-upload paths had distinct stable labels (deploy command missing worker name / versions upload missing worker name).

Comment thread packages/wrangler/src/__tests__/deploy/core.test.ts Outdated
Comment thread packages/wrangler/src/deploy/index.ts Outdated
Comment thread packages/wrangler/src/deployment-bundle/resolve-input.ts
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 7, 2026

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: cef1e15

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented May 7, 2026

Review posted successfully on PR #13845. Here's a summary of what I found:

  1. Duplicate describe("legacy") block (HIGH) — Lines 1132-1141 in core.test.ts are an incomplete duplicate of the block at line 1142. This will cause a syntax error. Suggested deletion via inline suggestion.

  2. D1 binding error handler removed (MEDIUM) — The old deploy() had a special-case handler for D1 binding validation errors (API error 10021) that produced a user-friendly message. It was dropped during the refactor but not moved anywhere. Suggested re-adding it in the catch block.

  3. telemetryMessage: true instead of stable label (LOW) — The shared resolveSharedConfig uses telemetryMessage: true for the missing worker name error, losing the distinct labels the old code had. Suggested using the command parameter to preserve the distinction.

github run

@emily-shen emily-shen force-pushed the refactor branch 3 times, most recently from 37c40b4 to e736431 Compare May 13, 2026 14:31
@github-actions
Copy link
Copy Markdown
Contributor

✅ All changesets look good

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.

2 participants