Skip to content

refactor(pr): wait for the monitor checks with gh pr checks --watch #7509

Not planned

Description

@dan-petty

Problem

Part of #7499. devops pr monitor and devops pr wait poll the merge-readiness verdict in their own loop (src/devops_cli/github/pr_monitor.py:646-713).

Change

  • Wait with gh pr checks <n> --watch --fail-fast --interval <s> under the timeout of the monitor, then read the verdict once.
  • Keep the settle time of the Copilot review and the map of exit codes.
  • In gh v2.106.0, --watch and --json exclude each other, and a head with no check exits 1 at once with no checks reported (pkg/cmd/pr/checks/checks.go). The monitor must still wait for a head with no check.
  • Use --required for the wait only if the verdict after the wait still judges all checks: on PR fix(repos): Keep live rules and stricter thresholds #7481, 3 of 29 checks were required.

Done when

  • The poll loop of pr_monitor.py is deleted.
  • A test proves the gh pr checks arguments and the map of the gh exit codes 0, 1 and 8 to the exit codes of the monitor.
  • The tests of the Copilot settle time and the exit-code map stay and pass.

Existing tool considered

GitHub CLI (https://github.com/cli/cli), MIT, v2.106.0: gh pr checks --watch --fail-fast --interval.

Source

Source: #7499

Activity

  1. added
    type/refactor
    source/agent
    status/new
    on Nov 28, 2026
  2. added
    value/medium
    effort/medium
    scope/pr
    on Nov 28, 2026
  3. dan-petty commented on Nov 28, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 28, 2026
  5. added
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 28, 2026
  6. dan-petty commented on Nov 28, 2026

    @dan-petty
    OwnerAuthor

    Closed as not planned (vetting of PR #7527, 2026-11-28). The slice does not replace custom code with gh, it adds a second wait beside the custom loop: source +129 / −27. The poll loop of monitor_pr stays for a head with no check, an active Copilot review, the settle time and the read-failure rule (#4838), because gh has no watch for these, and a may_watch flag now switches between the two waits. gh pr checks --watch itself reads the checks each interval, so it moves the same reads into gh, where the pacing ledger does not count them. So the slice adds code and hides requests, against the aim of #7499 (delete custom code that rebuilds what gh does). The verdict part of #7499 is done by #7508 (−400 lines); the remaining slices are #7510 and #7512.

  7. removed
    status/in-progress
    owner/agent
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/prsource/agenttype/refactorvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions