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
+5
View File
@@ -60,6 +60,11 @@ def approved(number: str, run: Run, sleep: typing.Callable[[float], None] = time
return Failure(f"pull request {number} wasn't approved within {WAIT_SECONDS // 60} minutes; run chunk-pr merge again once it is")
def left_to_park(number: str, run: Run) -> Failure:
"""Why a merge under PARKS ends at once where pull request number passed its checks and awaits an approval, in place of waiting as `approved` does: a reviewer's comment waits for an answer, which the worker gives first, or else do-epic parks the chunk, so the worker ends its run."""
return unanswered(number, run) or Failure(f"pull request {number} passed its checks and awaits an approval; end your run now, since do-epic parks the chunk and resumes this session once it is approved or a reviewer comments")
def unanswered(number: str, run: Run) -> Failure | None:
"""A Failure naming the files where a reviewer's comment waits for an answer on pull request number, as `waiting_threads` finds them, or saying why they cannot be read. None where no thread waits."""
waiting = waiting_threads(number, run)