Sort the imports, type the check reads and cite the working rule by its whole lead

This commit is contained in:
2026-11-18 23:19:41 +01:00
parent 117c698f65
commit 2dcf93a55f
10 changed files with 18 additions and 15 deletions
+2 -1
View File
@@ -117,11 +117,12 @@ def checks_passed(forge: Forge, number: str, head: str, required: set[str], run:
sleep(POLL_SECONDS)
return None
polls = WAIT_SECONDS // POLL_SECONDS
now: Pending | Failure | None = None
for poll in range(polls + 1):
now = checks_now(forge, number, head, required, run, settled=poll * POLL_SECONDS >= settle)
if not isinstance(now, Pending):
return now
if poll < polls:
sleep(POLL_SECONDS)
waited_on = f"{', '.join(now.missing)}, which the protection requires, never passed" if now.missing else "a check is still pending"
waited_on = f"{', '.join(now.missing)}, which the protection requires, never passed" if isinstance(now, Pending) and now.missing else "a check is still pending"
return Failure(f"gave up on pull request {number} after {WAIT_SECONDS // 60} minutes: {waited_on}")