Park on a new review once requested changes are answered, never park a Gitea draft, and count a slot only for a window that started

This commit is contained in:
2026-11-18 23:53:28 +01:00
parent 0eea8aa10d
commit 89a7cfe65a
14 changed files with 219 additions and 71 deletions
+8 -5
View File
@@ -10,6 +10,8 @@ from failure import Failure
# Under the epic's folder, the folder that holds one file per parked chunk, named for its issue.
FOLDER = "parked"
# What a parked chunk awaits, in its window's name, once its worker has something to do but no running slot is free.
SLOT = "a slot"
@dataclasses.dataclass(frozen=True)
@@ -22,13 +24,14 @@ class Parked:
pull: str
# The ID of its worker's claude session, which `claude --resume` takes.
session: str
# What its pull request waits on, as the words after "awaits" (`gates.CHECKS`, `gates.APPROVAL`).
# What its pull request waits on, as the words after "awaits" (`gates.CHECKS`, `gates.APPROVAL`, `gates.NEW_REVIEW`).
on: str
@property
def waits(self) -> str:
"""Why the chunk doesn't run, for the human."""
return f"it is parked: its pull request #{self.pull} awaits {self.on}"
def waits(self, shown: str) -> str:
"""Why the chunk doesn't run, for the human. shown is what the name of its live window says it awaits, which is newer than the file's `on`; empty where no window lives."""
if shown == SLOT:
return f"it is parked: its worker has work again on pull request #{self.pull} and awaits {SLOT}"
return f"it is parked: its pull request #{self.pull} awaits {shown or self.on}"
def file_of(folder: pathlib.Path, issue: str) -> pathlib.Path: