subtask 指派了人就一定要寫下一步——不然新子票一開出來就是「棒子沒有下一步」
實跑 ticket mine 時自己抓到:剛用 subtask 開的 #143 顯示 「❌ 沒有人寫下一步」——工具自己造出了它要消滅的那個狀態。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+12
-1
@@ -409,7 +409,8 @@ def cmd_subtask(argv):
|
||||
"""
|
||||
if len(argv) < 1:
|
||||
die("用法:ticket subtask <母票 owner/repo#N> --title \"<User Story>\" -F <內文檔>\n"
|
||||
" [--repo <收件 repo,預設跟母票同一個>] [--assign <誰做>] [--label <s/xxx,預設 s/todo>]")
|
||||
" [--repo <收件 repo,預設跟母票同一個>] [--label <s/xxx,預設 s/todo>]\n"
|
||||
" [--assign <誰做> --next \"<他第一件事要做什麼>\"] ← 指派了就一定要寫下一步")
|
||||
powner, prepo, pnum = parse_ref(argv[0])
|
||||
|
||||
def opt(name, default=None):
|
||||
@@ -432,6 +433,12 @@ def cmd_subtask(argv):
|
||||
repo = opt("--repo", prepo)
|
||||
label = opt("--label", "s/todo")
|
||||
assign = opt("--assign")
|
||||
nxt = opt("--next")
|
||||
if assign and not nxt:
|
||||
die("🚫 指派了人卻沒寫 --next。\n"
|
||||
" **有人被指到這張票,他撈到它的第一件事就是問「所以我要做什麼」**——\n"
|
||||
" 那句話現在就要寫下來,不是等他重讀整串。\n"
|
||||
" (沒有要指派給誰就不要加 --assign,那張票會留在票池等人領。)")
|
||||
|
||||
body = (f"Parent: {powner}/{prepo}#{pnum}\n"
|
||||
f"> 這張票是從母票的討論串裡長出來的一件事。\n"
|
||||
@@ -445,7 +452,11 @@ def cmd_subtask(argv):
|
||||
print(f" tag:{label}(它卡在哪一段)")
|
||||
if assign:
|
||||
api(f"/repos/{ORG}/{repo}/issues/{cnum}", {"assignees": [assign]}, method="PATCH")
|
||||
api(f"/repos/{ORG}/{repo}/issues/{cnum}/comments",
|
||||
{"body": f"{BATON_MARK} → `{assign}`\n\n**下一步**:{nxt}\n\n"
|
||||
f"(這張票是 `{powner}/{prepo}#{pnum}` 的相依——它沒關,母票關不掉)"})
|
||||
print(f" 指派:{assign}(誰該動)")
|
||||
print(f" 下一步:{nxt}")
|
||||
|
||||
# 🔴 相依掛不上去 = 這張子票對母票是隱形的 ⇒ 整個動作算失敗,要讓人看到
|
||||
api(f"/repos/{powner}/{prepo}/issues/{pnum}/dependencies",
|
||||
|
||||
Reference in New Issue
Block a user