Skip to content

Commit 90ad98d

Browse files
committed
Cancel only superseded PR runs in CI
A CI or compatibility run is now cancelled only when a newer push to the same pull request replaces it. Push, dispatch and scheduled runs always finish, so a manually dispatched run on the v5 base branch (its only CI verdict, since push CI runs on main alone) is no longer killed by a later dispatch or by the non-main cancel rule, and main keeps finishing its rust-cache saves. CI now groups PR runs by PR number, like the compatibility workflows already do. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AfGnDQMy2FvpExneXmR1qp
1 parent 686e5fb commit 90ad98d

6 files changed

Lines changed: 15 additions & 14 deletions

File tree

‎.github/workflows/bun-compatibility.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ on:
9595
permissions:
9696
contents: read
9797

98-
# Supersede stale PR runs. The `main` guard is load-bearing: main runs are the
99-
# ONLY rust-cache writers (save-if), so they must never be cancelled mid-save.
98+
# Supersede stale PR runs only: main runs are the ONLY rust-cache writers
99+
# (save-if), so push, dispatch and schedule runs are never cancelled mid-save.
100100
concurrency:
101101
group: bun-patch-${{ github.event.pull_request.number || github.ref }}
102-
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
102+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
103103

104104
env:
105105
CARGO_PROFILE_DEV_DEBUG: '0'

‎.github/workflows/ci.yml‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ on:
1717
permissions:
1818
contents: read
1919

20-
# Supersede stale runs on force-push / rapid PR updates. The `main` guard is
21-
# load-bearing: main runs are the ONLY rust-cache writers (save-if), so they
22-
# must never be cancelled mid-save.
20+
# A newer push to the same PR supersedes its older run; nothing else is
21+
# cancelled. Push, dispatch and schedule runs always finish: main runs are
22+
# the ONLY rust-cache writers (save-if) and must not die mid-save, and a
23+
# dispatched base-branch run is the base's only CI verdict.
2324
concurrency:
24-
group: ci-${{ github.ref }}
25-
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
25+
group: ci-${{ github.event.pull_request.number || github.ref }}
26+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
2627

2728
jobs:
2829
clippy:

‎.github/workflows/go-compatibility.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ permissions:
3030

3131
concurrency:
3232
group: go-compat-${{ github.event.pull_request.number || github.ref }}
33-
cancel-in-progress: true
33+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
3434

3535
env:
3636
SOCKET_NO_CONFIG: '1'

‎.github/workflows/pdm-compatibility.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ permissions:
4848

4949
concurrency:
5050
group: pdm-compat-${{ github.event.pull_request.number || github.ref }}
51-
cancel-in-progress: true
51+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
5252

5353
env:
5454
SOCKET_NO_CONFIG: '1'

‎.github/workflows/poetry-compatibility.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ permissions:
4040

4141
concurrency:
4242
group: poetry-compat-${{ github.event.pull_request.number || github.ref }}
43-
cancel-in-progress: true
43+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
4444

4545
env:
4646
SOCKET_NO_CONFIG: '1'

‎.github/workflows/vlt-compatibility.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ on:
117117
permissions:
118118
contents: read
119119

120-
# Supersede stale PR runs; main runs are the only rust-cache writers, so they
121-
# are never cancelled mid-save.
120+
# Supersede stale PR runs only: main runs are the only rust-cache writers, so
121+
# push, dispatch and schedule runs are never cancelled mid-save.
122122
concurrency:
123123
group: vlt-compat-${{ github.event.pull_request.number || github.ref }}
124-
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
124+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
125125

126126
env:
127127
CARGO_PROFILE_DEV_DEBUG: '0'

0 commit comments

Comments
 (0)