Skip to content

fix(github): pr monitor judges each check by its latest run, so a cancelled run a newer one replaced does not fail the pr #1602

Closed

Description

@dan-petty

Friction

devops pr monitor reports a PR's checks as failed when an earlier run of a check was cancelled and a newer run of the same check passed, so the monitor exits 1 on a PR whose checks are all green, and the merge-readiness rule ("ready only when devops pr monitor exits 0") cannot be met.

Evidence

On PR #1599 (2026-10-16), pushing a commit started the Fail-to-Pass workflow, and editing the PR body a few seconds later started it again, cancelling the first runs (the workflow cancels in-progress runs on edited). The commit's check runs then held, per check name, a cancelled run started at 23:01:07Z and a successful run started at 23:01:38Z for both "Fail-to-Pass Check" and "Fail-to-Pass Self-Check". With every check's latest run successful, devops pr monitor 1599 printed "Fail-to-Pass ✗ CANCELLED" and "Fail-to-Pass Check ✗ CANCELLED", "Remote CI checks failed on PR #1599 (2 failing check(s))", and exited 1.

Remedy

Judge each check by its latest run for the head commit: group check runs by name (and workflow) and take the most recently started, so a run superseded by a newer one of the same check no longer counts. A cancelled run with no newer run of its check still fails. Test it with a fake check-runs listing holding a cancelled run and a later successful run of one check (monitor passes) and one holding only the cancelled run (monitor fails).

Activity

  1. added
    source/agent
    type/bug
    on Oct 16, 2026
  2. dan-petty commented on Oct 16, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Type: type/bug. The candidate describes a defect in the behavior of 'devops pr monitor'.
    • Priority: P1-High. The issue causes merge-readiness rules to fail incorrectly, blocking valid PRs from being merged.
    • Value: High. Fixing this improves CI reliability and prevents unnecessary merge delays for valid PRs.
    • Effort: Medium. Requires modifying how check runs are evaluated and adding tests to verify the fix.
  3. added a commit that references this issue on Oct 17, 2026
    559f6f0
  4. dan-petty commented on Oct 17, 2026

    @dan-petty
    OwnerAuthor

    What changed

    #1605, merged into release/v0.2.36 as 559f6f0.

    Closes #1602

    devops pr monitor failed PR #1599 although every check's latest run had passed. Editing the PR body re-triggered the Fail-to-Pass workflow, which cancels its in-progress run, so the head commit carried a cancelled run and a successful run of both "Fail-to-Pass Check" and "Fail-to-Pass Self-Check". The REST check-runs listing returns every check suite's runs, and filter=latest only collapses runs within a suite, so the monitor counted both cancellations and exited 1.

    3 file(s) changed.

    How it was verified

    Check runs at 1304059:

    • Prune PR DevContainer Images: pass
    • Audit Defect PR Hardening: skipping
    • devops-cli: pass
    • bandit: pass
    • CodeQL: pass
    • Dependency Freshness: skipping
    • Tests & Coverage: pass
    • Changed-Test Independence: pass
    • Rule Pack Tests: pass
    • Fail-to-Pass Self-Check: pass
    • Analyze (python): pass
    • Fail-to-Pass Check: pass
    • Analyze (actions): pass
    • Static Analysis: pass
    • Service Image: skipping
    • DevContainer Image: skipping

    No task file.

  5. added this to the v0.2.36 milestone on Oct 17, 2026
  6. added a commit that references this issue on Oct 17, 2026
    3dd7fa6
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

    source/agenttype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions