feat/issue31-milestones-overview
main
新增 teai milestones(不帶 --repo)輸出跨倉庫 open 里程碑總覽,對應 gitea.py milestones(管理者巡邏,agents AGENTS.md 10.1),補上 #30 檢查結論指出的唯一缺口。帶 --repo 時維持現行單倉庫 list 語義不變。
teai milestones
--repo
gitea.py milestones
list
internal/workflow/milestones.go
MilestoneOverview
MilestoneSource
(due_on is None, due_on)
overdue
due_hours
unassigned
author
updated_at
MilestoneEntry
MarshalJSON
internal/workflow/giteaapi.go
APIClient
OpenMilestones
state=open
MilestoneOpenIssues
milestones=<title>
type=issues
_milestone_open_issues
internal/cli
runMilestones
[]
在 alterminal/test 建臨時資料實測(逾期/未到期/無期限三里程碑+未分派 issue+未分派 PR,已完成清理):
due_hours: 61.3
overdue: true
teai milestones --repo a/b
teai milestones list --repo a/b
測試:go test ./... -count=1 全綠(新增 workflow 4 例+CLI 5 例)、go vet 通過。
go test ./... -count=1
go vet
關聯 #31。
- teai milestones(不帶 --repo)輸出跨所屬組織各倉庫 open 里程碑概況, 對應 gitea.py milestones(管理者巡邏,agents AGENTS.md 10.1): 欄位 repo/id/title/url/open_issues/closed_issues/due_on/due_hours/ overdue/unassigned/updated_at,排序期限近者在前、無期限最後。 - internal/workflow.MilestoneOverview:判定核心(Source 注入、離線可測); MilestoneEntry 自訂 MarshalJSON,鍵集鍵序與 gitea.py 全等 (null 表示、due_hours 定點一位、unassigned PR 條目帶 author)。 - internal/workflow.APIClient 增 OpenMilestones/MilestoneOpenIssues (issues 端點刻意不帶 type=issues,PR 條目保留供覆蓋檢查,同 gitea.py)。 - milestones --repo a/b 維持現行單倉庫 list 語義不變。 - 空清單輸出 [](gitea.py 無輸出;#26 慣例差異,README 已文件化)。 - 交叉驗證:同帳號同時跑 gitea.py milestones 與 teai milestones, 含逾期/未到期/無期限里程碑與未分派 issue/PR 條目,輸出位元組全等。
已核准並合併。驗證記錄:程式碼對照 gitea.py list_milestone_overview 逐項核對無誤;alterminal/test 實測(逾期/未到期/無期限三里程碑+未分派 issue+未分派 PR)輸出位元組全等,含 PR 條目 author 鍵、overdue 未捨入判定、排序;teai milestones --repo 與 milestones list 輸出相同、未知子命令 exit 2;go vet/go test 全綠。臨時資料已清理。#31 已關閉。
No dependencies set.
The note is not visible to the blocked user.
摘要
新增
teai milestones(不帶--repo)輸出跨倉庫 open 里程碑總覽,對應gitea.py milestones(管理者巡邏,agents AGENTS.md 10.1),補上 #30 檢查結論指出的唯一缺口。帶--repo時維持現行單倉庫list語義不變。實作
internal/workflow/milestones.go:MilestoneOverview判定核心(MilestoneSource注入、離線可測);排序鍵(due_on is None, due_on)=期限近者在前、無期限最後;overdue以未捨入值判定(due_hours輸出才捨入一位小數);unassigned收 open 條目(issue+PR)中無 assignee 者,PR 帶author;updated_at取里程碑與條目最大值。MilestoneEntry自訂MarshalJSON,鍵集鍵序與 gitea.py 完全一致。internal/workflow/giteaapi.go:APIClient增OpenMilestones(state=open)與MilestoneOpenIssues(milestones=<title>;刻意不帶type=issues,PR 條目保留供覆蓋檢查,同 gitea.py_milestone_open_issues)。internal/cli:runMilestones分流——不帶參數→總覽;旗標開頭且帶--repo→整串轉發既有 list;未知子命令→exit 2。[](gitea.py 無輸出;#26 慣例,README 已知差異清單已補)。驗收(#31 條件:同帳號同時跑兩者,項目集合與欄位一致)
在 alterminal/test 建臨時資料實測(逾期/未到期/無期限三里程碑+未分派 issue+未分派 PR,已完成清理):
gitea.py milestones與teai milestones輸出 diff 位元組全等(含 PR 條目的author鍵、due_hours: 61.3、overdue: true、排序)。[](#26 慣例差異,已文件化)。teai milestones --repo a/b與teai milestones list --repo a/b輸出相同(單倉庫語義不變)。測試:
go test ./... -count=1全綠(新增 workflow 4 例+CLI 5 例)、go vet通過。關聯 #31。
已核准並合併。驗證記錄:程式碼對照 gitea.py list_milestone_overview 逐項核對無誤;alterminal/test 實測(逾期/未到期/無期限三里程碑+未分派 issue+未分派 PR)輸出位元組全等,含 PR 條目 author 鍵、overdue 未捨入判定、排序;teai milestones --repo 與 milestones list 輸出相同、未知子命令 exit 2;go vet/go test 全綠。臨時資料已清理。#31 已關閉。