下游做完時頂層跟著關(inkstone/ISEP#92)
票上的病:「開在頂層的票,下游做完了卻沒人回來關⋯⋯頂層票會永遠掛著, 而 leo 是看頂層的。」缺的三格是 journey 標籤、雙向連結的強制、完工回寫。 不重造既有的(票上明列):`ticket where` 戳記+側門閘(查票防重複)、 `comment-carries-task-guard`(留言藏任務)、Gitea 原生 issue dependency (跨 repo 關聯的載體)——這一版全部長在它們上面。 四格,判準全部是機械事實(相依邊在不在、state 是什麼),沒有一格在猜文字: ① 雙向連結(驗收 1):`subtask`/新別名 `handoff` 一個動作同時掛原生相依 + 在頂層票的時間軸貼一則指回下游的留言。相依邊只長在側欄, 時間軸上什麼都沒有,跨 repo 時尤其看不出來。 ② 完工回寫(驗收 2,最痛的那格):`ticket close` 關完子票立刻問 `/blocks` (誰在等我),對每張還開著的頂層票貼回寫留言;下游全關的那一張再 指派回總管+改 s/review。**不自動關母票**——關票要有交付物、要有人看過, 默默關掉跟默默留著是同一個病的兩面。 ③ journey 標籤:`--journey <名>` 把 `j/<名>` 同時貼在母子兩端(只貼一端就 聚不起來)。標籤不存在就擋下並指回 labels.yaml——要求標籤在場, 不是猜哪些名字合法。labels.yaml 的 `j/` 段刻意留空:旅程怎麼切、叫什麼 名字是方向題,不由工具代決。 ④ 撈得出來(驗收 3、4):新動詞 `ticket loose` 掃 org 的 open 票,撈 「有下游相依、下游全關、自己還開著」的頂層票。這是 ② 的補網—— 關票的側門(直接 PATCH state=closed)是刻意放行的,漏掉的由這張網撈回來。 不是輪詢,掛在開場/收工對帳跑一次。 實跑(2026-08-28,唯讀,沒動任何票):245 張 open 票裡 17 張有下游相依, 其中 2 張是「下游都關了、自己還開著」——inkstone/arcrun-rag#136(已 s/review 且指派給 claude-code,正在被處理)與 inkstone/Arcrun#100(沒標籤、沒指派, 就是票上講的那種「永遠掛著」)。 測試:scripts/test-ticket-handoff-writeback.sh,49 條全綠,全程離線 (會打 API 的兩段把 api() 換成錄音機,不開票不關票不留測試票)。 回歸:A13 17/17、A4 24/24、A12 11/11 皆綠。 文件:docs/TESTING.md 新增 A16。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ZBu4Sa1cGntKFRBYNZ6xs
This commit is contained in:
+295
-6
@@ -21,8 +21,10 @@ leo 2026-08-16 三句話,本工具就是它們的機械化:
|
||||
三個 Gitea 原生欄位(leo 2026-08-27「這些全部都要」,缺一個就會掉棒):
|
||||
|
||||
ticket subtask <母票> --title <US> -F <檔> 討論串裡的一件事 → 看得見的子票+相依
|
||||
ticket handoff <頂層票> --to <repo> … 同一個動作,換個名字:頂層 → 下游 repo
|
||||
ticket handback <票> --to <誰> --next <一句> 收工=指派+改 tag+寫下一步,一個動作
|
||||
ticket mine [--user <誰>] 撈一次:棒子在誰手上、每根下一步是什麼
|
||||
ticket loose 撈一次:下游都關了、自己還開著的頂層票
|
||||
|
||||
票的寫法:`owner/repo#N`,例:`inkstone/InkStoneCo#44`
|
||||
"""
|
||||
@@ -452,10 +454,87 @@ def cmd_close(argv):
|
||||
|
||||
if deliv:
|
||||
api(f"/repos/{owner}/{repo}/issues/{num}/comments",
|
||||
{"body": f"{os.environ.get('ISEP_IDENTITY') or f'【身份】總管/{owner}/{repo}/-'}\n\n✅ 結案。交付物:{deliv}"})
|
||||
{"body": f"{_identity(owner, repo)}\n\n✅ 結案。交付物:{deliv}"})
|
||||
api(f"/repos/{owner}/{repo}/issues/{num}", {"state": "closed"}, method="PATCH")
|
||||
print(f"✅ {owner}/{repo}#{num} 已關(交付物:{deliv or ('PR' if has_pr else '票上回報')})")
|
||||
|
||||
# ── 完工回寫(inkstone/ISEP#92 最痛的那一格)─────────────────────────
|
||||
# 關掉一張下游票之後,**同一個動作**回頭處理它的頂層票。
|
||||
# 不做這件事的後果票上寫得很清楚:「頂層票會永遠掛著,而 leo 是看頂層的」。
|
||||
_writeback(owner, repo, num, deliv or ("PR" if has_pr else "票上回報"))
|
||||
|
||||
|
||||
def _writeback(owner, repo, num, deliv):
|
||||
"""子票關掉 → 回頭處理每一張在等它的頂層票。
|
||||
|
||||
🔴 失敗要吵。回寫悄悄失敗 = 這格等於沒做,而沒有人會發現
|
||||
(那正是本票在治的病)。所以任何一張處理失敗就非零離開。
|
||||
"""
|
||||
child = f"{owner}/{repo}#{num}"
|
||||
try:
|
||||
parents = _blocks(owner, repo, num)
|
||||
except SystemExit:
|
||||
print(f"\n⚠️ 撈不到 {child} 的頂層票(/blocks 讀失敗)——"
|
||||
f"回寫這一格**沒有做**,請手動確認或跑 `ticket loose`", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if not parents:
|
||||
print("\n📌 這張票沒有任何頂層票在等它(沒有相依邊)⇒ 不需要回寫。")
|
||||
return
|
||||
|
||||
print(f"\n🔗 有 {len(parents)} 張頂層票在等這張票,逐一回寫:")
|
||||
failed = []
|
||||
for pt in parents:
|
||||
pfull = pt["repository"]["full_name"]
|
||||
po, pr = pfull.split("/")
|
||||
pn = pt["number"]
|
||||
try:
|
||||
pdeps = _deps(po, pr, pn)
|
||||
action, open_left = writeback_plan(pt.get("state"), pdeps)
|
||||
|
||||
if action == "skip":
|
||||
print(f" · {pfull}#{pn} 已經是 closed ⇒ 不動")
|
||||
continue
|
||||
|
||||
lines = [_identity(po, pr), "",
|
||||
f"⬇️ **下游完工回寫**:`{child}` 已關(交付物:{deliv})"]
|
||||
if open_left:
|
||||
lines += ["", f"這張票還在等 {len(open_left)} 張下游(都關了才輪到它):"]
|
||||
lines += [f"- ◻ {i['repository']['full_name']}#{i['number']} {i['title'][:60]}"
|
||||
for i in open_left]
|
||||
lines += ["", "⇒ 本票維持原狀,不要當成可以收了。"]
|
||||
else:
|
||||
lines += ["", "**這是最後一張下游——本票的下游已經全部關閉。**", "",
|
||||
f"{BATON_MARK} → `{HANDBACK_TO}`", "",
|
||||
"**下一步**:驗一次頂層要的東西真的到齊了,到齊就 "
|
||||
f"`ticket close {pfull}#{pn} --deliverable <URL>`;"
|
||||
"沒到齊就開下一張下游票,不要把它留在原地。", "",
|
||||
"(本則由 `ticket close` 的完工回寫自動貼上,"
|
||||
"機制見 `inkstone/ISEP#92`)"]
|
||||
api(f"/repos/{po}/{pr}/issues/{pn}/comments", {"body": "\n".join(lines)})
|
||||
|
||||
if action == "handback":
|
||||
# 指派 + 改 tag:**欄位**才撈得到,留言撈不到。
|
||||
# 08-26 那次掉棒就是話有說、欄位沒動,棒子躺在地上 14 小時。
|
||||
api(f"/repos/{po}/{pr}/issues/{pn}",
|
||||
{"assignees": [HANDBACK_TO]}, method="PATCH")
|
||||
cur = [l["name"] for l in (pt.get("labels") or [])]
|
||||
keep = [n for n in cur if not n.startswith("s/")] + ["s/review"]
|
||||
_set_labels(po, pr, pn, keep)
|
||||
print(f" · {pfull}#{pn} 下游全關 ⇒ 已指派 {HANDBACK_TO}+s/review(等人驗)")
|
||||
else:
|
||||
print(f" · {pfull}#{pn} 還有 {len(open_left)} 張下游沒關 ⇒ 只記一筆")
|
||||
except SystemExit:
|
||||
failed.append(f"{pfull}#{pn}")
|
||||
except Exception as e:
|
||||
failed.append(f"{pfull}#{pn}({e})")
|
||||
|
||||
if failed:
|
||||
print(f"\n⚠️ 這幾張頂層票**沒有回寫成功**:{'、'.join(failed)}\n"
|
||||
f" 回寫失敗要吵——悄悄失敗等於這格沒做。手動補,或稍後跑 `ticket loose` 對帳。",
|
||||
file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
|
||||
# ── decide ───────────────────────────────────────────────────────────────
|
||||
@@ -526,6 +605,10 @@ def cmd_decide(argv):
|
||||
|
||||
BATON_MARK = "🏃 **棒子交回**"
|
||||
|
||||
# 棒子的預設終點:總管。**這是 Gitea 的 assignee 欄位,不是一句話**——
|
||||
# 撈「指派給你的」一頁就看得到,撈留言看不到。
|
||||
HANDBACK_TO = os.environ.get("ISEP_HANDBACK_TO") or "claude-code"
|
||||
|
||||
|
||||
def _labels_of(owner, repo):
|
||||
return {l["name"]: l["id"] for l in api(f"/repos/{owner}/{repo}/labels?limit=100")}
|
||||
@@ -545,6 +628,97 @@ def _deps(owner, repo, num):
|
||||
return api(f"/repos/{owner}/{repo}/issues/{num}/dependencies") or []
|
||||
|
||||
|
||||
def _blocks(owner, repo, num):
|
||||
"""反方向:**誰把這張票當相依**——也就是這張票的頂層票(可能不只一張、可能跨 repo)。
|
||||
|
||||
Gitea 原生兩個端點是同一條邊的兩端,方向不可混淆:
|
||||
/issues/<N>/dependencies 這張票在等誰 → 它的下游
|
||||
/issues/<N>/blocks 誰在等這張票 → 它的頂層
|
||||
`subtask` POST 的是**母票的 dependencies**,所以子票這端看到的是 `blocks`。
|
||||
"""
|
||||
return api(f"/repos/{owner}/{repo}/issues/{num}/blocks") or []
|
||||
|
||||
|
||||
def _identity(owner, repo):
|
||||
"""票上的每一則留言第一行要表明身份(規約見 docs/governance/dispatch-and-reply-format.md §3)。
|
||||
|
||||
機器自動貼的留言同樣要標——不標的話,回寫留言看起來像某個人寫的,
|
||||
而下一個讀票的人會去找那個人。
|
||||
"""
|
||||
return os.environ.get("ISEP_IDENTITY") or f"【身份】總管/{owner}/{repo}/-"
|
||||
|
||||
|
||||
# ══════════════════════════════════════════════════════════════════════════
|
||||
# inkstone/ISEP#92 — 「下游做完時頂層跟著關」的三格
|
||||
#
|
||||
# 票上的原話:「開在頂層的票,下游做完了卻沒人回來關⋯⋯頂層票會永遠掛著,
|
||||
# 而 leo 是看頂層的。」
|
||||
#
|
||||
# 缺的三格,各由下面一段承接:
|
||||
# ① 雙向連結的強制 → cmd_subtask 一個動作同時掛相依 + 在母票留下指回來的留言
|
||||
# ② journey 標籤 → journey_label()(對不上就不貼,不硬湊)
|
||||
# ③ 完工回寫 → writeback_plan() + cmd_close 關完子票立刻回頭處理母票
|
||||
# ④ 撈得出來 → is_loose() + cmd_loose(③ 走側門漏掉的,這張網補回來)
|
||||
#
|
||||
# 🔴 這四格的判準**全部是機械事實**(相依邊在不在、state 是什麼),
|
||||
# 沒有一格在猜文字。leo 2026-08-17 已證偽關鍵字黑名單那條路
|
||||
# (8 次誤攔、0 次正確攔截)。
|
||||
# ══════════════════════════════════════════════════════════════════════════
|
||||
|
||||
JOURNEY_PREFIX = "j/"
|
||||
|
||||
|
||||
def journey_label(name):
|
||||
"""`--journey 收件匣` → `j/收件匣`。只加前綴,不做語意判斷。
|
||||
|
||||
標籤存不存在由 `_set_labels` 去問 Gitea(不存在就擋,並指回 labels.yaml)——
|
||||
**「要求某個東西在場」,不是「猜哪些名字合法」**。
|
||||
⇒ 新的一條旅程要先加進 labels.yaml 再 sync,這是刻意的:
|
||||
journey 是**跨票聚類的軸**,隨手造名字會讓同一條旅程長出三個拼法。
|
||||
"""
|
||||
n = (name or "").strip()
|
||||
if not n:
|
||||
die("🚫 --journey 後面要接旅程名(例:--journey 收件匣)。\n"
|
||||
" 對不上任何旅程就**不要加這個參數**——票上明講不硬湊。")
|
||||
return n if n.startswith(JOURNEY_PREFIX) else JOURNEY_PREFIX + n
|
||||
|
||||
|
||||
def is_loose(state, deps):
|
||||
"""這張票是不是「下游都關了、自己還開著」的頂層票。
|
||||
|
||||
純函式(不打網路)⇒ 判準本身測得動,不必開真的票來驗。
|
||||
|
||||
三個條件缺一不可:
|
||||
· 自己還 open 關掉的票不用管
|
||||
· 曾經有下游 沒有相依邊 ⇒ 它根本不是頂層票,不要拿它來吵
|
||||
· 沒有任何 open 下游 有一張還開著就還在跑,不是掉在地上
|
||||
"""
|
||||
if state != "open":
|
||||
return False
|
||||
if not deps:
|
||||
return False
|
||||
return not any(d.get("state") == "open" for d in deps)
|
||||
|
||||
|
||||
def writeback_plan(parent_state, parent_deps):
|
||||
"""下游關掉之後,它的頂層票該被怎麼處理。**只回計畫,不做副作用**⇒ 離線測得動。
|
||||
|
||||
回 (動作, 還開著的下游):
|
||||
"skip" 頂層票自己已經關了 ⇒ 沒事
|
||||
"note" 還有別的下游沒關 ⇒ 只在頂層票記一筆,別假裝它可以收了
|
||||
"handback" 下游全關了 ⇒ 這張票現在**只等人驗**:
|
||||
指派回總管 + s/review,讓它出現在「指派給你的」
|
||||
|
||||
🔴 為什麼不自動關母票:關票要有交付物、要有人看過(`ticket close` 的既有閘)。
|
||||
票上要的是「不能默默留著」,不是「自動消失」——
|
||||
默默關掉跟默默留著是同一個病的兩面。
|
||||
"""
|
||||
open_left = [d for d in (parent_deps or []) if d.get("state") == "open"]
|
||||
if parent_state != "open":
|
||||
return "skip", open_left
|
||||
return ("note" if open_left else "handback"), open_left
|
||||
|
||||
|
||||
# ── subtask ──────────────────────────────────────────────────────────────
|
||||
def cmd_subtask(argv):
|
||||
"""把「討論串裡的一件事」長成看得見的子票,並掛成母票的 Gitea 原生相依。
|
||||
@@ -565,7 +739,9 @@ def cmd_subtask(argv):
|
||||
if len(argv) < 1:
|
||||
die("用法:ticket subtask <母票 owner/repo#N> --title \"<User Story>\" -F <內文檔>\n"
|
||||
" [--repo <收件 repo,預設跟母票同一個>] [--label <s/xxx,預設 s/todo>]\n"
|
||||
" [--assign <誰做> --next \"<他第一件事要做什麼>\"] ← 指派了就一定要寫下一步")
|
||||
" [--journey <旅程名>] ← 這件事服務哪條使用者旅程(對不上就不要加)\n"
|
||||
" [--assign <誰做> --next \"<他第一件事要做什麼>\"] ← 指派了就一定要寫下一步\n"
|
||||
"\n(`ticket handoff` 是同一個動作的別名:頂層票 → 下游 repo)")
|
||||
powner, prepo, pnum = parse_ref(argv[0])
|
||||
|
||||
def opt(name, default=None):
|
||||
@@ -585,10 +761,13 @@ def cmd_subtask(argv):
|
||||
" leo 2026-08-27:『每個事情沒有歷史記錄才是大問題』,\n"
|
||||
" 而沒寫驗收條件的票,關掉之後就沒有歷史,只剩一個關字)")
|
||||
|
||||
repo = opt("--repo", prepo)
|
||||
# `--to <repo>` 是 `ticket handoff` 那個名字底下比較自然的講法,同一個東西。
|
||||
# (handback 的 `--to` 是「交給誰」,subtask 沒有那個參數,不會撞。)
|
||||
repo = opt("--repo", opt("--to", prepo))
|
||||
label = opt("--label", "s/todo")
|
||||
assign = opt("--assign")
|
||||
nxt = opt("--next")
|
||||
jlabel = journey_label(opt("--journey")) if "--journey" in argv else None
|
||||
if assign and not nxt:
|
||||
die("🚫 指派了人卻沒寫 --next。\n"
|
||||
" **有人被指到這張票,他撈到它的第一件事就是問「所以我要做什麼」**——\n"
|
||||
@@ -597,7 +776,8 @@ def cmd_subtask(argv):
|
||||
|
||||
body = (f"Parent: {powner}/{prepo}#{pnum}\n"
|
||||
f"> 這張票是從母票的討論串裡長出來的一件事。\n"
|
||||
f"> **它沒關,母票關不掉**(Gitea 原生相依,實測 412 硬擋)。\n\n") + body
|
||||
f"> **它沒關,母票關不掉**(Gitea 原生相依,實測 412 硬擋)。\n"
|
||||
f"> **它關掉時,母票會收到一則回寫**(`ticket close` 自動做,見 `inkstone/ISEP#92`)。\n\n") + body
|
||||
|
||||
d = api(f"/repos/{ORG}/{repo}/issues", {"title": title, "body": body})
|
||||
cnum = d["number"]
|
||||
@@ -619,6 +799,38 @@ def cmd_subtask(argv):
|
||||
deps = _deps(powner, prepo, pnum)
|
||||
openn = [i for i in deps if i["state"] == "open"]
|
||||
print(f" 相依:已掛上 {powner}/{prepo}#{pnum}(它存在、且擋著母票)")
|
||||
|
||||
# 🔴 雙向連結:相依邊只長在 Gitea 的側欄,**母票的時間軸上什麼都沒有**。
|
||||
# 票上的原話:「頂層票寫了『轉去某個 repo』,但那邊的票沒有指回來,
|
||||
# 從下游那張票看不出它從哪來,脈絡就斷了。」
|
||||
# ⇒ 兩端各留一個看得見的指標:子票內文的 `Parent:`(上面),母票時間軸的這一則。
|
||||
# 跨 repo 時尤其重要——側欄的相依很容易被當成同 repo 的東西。
|
||||
plines = [_identity(powner, prepo), "",
|
||||
f"➡️ **已轉往下游**:`{ORG}/{repo}#{cnum}` {title}", "",
|
||||
f"{d['html_url']}", "",
|
||||
f"- 收件 repo:`{ORG}/{repo}` tag:`{label}`"
|
||||
+ (f" 旅程:`{jlabel}`" if jlabel else "")
|
||||
+ (f" 指派:`{assign}`" if assign else " (還沒指派,留在票池等人領)")]
|
||||
if jlabel is None:
|
||||
plines += ["- 旅程:**沒有貼**(開票時判定對不上任何一條,不硬湊)"]
|
||||
plines += ["",
|
||||
"**這張頂層票不會因為轉出去就自動關**——下游那張關掉時,"
|
||||
"`ticket close` 會回頭在這裡貼一則回寫;"
|
||||
"全部下游關完,這張票會被指派回總管等驗。(機制:`inkstone/ISEP#92`)"]
|
||||
api(f"/repos/{powner}/{prepo}/issues/{pnum}/comments", {"body": "\n".join(plines)})
|
||||
print(f" 回指:已在母票 {powner}/{prepo}#{pnum} 的時間軸貼上指向子票的留言")
|
||||
|
||||
# journey 標籤:兩端都貼,聚類才聚得起來(只貼一端=撈不到另一端)
|
||||
if jlabel:
|
||||
_set_labels(ORG, repo, cnum, [label, jlabel])
|
||||
pcur = [l["name"] for l in (api(f"/repos/{powner}/{prepo}/issues/{pnum}")
|
||||
.get("labels") or [])]
|
||||
if jlabel not in pcur:
|
||||
_set_labels(powner, prepo, pnum, pcur + [jlabel])
|
||||
print(f" 旅程:`{jlabel}`(母子兩端都貼——只貼一端就聚不起來)")
|
||||
else:
|
||||
print(" 旅程:沒有貼(沒給 --journey)。對得上就補一次:"
|
||||
f"`ticket subtask … --journey <旅程名>`;對不上就不要硬湊。")
|
||||
print(f"\n📌 母票 {powner}/{prepo}#{pnum} 目前有 {len(openn)} 張未關的相依:")
|
||||
for i in deps:
|
||||
mark = "◻" if i["state"] == "open" else "☑"
|
||||
@@ -747,9 +959,86 @@ def _last_next(owner, repo, num):
|
||||
return None
|
||||
|
||||
|
||||
# ── loose ────────────────────────────────────────────────────────────────
|
||||
def cmd_loose(argv):
|
||||
"""撈一次:**下游都關了、自己還開著**的頂層票。
|
||||
|
||||
票上的驗收條件第 3、4 條(`inkstone/ISEP#92`):
|
||||
「撈一次『已經沒有 open 下游票、但自己還開著的頂層票』→ 要撈得出來(現在撈不出來)」
|
||||
「拿現有的頂層票跑一次 → 要能指出哪幾張是這種情況」
|
||||
|
||||
這是 `ticket close` 自動回寫的**補網**:回寫只在走正門(`ticket close`)時發生,
|
||||
而關票的側門(直接 PATCH `state=closed`)是刻意放行的
|
||||
(見 `hooks/ticket-api-bypass-guard.sh`:「帶了 ID 的子路徑」一律放行)。
|
||||
⇒ 側門漏掉的,由這張網撈回來。**不是輪詢**——掛在開場/收工對帳跑一次。
|
||||
"""
|
||||
def opt(name, default=None):
|
||||
return argv[argv.index(name) + 1] if name in argv else default
|
||||
|
||||
org = opt("--org", ORG)
|
||||
only = opt("--repo")
|
||||
|
||||
print(f"🔎 掃 `{org}` 的 open 票,找「下游都關了、自己還開著」的頂層票"
|
||||
+ (f"(只看 {only})" if only else "") + " …")
|
||||
|
||||
items, page = [], 1
|
||||
while page <= 12:
|
||||
q = urllib.parse.urlencode({"state": "open", "type": "issues",
|
||||
"limit": 50, "page": page, "owner": org})
|
||||
got = api(f"/repos/issues/search?{q}") or []
|
||||
if not got:
|
||||
break
|
||||
items += got
|
||||
page += 1
|
||||
if only:
|
||||
items = [i for i in items if i["repository"]["full_name"].split("/")[-1] == only]
|
||||
print(f" open 票 {len(items)} 張,逐張問它的下游 …")
|
||||
|
||||
def probe(it):
|
||||
full = it["repository"]["full_name"]
|
||||
o, r = full.split("/")
|
||||
try:
|
||||
deps = _deps(o, r, it["number"])
|
||||
except SystemExit:
|
||||
return None # 讀不到 ≠ 沒有下游;寧可漏報也不要編一筆出來
|
||||
except Exception:
|
||||
return None
|
||||
return (full, it, deps)
|
||||
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
with ThreadPoolExecutor(max_workers=12) as ex:
|
||||
probed = [x for x in ex.map(probe, items) if x]
|
||||
|
||||
parents = [x for x in probed if x[2]]
|
||||
loose = [x for x in parents if is_loose("open", x[2])]
|
||||
|
||||
print(f"\n 有下游相依的頂層票:{len(parents)} 張")
|
||||
print(f" 其中「下游都關了、自己還開著」:**{len(loose)} 張**\n")
|
||||
|
||||
if not loose:
|
||||
print("✅ 一張都沒有——每張頂層票都還有下游在跑,或已經跟著關了。")
|
||||
for full, it, deps in loose:
|
||||
n = it["number"]
|
||||
st = [l["name"] for l in it.get("labels") or []]
|
||||
who = [a["login"] for a in (it.get("assignees") or [])] or ["(沒有人)"]
|
||||
print(f" ● {full}#{n} {st} 指派:{'、'.join(who)}")
|
||||
print(f" {it['title'][:64]}")
|
||||
for d in deps:
|
||||
print(f" ☑ {d['repository']['full_name']}#{d['number']}"
|
||||
f" {d['title'][:52]}")
|
||||
print(f" → 驗過就關:ticket close {full}#{n} --deliverable <URL>")
|
||||
print(f" 還缺東西:ticket subtask {full}#{n} --title \"<US>\" -F <檔>")
|
||||
print()
|
||||
|
||||
print("📌 這張表撈的是**機械事實**(相依邊的 state),不是猜文字。")
|
||||
print(" 走 `ticket close` 關下游時會自動回寫、這張表就不會長;")
|
||||
print(" 會長出來的都是走側門關掉的那些。")
|
||||
return loose
|
||||
|
||||
|
||||
CMDS = {"where": cmd_where, "say": cmd_say, "new": cmd_new, "close": cmd_close,
|
||||
"decide": cmd_decide, "subtask": cmd_subtask, "handback": cmd_handback,
|
||||
"mine": cmd_mine}
|
||||
"decide": cmd_decide, "subtask": cmd_subtask, "handoff": cmd_subtask,
|
||||
"handback": cmd_handback, "mine": cmd_mine, "loose": cmd_loose}
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) < 2 or sys.argv[1] not in CMDS:
|
||||
|
||||
Reference in New Issue
Block a user