Skip to content

ci: Superseded merge-queue runs are not cancelled when master moves #986

Closed

Description

@zackees

Part of #930.

When master moves (a queue merge or a maintainer bypass), GitHub rebuilds every queued group, but the old merge_group runs keep waiting for runners. pr-pull.yaml's concurrency group is ${{ github.workflow }} @ … github.ref, and a queue ref includes the base commit (gh-readonly-queue/master/pr-970-<base sha>), so a PR's new queue run never cancels its old one.

On 2026-10-16 between 04:01 and 04:10 UTC this left 2–3 queue runs per PR waiting on the scarce ubuntu-26.04 runners. They were cancelled by hand twice (10, then 11 runs), keeping only the run whose head matches the live queue entry.

Fix options:

  1. A first job in merge_group runs (actions: write) that cancels other in-flight merge_group runs for the same PR number whose head isn't a live queue entry.
  2. A concurrency group keyed on the PR number for merge_group events, if it can be derived in an expression (the ref is …/pr-<N>-<sha>; expressions have no substring, so likely a small check-event output feeding the downstream jobs' concurrency:).

Acceptance: after master moves, each queued PR has exactly one live queue run within a minute, checked on a real queue.

Activity

  1. added
    infra
    on Oct 16, 2026
  2. zackees commented on Oct 16, 2026

    @zackees
    MemberAuthor

    Claiming: #986

    1. One PR: ci/cancel_superseded.py (pure superseded(runs, current) + gh I/O, unit-tested in ci/), called by a first job in pr-pull.yaml on merge_group events with job-level actions: write. It cancels older in-flight queue runs for the same PR number.
  3. added
    claimed
    on Oct 16, 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

    claimedinfra

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions