From 2c776b73225602ba8ddbb2c882f74fdc2f2988b8 Mon Sep 17 00:00:00 2001 From: Kevin Costner <120246174+kevincostner17@users.noreply.github.com> Date: Tue, 15 Sep 2026 15:43:47 +0530 Subject: [PATCH] ci: group non-PR workflow runs per commit so queued runs are not replaced #376 made push, schedule and dispatch runs on main use a per-ref group without cancel-in-progress. That stopped in-progress cancellation, but a concurrency group still holds at most one pending run and a newer queued run replaces it. During back-to-back merges on 2026-09-15 the CI and Benchmark push runs for 82dba99 and ecb0c78 were cancelled before any job started. Notebook smoke still used cancel-in-progress: true and was cancelled mid-run. Group pull_request runs by ref as before, so a new PR push still cancels its superseded run, and group every other run by commit SHA so each merged commit keeps its own complete result. Apply the same to CI, Benchmark, Performance regression and Notebook smoke. Docs is left as is: it deploys gh-pages, where the newest deploy should win. --- .github/workflows/benchmark.yml | 5 +++-- .github/workflows/ci.yml | 10 ++++++---- .github/workflows/notebooks.yml | 6 ++++-- .github/workflows/perf-regression.yml | 6 +++--- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 43284c6d..7fc5144a 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -17,9 +17,10 @@ on: - cron: "0 6 * * 1" # weekly, Monday 06:00 UTC workflow_dispatch: -# Cancel superseded runs only for pull requests; runs on main are never cancelled. +# Cancel superseded runs only for pull requests. Other runs are grouped per commit +# so a newer queued run on main cannot replace an older commit's queued run. concurrency: - group: benchmark-${{ github.event_name }}-${{ github.ref }} + group: benchmark-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcf8d177..8170c24d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,11 +8,13 @@ on: - cron: "0 3 * * *" workflow_dispatch: -# Only a newer push to the same PR cancels an in-progress run. On main, each -# merge, the nightly schedule and manual dispatches get their own group and are -# never cancelled, so every merged commit keeps a complete result. +# Only a newer push to the same PR cancels its superseded run. Every other run +# (each merge to main, the nightly schedule, manual dispatches) is grouped by +# commit: a group keeps at most one queued run and a newer queued run replaces +# it even without cancel-in-progress, so a per-ref group still dropped the CI of +# back-to-back merges. Per-commit groups keep a complete result on every commit. concurrency: - group: ci-${{ github.event_name }}-${{ github.ref }} + group: ci-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} # Least privilege by default; jobs that need more (nightly alert issue, diff --git a/.github/workflows/notebooks.yml b/.github/workflows/notebooks.yml index e35aafd5..74a132f1 100644 --- a/.github/workflows/notebooks.yml +++ b/.github/workflows/notebooks.yml @@ -16,9 +16,11 @@ on: - ".github/workflows/notebooks.yml" workflow_dispatch: +# Cancel superseded runs only for pull requests; runs on main are grouped per +# commit so back-to-back merges each keep their notebook smoke result. concurrency: - group: notebooks-${{ github.ref }} - cancel-in-progress: true + group: notebooks-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: contents: read diff --git a/.github/workflows/perf-regression.yml b/.github/workflows/perf-regression.yml index 9789d3d5..39fb04a2 100644 --- a/.github/workflows/perf-regression.yml +++ b/.github/workflows/perf-regression.yml @@ -29,10 +29,10 @@ on: type: boolean default: false -# Cancel superseded runs only for pull requests; scheduled and manual runs on -# main never cancel each other. +# Cancel superseded runs only for pull requests. Scheduled and manual runs are +# grouped per commit so they never cancel or replace each other's queued runs. concurrency: - group: perf-regression-${{ github.event_name }}-${{ github.ref }} + group: perf-regression-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: