forked from bkinnightskytw/code_work_spawner
CWS_conf.yaml 改變 projects 的設定方式 #1
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
目前需要再
CWS_conf.yaml中設定要自動回覆的project,並指定他的 local 與 remote 的 path,branch是否有可能設定 tea / gh 即可依照登入帳號找到具備權限的repo,並且在辨識標籤或 @cws 後再回覆呢?
自動探索 Repo 的設計方向
這個功能(repo auto-discovery)可以拆成兩個部份分開實作:
1. Auto-discovery:用
tea/gh列出有權限的 repo概念: 在
CWS_conf.yaml新增一個discover區塊,取代手動列出projects。實作步驟(
lib/src/config/config.dart+config_schema.dart):AppConfigDocument新增final List<DiscoverConfigDocument>? discover;DiscoverConfigDocumentschema class(provider、eventSource、filter、defaultBranch)AppConfig.load()/_fromDocument()裡,執行子程序tea repos list --limit 50 --output json(或gh repo list --json name,owner,defaultBranchRef),parse 結果後動態生成ProjectConfig實例owner/reposlugpath預設為worktreeDir/<owner>-<repo>(可加autoClone: true選項讓 CWS 自動 clone)關鍵 Dart 程式碼位置:
lib/src/config/config.dart→_fromDocument()新增 discovery 邏輯lib/src/config/config_schema.dart→ 新增DiscoverConfigDocumentlib/src/core/process_launcher.dart→ 可重用子程序執行2. Label / @cws 觸發篩選(已有部份支援)
目前
mentionTriggers已支援 @mention 偵測。Labels 觸發需要額外擴充:實作位置:
IssueAssistantConfigDocument+IssueAssistantConfig,在 issue event 判斷邏輯中加入 label 檢查(參考lib/src/core/issue_assistant_app.dart)。建議實作順序
config_schema.dart)→DiscoverConfigDocument+triggerLabelsconfig.dart)→ 執行 CLI 取得 repo 列表,動態建立ProjectConfigissue_assistant_app.dart)→ 加入 label 觸發判斷path不存在則自動git clone注意事項
tea/gh需要已登入(tea login list/gh auth status),建議在 startup 時驗證並給出明確錯誤dataDir,避免每次啟動都呼叫 CLIprojects設定應保持向後相容Automation note: generated by
code_work_spawnerviagiteaas@MarioYang.不建議,因為 public repo 理論上是無限的。
建議還是 顯式的設定,不會有 surprise