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

未關閉 適合新手
#2,527 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
77/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
github-actions, typescript
領域
cli, devtools

研究方向

從 packages/squad-cli/src/cli/core/upgrade.ts 中的 collectSquadOwnedCandidates 開始,將其 workflow 選擇與 packages/squad-sdk/src/config/init.ts 中的允許清單 FRAMEWORK_WORKFLOWS 進行比較。使用 issue 中的 init 和 upgrade --dry-run 命令重現問題。完成標準是 upgrade 會更新已安裝的 workflow,但不會規劃建立其他 Squad workflow;檢查 workflow 已存在和不存在的兩種情況。

由索引模型根據 Issue 內容生成。

描述

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

主要語言
TypeScript
星號
3.4k
分支
516
平均合併
1 天 15 小時
30 天內合併 PR
116

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

github/squad 的其他 Issue

查看 github/squad 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。