Repository navigation
pr-wait.py: wait for finished checks to settle before reporting - #31
Merged
Merged
Conversation
Right after a pull request is opened, GitHub can show only an earlier push run, already finished, before it adds the pull request's own run; pr-wait.py then reported "passed" too early. The result now counts only once the same finished checks have been seen for --settle seconds (default 30). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
pr-wait.pyreporting "passed" too early, right after a pull request is opened.The bug
In seed-forum#23 the workflow runs on both push and pull request. The push run had finished a few minutes before the pull request was opened. On its first look,
pr-wait.pysaw only that finished push run, because GitHub hadn't added the pull request's own run yet, and it exited 0 while the real run was about to start.The fix
A result now counts only once the same finished checks have been seen for
--settleseconds (default 30, new-soption). If a new run appears in that time, or a check changes, the wait carries on. This adds up to 30 seconds to every wait, which is small next to a CI run. If the timeout runs out while finished checks are settling, the message says so.Other changes
tests/test-pr-wait.sh: a regression check for this case (a finished run, then a new queued run, then both passed: exit 0 only after both), and a check that--settle 0is refused. The other checks pass a short settle time. 24 checks in all.--settle.Testing
Claude ran
tests/test-pr-wait.sh(all 24 pass), ShellCheck andflake8.Investigated and written by Claude on behalf of William Jacoby (bonelifer).
🤖 Generated with Claude Code