Honour the Worker name selected by Workers Builds for production and Preview deployments
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 22/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript, vite
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 916
- Fork
- 53
- Merge medio
- 18h 37m
- PR unite (30g)
- 197
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cloudflare/cf
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cloudflare/cf#344 ·
I maintainer di solito rispondono entro 1 giorno
-
upstream
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cloudflare/cf#262 ·
I maintainer di solito rispondono entro 1 giorno
-
`cf dev` rejects `--port` and `--host` for Vite projects, including the `cf init` templateForse già presa @jamesopstad l’ha presa 11 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cloudflare/cf#223 · 2 assegnatari ·
I maintainer di solito rispondono entro 1 giorno
-
upstream
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
cloudflare/cf#179 ·
I maintainer di solito rispondono entro 1 giorno
-
`cf workers …` API commands fail without workerd: workers module statically imports miniflareAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
cloudflare/cf#390 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di cloudflare/cf
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
farion1231/cc-switch#8829 ·
I maintainer di solito rispondono entro 1 giorno
-
[core-client] Remove unused hand-maintained transport helpers after the definition-table cutoverApertadoc-audit enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Snapshot capture failure (EPERM spawning git) fails the whole step despite the best-effort contractApertareproduced
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
anomalyco/opencode#58685 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno