`wrangler pages deploy` does not say when a deploy went to Preview instead of Production
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 62/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- git, nodejs, typescript
Direzione di ricerca
Il codice rilevante si trova in packages/wrangler/src/pages/deploy.ts, intorno al rilevamento del branch e all'output del deployment (righe collegate 574-581). Leggi come il branch viene ricavato da git rev-parse --abbrev-ref HEAD e dove viene stampato il risultato del deployment. Riproduci il caso eseguendo il deploy da un branch non di produzione e controlla nella voce pages-deploy-detailed dell'output i campi environment e production_branch. È completato quando un deployment di Preview stampa un messaggio che indica il branch di produzione e suggerisce --branch, con test che coprono questo output.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What versions & operating system are you using?
Wrangler 4.166.0, Node v24.19.0, Windows 11 (10.0.26300). The same code path is on main as of 2026-11-24 (wrangler 4.168.0).
Please provide a link to a minimal reproduction
Describe the Bug
When --branch is not passed, wrangler pages deploy takes the branch from git rev-parse --abbrev-ref HEAD, and Pages makes every branch other than the project's production branch a Preview. git init had given our repo a master branch while the Pages project's production branch was main, so every deploy was a Preview and production stopped updating. The output gave no hint. It looked like this (reconstructed from the current source; I no longer have the original log):
✨ Success! Uploaded <n> files (...)
🌎 Deploying...
✨ Deployment complete! Take a peek over at https://<hash>.<project>.pages.dev
✨ Deployment alias URL: https://master.<project>.pages.dev
Our production site stayed on an old version until we noticed by hand.
Steps to reproduce:
- A Pages project whose production branch is
main. - In a git checkout on any other branch (e.g.
master), runwrangler pages deploy <dir> --project-name <project>. - The deploy succeeds and prints "Deployment complete!", but it is a Preview; the production URL is unchanged.
Expected: the output says that this was a preview deployment and names the production branch, e.g. "This is a preview deployment for branch "master", so production was not updated. To deploy these assets to production, re-run with --branch=main (your production branch)."
The create-deployment response already carries environment and production_branch (Wrangler writes both into the pages-deploy-detailed output entry since #7252), so no extra API call is needed.
I have a small fix with tests ready and am happy to open a PR if that is welcome.
Found on my own Pages site. The report and the fix were prepared with help from Claude (Anthropic).
Please provide any relevant error logs
None: the deploy reports success.
- Lingua principale
- TypeScript
- Stelle
- 4.7k
- Fork
- 1.7k
- Merge medio
- 1g 22h
- PR unite (30g)
- 287
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un 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/workers-sdk
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cloudflare/workers-sdk#17158 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
cloudflare/workers-sdk#17139 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
cloudflare/workers-sdk#17112 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
cloudflare/workers-sdk#17110 ·
I maintainer di solito rispondono entro 1 giorno
-
D1 Time Travel restore help advertises 30 days without a plan qualifierForse di nuovo libera @akhil9tiet l’ha presa 7 giorni fa e non c’è nessuna pull request aperta. Apertabug package:wrangler product:d1
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
cloudflare/workers-sdk#17000 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di cloudflare/workers-sdk
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
GetStream/stream-chat-react#3467 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
vercel-labs/ui#1139 ·
I maintainer di solito rispondono entro 1 giorno
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10Forse già presa @goranai l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
bot:ai-assisted component:platform-js status:untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
midnightntwrk/platform-js#93 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100