squad upgrade installs Squad's own CI/release workflows that init deliberately skips (regression of #201)

Aperta Adatta ai principianti
#2,527 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
77/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github-actions, typescript
Ambito
cli, devtools

Direzione di ricerca

Inizia da packages/squad-cli/src/cli/core/upgrade.ts, in collectSquadOwnedCandidates, e confronta la selezione dei workflow con la allowlist FRAMEWORK_WORKFLOWS in packages/squad-sdk/src/config/init.ts. Riproduci il problema con i comandi init e upgrade --dry-run dell’issue. Il lavoro è completato quando upgrade aggiorna i workflow installati ma non pianifica la creazione di altri workflow Squad; verifica sia i casi in cui i workflow esistono sia quelli in cui sono assenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Version: CLI built from release/prepare-2.0.0-preview.5 @ 38d45d02 (package version 2.0.0-preview.6).

What happens

squad init installs only the four framework workflows (#201). Running squad upgrade right after, with nothing changed in between, adds seven more workflows. These are Squad's own product CI/CD, built for Squad's dev/preview/main/insider branch model.

D=$(mktemp -d); cd "$D"; git init -q
node <squad-cli>/dist/cli-entry.js init --roles --client copilot,claude
ls -1 .github/workflows
#   squad-heartbeat.yml  squad-issue-assign.yml  squad-triage.yml  sync-squad-labels.yml
node <squad-cli>/dist/cli-entry.js upgrade --dry-run | grep workflows
#   create    .github/workflows/squad-ci.yml
#   create    .github/workflows/squad-docs.yml
#   create    .github/workflows/squad-insider-release.yml
#   create    .github/workflows/squad-label-enforce.yml
#   create    .github/workflows/squad-preview.yml
#   create    .github/workflows/squad-promote.yml
#   create    .github/workflows/squad-release.yml

A real squad upgrade creates all seven files. For a non-npm project, the five in PROJECT_TYPE_SENSITIVE_WORKFLOWS become TODO stubs that still trigger on pushes and PRs to dev/preview/main/insider. squad-promote.yml and squad-label-enforce.yml are copied verbatim.

Expected

upgrade installs and refreshes the same workflow set that init installs (FRAMEWORK_WORKFLOWS). It updates any other squad-*.yml only if it's already present, because the user opted in. It never creates one.

Source

  • packages/squad-sdk/src/config/init.ts, line 773: the FRAMEWORK_WORKFLOWS allowlist that init uses (the #201 fix).
  • packages/squad-cli/src/cli/core/upgrade.ts, collectSquadOwnedCandidates (line 606). Line 623 onward iterates every *.yml in templates/workflows/ and plans each as a candidate, with no FRAMEWORK_WORKFLOWS filter.
  • packages/squad-cli/src/cli/core/templates.ts, lines ~350–415: TEMPLATE_MANIFEST lists all 11 workflows with overwriteOnUpgrade: true.
  • packages/squad-cli/src/cli/core/workflows.ts, line 8: PROJECT_TYPE_SENSITIVE_WORKFLOWS.

Related: #201 (original init fix), #2047 (upgrade refreshing templates), #2361.

🤖 Generated with Claude Code

Lingua principale
TypeScript
Stelle
3.4k
Fork
516
Merge medio
1g 15h
PR unite (30g)
116

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di github/squad

Tutte le issue di github/squad

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.