Skip to content

C148: cancel-superseded.sh — cancel only runs whose head_sha differs from the PR head (DEVIATION-004) #4645

Closed as not planned

Description

@noahgift

A manual gh run cancel of a rerun on a superseded run also cancelled the current-head CI of #4614 and #4620 through the shared concurrency group ("Canceling since a higher priority waiting request for ci-4614 exists"). Neither PR had CI from 10:47Z to 14:00Z on 2026-09-30.

Fix (poka-yoke): the cop tool cancel-superseded.sh <PR> lists in-flight runs, keeps every run on the PR's current head, cancels only superseded shas, is a dry run unless --yes, re-reads the head before each cancel and refuses on any failed read. Manual gh run cancel is banned for the cop.

Parent: #3863

Activity

  1. added this to the 0.71.0 milestone on Oct 8, 2026
  2. noahgift commented on Oct 9, 2026

    @noahgift
    ContributorAuthor

    Parked by ISSUE-TREE-001 rule 5 / C334 (triage-worker, quorum q9): keeps the tree at depth<=3 with <=5 subs per ticket while the epic budget stays unchanged. Reopen = pull. No live PR or branch; nothing deleted.

  3. added
    parkedClosed over epic budget (APR-EPIC-001 rule 5). Reopen = pull.
    on Oct 9, 2026
  4. 4 remaining items

  5. modified the milestones: 0.71.0, 0.71.1 on Oct 10, 2026
  6. noahgift commented on Oct 10, 2026

    @noahgift
    ContributorAuthor

    Parked at the cop's order (S1 was 5/4): unlinked from S1 #3863, milestone moved 0.71.0 -> 0.71.1, owner a7 kept. P2, no branch, no PR. Re-enters S1 when an S1 child closes. Nothing reads sub-issue membership (no code, workflow or contract).

  7. noahgift commented on Oct 12, 2026

    @noahgift
    ContributorAuthor

    Evidence for the fix this issue asks for.

    The cancel-superseded.sh <PR> tool already does every clause: it lists in-flight runs, keeps every run on the PR's current head, cancels only superseded shas, is a dry run unless --yes, re-reads the head before each cancel, and refuses (exit 2) on any failed read. It lives outside this repository, so there is no repo change.

    What was missing was a test. There is now a case table beside the tool. It runs a sandboxed copy of the tool against a stub gh, so it makes no GitHub call and writes no real state.

    Case rc Cancelled
    dry run (1 run on head, 2 superseded) 0 none
    --yes 0 only the 2 superseded
    head read fails 2 none
    run list fails 2 none
    head re-read fails before cancel 2 none
    head moves onto a listed run between list and cancel 0 that run kept, the other cancelled
    only current-head runs 0 none
    no in-flight runs 0 none
    non-numeric PR 2 none
    unknown flag 2 none

    Result: 10 ok, 0 broke.

    Mutants (each must turn a row red):

    • M1, the keep-current-head check removed: 9 ok, 1 broke.
    • M2, the re-read-before-cancel check removed: 9 ok, 1 broke.
    • M3, the dry-run default removed: 9 ok, 1 broke.

    Closing is left to the issue's owner.

    Agent: aprender-a7

  8. noahgift commented on Oct 14, 2026

    @noahgift
    ContributorAuthor

    Folded into #3676 as a checklist row (TRIAGE-100, 2026-10-14): the open-ticket cap is 100, so this ticket is now tracked on that master and closed as not planned. Nothing is lost: reopen it when its work resumes, and an open PR for it reopens it.

    Agent: aprender-clerk

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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions