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.
This pull request refactors the workflow for waiting on GitHub PR checks before auto-merging, replacing a custom Bash loop with a dedicated Python CLI command for improved maintainability and testability. The main change is the introduction of a new
wait-checksCLI command, which encapsulates the logic for monitoring PR check status and provides clear exit codes for downstream automation. Supporting modules and tests have been added to enable this functionality.Workflow and CLI integration:
.github/workflows/fix-remote-pr.ymlthat waits for PR checks is replaced by a call to the new Python CLI commandaieng-bot wait-checks, which handles check monitoring and outputs appropriate status messages based on exit codes.New CLI command and supporting modules:
wait-checkscommand to the CLI (src/aieng_bot/_cli/commands/wait_checks.py), which waits for PR checks to complete, provides clear exit codes, and logs status messages for success, failure, timeout, or missing checks.src/aieng_bot/_cli/main.py). [1] [2]Core check waiter implementation:
CheckWaiterclass and related types (CheckStatus,WaitResult) insrc/aieng_bot/check_waiter/waiter.py, encapsulating the logic for querying PR check status via the GitHub CLI, analyzing results, and handling timeouts and error cases.__init__.pyto thecheck_waitermodule to expose the new types for import.Testing:
tests/check_waiter/__init__.py).