Skip to content

fix(pr): readiness counts a check run that a newer run replaced #5383

Closed

Description

@dan-petty

Problem

devops pr ready and the readiness check count a failed check run that a newer run of the same check replaced. On 2026-11-13, pull request #5357 had two runs of "Fail-to-Pass Check" on its head commit f7064d0: a failure at 04:32Z (from the push) and a success at 06:41Z (from a close and reopen of the pull request). The latest run of every check passed (20 success, 5 skipped), but uv run devops pr ready 5357 refused with "The check Fail-to-Pass Check failed."

Cause

The two runs are in different check suites, because each pull request event starts its own workflow run. GET /commits/{ref}/check-runs returns the latest run of each check per suite, so it returns both runs. The readiness code (assess_merge_readiness in the GitHub merge readiness module, used by _validate_pr_ready in src/devops_cli/commands/pr.py) judges each run and does not keep only the latest run of each check name.

Proposed fix

Judge only the latest run of each check name on the head commit (the run with the latest started_at, or completed_at when the run is complete). A failure stays a failure when it is the latest run of its check.

Acceptance criteria

  • A test with two runs of one check name on the head (an older failure and a newer success) gives a pass, and the reverse order gives a failure. The test fails on main (devops ci fail-to-pass).
  • devops pr ready and devops pr check-readiness agree on such a head.

Existing tool considered

The GitHub REST API has no filter across check suites. No new tool. Cost: about 80,000 tokens, 1 hour elapsed.

Activity

  1. added
    source/agent
    type/bug
    scope/pr
    status/new
    value/medium
    effort/low
    on Nov 13, 2026
  2. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 13, 2026
  4. removed
    status/in-review
    owner/agent
    on Nov 13, 2026
  5. devops-cli-service commented on Nov 13, 2026

    @devops-cli-service
    Contributor
  6. devops-cli-service commented on Nov 13, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-13 12:38 UTC

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/lowpriority/p2-mediumscope/prsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions