Skip to content

Check re-run reads CI as passed before the re-run's checks are listed, and Self-merges red CI #686

Closed

Description

@JacobStephens2

This was generated by AI during triage.

What happened

The Run for #683 Self-merged #684 into main with site-test red. main has been red since then (fixed in #685).

From the Run's command log (times EDT):

09:06:58 CI failed on da91de5: site-test
09:07:00 CI red; starting Repair 1 of 5
09:11:13 repair-1: session ended          (no commit; head still da91de5)
09:11:15 re-running the failed checks on da91de5: site-test
09:11:18 CI passed on da91de5             <- 3 s after the request
09:11:20 merging the PR into main

GitHub's record of the same workflow run (38400243958): attempt 3 of site-test started at 09:11:21 and failed at 09:11:59, forty seconds after the merge.

Why

The Check re-run counts the new attempt as started once GitHub no longer lists the attempt-before's failed check runs, and the checks listing is non-empty. That condition only proves the old runs disappeared. GitHub stops listing the failed check run as soon as a re-run is requested, before it lists the queued job. During that gap the listing holds only the green checks, so the watch that follows finds nothing pending and nothing failed, and reports CI passed.

The guard was also stale here. The attempt-before ids came from the watch that started the Repair. The Repair session had already re-run the job itself (gh run rerun, attempt 2), so attempt 1's check run was gone before thirdshift asked. The guard passed on its first poll.

This breaks the CONTEXT.md rule for Check re-run: "Checks that cannot be read or disappear after known failures cannot establish success."

Expected

After a successful re-run request, CI on the head can only count as passed once every re-run check name is listed again with a check run that is new since the request: an id not seen before it, finished and passing. If any re-run check name is missing when the watch ends, the result is not green. Use the same rule if the Repair (or anyone) re-ran the jobs before thirdshift's request.

Evidence

Activity

  1. added
    bug
    needs-triage
    on Oct 14, 2026
  2. JacobStephens2 commented on Oct 14, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief

    Category: bug
    Summary: A Check re-run must never report CI passed until each re-run check has a new, finished, passing check run listed.

    Current behavior:
    After a successful re-run request, the CI watch treats the new attempt as started once the checks listing is non-empty and lists none of the attempt-before's failed check runs. GitHub stops listing a failed check run as soon as its re-run is requested, before it lists the queued job, so the listing can briefly hold only green checks. The watch then reports CI passed and a Merge run Self-merges. The attempt-before ids come from the watch that started the Repair. If the Repair re-ran the jobs itself, those ids are already gone, and the guard passes at once.

    Desired behavior:

    • After a successful request, the re-run's watch waits until every re-run check name (the branch's own failures plus any Inherited failure sharing a requested workflow run) is listed again with a check run id not listed before the request. It then watches those to the end as usual.
    • The "before" ids are read from a fresh checks listing taken just before the request, not only from the earlier watch's failures.
    • If a re-run check name is still missing when the grace period ends, the result is the existing "no re-run appeared" outcome (None), never Ci::Passed. A check name that disappears during the watch after known failures cannot count as green.
    • Everything else about the Check re-run in CONTEXT.md is unchanged: one allowance per head, refusals, Inherited failures, non-Actions checks.

    Key interfaces:

    • ci::rerun / its Outside-driven core: the new-attempt condition.
    • Check, ActionsJob { check_run, workflow_run }: identity for "new since the request".
    • The in-memory Outside test double scripts listings per poll.

    Acceptance criteria:

    • Scripted test: the listing right after the request omits the failed check entirely (others green); the watch keeps polling and does not report passed. When the new check run appears and fails, the result is Ci::Failed.
    • Scripted test: the failed check's id in FailedChecks is stale (a later attempt is listed, failed) when the request is made; the result still waits for a check run newer than the one listed at request time.
    • Scripted test: the new check run never appears within the grace period, so the result is None with the existing progress line.
    • Existing ci tests still pass; cargo test, cargo clippy --all-targets -- -D warnings, cargo fmt --check pass.

    Out of scope:

  3. added
    ready-for-agent
    in-progress
    and removed
    needs-triage
    ready-for-agent
    on Oct 14, 2026
  4. removed
    in-progress
    on Oct 14, 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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions