From 379086f81840a554f353188f144d44b47f3c3a5d Mon Sep 17 00:00:00 2001 From: Hector Ventura Date: Sun, 11 Oct 2026 00:06:59 -0500 Subject: [PATCH] ci: let a running main CI run finish instead of cancelling it (#5396) * ci: let a running main CI run finish instead of cancelling it A CI run takes about 18 minutes and merges often land closer together than that, so cancel-in-progress on refs/heads/main stopped runs partway through: from 2026-10-05 to 2026-10-09, 77 of 138 CI runs on main were cancelled, leaving most main commits without a result and a break pointing at the wrong commit. Cancel only on pull requests. On main the concurrency group still holds one pending run that a newer merge replaces before it starts, so a burst of merges is tested once, at its newest commit, and no run stops halfway. Refs #5085 * ci: stop cancelling main runs in the other workflows that run on pushes to main Checkstyle, Docs in sync and Partition Literals run on pull requests and on pushes to main, so they get the same rule as ci.yml: cancel a superseded run only on pull requests. The docs deploy never runs on pull requests, so it stops cancelling altogether. The remaining workflows named in #5085 (compatibility, compat-partitions, iam-namespace-drift, nightly) have no push trigger, so a merge to main never cancels them and they are left as they are. Refs #5085 * ci: state the measured cancellation figures in the ci.yml comment The comment quoted one-day figures (30 of 47 runs, a 13 minute median gap, 546 runner-minutes) that the run history does not reproduce. Replace them with the count measured from it: 77 of 138 CI runs on main cancelled from 2026-10-05 to 2026-10-09. Refs #5085 Signed-off-by: Hector Ventura --------- Signed-off-by: Hector Ventura --- .github/workflows/checkstyle.yml | 3 ++- .github/workflows/ci.yml | 9 ++++++++- .github/workflows/docs-actions.yml | 3 ++- .github/workflows/docs.yml | 3 ++- .github/workflows/partition-literals.yml | 3 ++- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/checkstyle.yml b/.github/workflows/checkstyle.yml index 18fe752cfe..c73d17e758 100644 --- a/.github/workflows/checkstyle.yml +++ b/.github/workflows/checkstyle.yml @@ -26,7 +26,8 @@ permissions: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + # Cancel a superseded run only on pull requests; a run on main is left to finish (see ci.yml). + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: checkstyle: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11f7958d37..4aefbfae15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,9 +22,16 @@ on: permissions: contents: read +# A new push to a pull request cancels its older run: only the latest head matters there. +# On main a running run is left to finish. A run takes about 18 minutes and merges often +# land closer together than that, so cancelling stopped 77 of 138 main runs partway through +# between 2026-10-05 and 2026-10-09 and left most main commits with no result. +# Without cancelling, the concurrency group still holds at most one pending run: a newer +# merge replaces the waiting one before it starts, so a burst of merges is tested once, at +# its newest commit, and no run is stopped halfway. concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.event_name == 'pull_request' }} env: # Hardcoded on purpose: strategy.job-total counts EVERY matrix job, so adding an diff --git a/.github/workflows/docs-actions.yml b/.github/workflows/docs-actions.yml index ffa4624295..b8726e02ec 100644 --- a/.github/workflows/docs-actions.yml +++ b/.github/workflows/docs-actions.yml @@ -33,7 +33,8 @@ permissions: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + # Cancel a superseded run only on pull requests; a run on main is left to finish (see ci.yml). + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: action-tables: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0f02cd892e..b818b05661 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,7 +16,8 @@ permissions: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + # This workflow never runs on pull requests, so a running deploy is left to finish (see ci.yml). + cancel-in-progress: false jobs: deploy: diff --git a/.github/workflows/partition-literals.yml b/.github/workflows/partition-literals.yml index 729b55cce6..a026b5a186 100644 --- a/.github/workflows/partition-literals.yml +++ b/.github/workflows/partition-literals.yml @@ -46,7 +46,8 @@ permissions: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + # Cancel a superseded run only on pull requests; a run on main is left to finish (see ci.yml). + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: partition-literals: