Clean up a do-epic chunk whose pull request merged without waiting for a running slot
CI / tests (pull_request) Successful in 5m24s

This commit is contained in:
2026-12-03 12:43:07 +01:00
parent fb1dd763e2
commit 5a31cc9607
9 changed files with 113 additions and 13 deletions
+3 -1
View File
@@ -38,6 +38,8 @@ class Open:
@dataclasses.dataclass(frozen=True)
class Unopened(Open):
"""An Open whose worktree stands though no pull request is open at its head: one that was merged or closed, whose chunk still has its worktree to remove."""
# The chunk's worktree.
worktree: str
@dataclasses.dataclass(frozen=True)
@@ -65,7 +67,7 @@ def gate(branch: str, checkout: str, at: typing.Callable[[str], Run], by_human:
forge = forge_of(origin)
pull = open_pull(forge, branch, head, run)
if not isinstance(pull, str):
return pull or Unopened(f"no pull request from origin's {branch} is open at {head[:12]}; it may be merged or closed already")
return pull or Unopened(f"no pull request from origin's {branch} is open at {head[:12]}; it may be merged or closed already", worktree)
decision = review_decision(forge, pull, head, run)
if not isinstance(decision, str):
return decision or Open(f"pull request #{pull} is a draft")