Skip to content

Conversation

@amrit110
Copy link
Member

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-checks CLI 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:

  • The Bash code in .github/workflows/fix-remote-pr.yml that waits for PR checks is replaced by a call to the new Python CLI command aieng-bot wait-checks, which handles check monitoring and outputs appropriate status messages based on exit codes.

New CLI command and supporting modules:

  • Added the wait-checks command 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.
  • Registered the new CLI command in the main CLI entrypoint (src/aieng_bot/_cli/main.py). [1] [2]

Core check waiter implementation:

  • Implemented the CheckWaiter class and related types (CheckStatus, WaitResult) in src/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.
  • Added an __init__.py to the check_waiter module to expose the new types for import.

Testing:

  • Added a test module stub for the check waiter functionality (tests/check_waiter/__init__.py).

@amrit110 amrit110 self-assigned this Dec 23, 2025
@amrit110 amrit110 added the refactor Refactor code structure label Dec 23, 2025
@amrit110 amrit110 merged commit cfdc117 into main Dec 23, 2025
9 checks passed
@amrit110 amrit110 deleted the add_check_waiter branch December 23, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactor code structure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants