Honour the Worker name selected by Workers Builds for production and Preview deployments
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 22/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript, vite
Hướng nghiên cứu
Start in packages/cli/src/commands/deploy/shared.ts (production upload of the selected Worker) and packages/cli/src/commands/previews/deploy.ts (Preview Build Output), and read getCIOverrideName in @cloudflare/workers-utils plus resolveWorkerName in deploy-helpers for the precedence rules. Done when WRANGLER_CI_OVERRIDE_NAME sets the target name in both normal and --prebuilt paths, mismatched names deploy to the connected parent Worker, and the skipped override cases in the unported-07 and unported-04 test catalogues are covered.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary of the issue
cf does not honour the Worker name selected by Workers Builds when it differs from worker.name in cloudflare.config.ts. Builds supplies the selected name through WRANGLER_CI_OVERRIDE_NAME, but the tested production and native Preview deployment paths still use the configured name.
This prevents reliably connecting an existing project or template to a differently named dashboard Worker. More seriously, a native Preview build can report success while deploying a Preview under the wrong parent Worker.
Expected behaviour
For deployments run by Workers Builds, use WRANGLER_CI_OVERRIDE_NAME as the target name of the selected Worker, including when deploying existing Build Output. Both production deployments and native Previews should remain attached to the Worker connected to Builds, even when the source configuration has a different name.
Preserve preview-aware configuration (isPreview: true), Preview names, and normal configured names outside Builds. In multi-Worker output, apply the override to the selected deployment target, not every Worker. A job connected to Worker A should not redirect its deployment to Worker B merely because the configuration changes its name.
Version of cf used
1.0.0-beta.17
System information and package versions
Verified on October 14, 2026 using real hosted Workers Builds, triggered by pushes to a disposable Cloudflare Artifacts repository:
- Node:
24.18.0 - npm:
10.9.2 @cloudflare/vite-plugin:2.0.0-beta.sha-67fa336fd- Vite:
8.3.4 - Configuration:
cloudflare.config.ts; no Wrangler configuration file.
Reproduction
- Connect a simple cf/Vite Worker project to a dashboard Worker named
dashboard-worker. - Start with
worker.name: "dashboard-worker"incloudflare.config.ts. - Configure production Builds with build command
npx cf buildand deploy commandnpx cf deploy --prebuilt --no-provision. - Enable native Worker Previews, with no separate build command and deploy command
npx cf previews deploy. This command performs its own preview-aware build. - Push the matching-name configuration to the production branch and a Preview branch. Both runs succeed, and the Preview ID returned by cf matches the allocation tracked by Builds.
- Change only
worker.nametoconfig-worker, leaving the dashboard connection and build settings unchanged. Push to the production branch and a new Preview branch.
Observed results
| Configuration | Production | Native Preview |
|---|---|---|
| Config name matches connected Worker | Success | Success; expected Preview ID |
| Config name differs from connected Worker | Compilation succeeds; deployment fails | Reports success, but deploys under the config-named parent Worker |
The mismatch production run fails because the config-named Worker does not exist. The matching production deployment remains active.
The mismatch Preview run creates a parent Worker record for the config name and deploys a Preview under it. Its returned Preview ID differs from the one allocated by Builds for that branch. This is not a second production deployment: the new parent's deployed_on is null.
Relevant error logs
Names below are simplified; account identifiers and application URLs are omitted.
The Preview configuration callback logs show that Builds supplies the correct override and cf performs a preview-aware build:
{
"configuredName": "config-worker",
"buildsSelectedName": "dashboard-worker",
"isPreview": true,
"mode": "production"
}
The production deployment fails with:
The Worker "config-worker" was not found in your account. Check that the name in your wrangler.json file is correct and that the Worker exists in this account.
The wrangler.json reference is misleading for a cf-config project.
Existing implementation to reuse
Wrangler already supports the Builds name override. Shared workers-sdk code also contains relevant helpers:
getCIOverrideName()in@cloudflare/workers-utilsreadsWRANGLER_CI_OVERRIDE_NAME. cf already depends on@cloudflare/workers-utils.resolveWorkerName()in deploy-helpers' Preview implementation prioritises that override over arguments and configuration. This is an implementation reference, not a claim that it is a public package export.- cf's imported Wrangler test catalogue already lists override cases as skipped/unported: production and Preview name resolution.
Suggested integration points are cf's selected-Worker production upload path in packages/cli/src/commands/deploy/shared.ts and Preview Build Output path in packages/cli/src/commands/previews/deploy.ts. Ensure both normal and --prebuilt deployment paths use the selected target consistently. The exact integration should account for dependent bindings and multi-Worker output rather than blanket-renaming configuration.
Acceptance coverage should include matching names, mismatched names, ordinary and prebuilt deployments, the parent Worker and returned Preview identity, unchanged behaviour without an override, and no unintended renaming of other Workers.
This is separate from #185 / #288, which concern writing deployment result metadata so Builds can display the Preview URL. Reporting a URL does not fix deployment to the wrong parent Worker.
- Ngôn ngữ chính
- TypeScript
- Star
- 916
- Fork
- 53
- Merge trung bình
- 18 giờ 37 phút
- Pull request đã merge (30 ngày)
- 197
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cloudflare/cf
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
cloudflare/cf#344 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
upstream
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
cloudflare/cf#262 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`cf dev` rejects `--port` and `--host` for Vite projects, including the `cf init` templateCó thể đã có người làm @jamesopstad đã nhận 12 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
cloudflare/cf#223 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
upstream
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
cloudflare/cf#179 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
cloudflare/cf#406 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của cloudflare/cf
Issue tương tự
-
VS Code extension: clickable file links in chat drop the :line suffix, never jump to the lineĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
MoonshotAI/kimi-code#4398 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Xiaomi Mimo语音识别服务异常Đang mởpending triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
package-lock.json : les binaires natifs macOS et Linux de unrs-resolver ont disparu depuis #1823Đang mởbug dependencies
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
AxaFrance/design-system#2064 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100