Skip to content

Commit 793b4d6

Browse files
authored
Fix concurrency key so ciflow tag re-pushes cancel prior runs (#21622)
Tag-triggered workflows key concurrency on `${{ github.event.pull_request.number || github.sha }}`. On a `ciflow/*` tag push there is no PR number, so the group falls back to `github.sha` — each re-push points at a new sha, gets its own group, and never cancels the prior run. `cancel-in-progress` is dead for tag pushes. On Aug 5 a burst of ciflow re-pushes fanned out to 46 shas / 117 runs, buried the shared `macos-m1-stable` fleet, and drove `main` macOS coverage to 0 ([gha-infra#1391](meta-pytorch/pytorch-gha-infra#1391)). ## Fix Fall back to `github.ref_name` (stable across re-pushes of the same tag) and gate the sha term on `github.ref_type == 'branch'`, matching `periodic.yml` in this repo and `pytorch/pytorch`'s `trunk.yml`: ```yaml group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-... ``` Applied to all 29 workflows carrying the old key (22 are tag-exposed; the other 7 are fixed for uniformity). Also drops a stray `--` in the nightly/test-backend group strings. `doc-build.yml` was already correct (keys on `github.ref`) and is untouched. ## Also: apple.yml test-infra-ref `apple.yml` passed `test-infra-ref: ''` to the `mobile_job` call, forcing `actions/checkout` to resolve the default branch via a REST call — a contributor to GitHub App installation rate-limit exhaustion ([gha-infra#1375](meta-pytorch/pytorch-gha-infra#1375)). Set it to `main` (the branch the empty ref already resolved to). This is the one executorch call site that overrode the new `main` default from [pytorch/test-infra#8472](pytorch/test-infra#8472); every other call site inherits that default. ## Review `periodic.yml` (unchanged) is the template — verify `trunk.yml` matches it; the other 28 are the identical one-line change. The `apple.yml` line is independent. --- Authored with assistance from Claude Code.
1 parent ed07a9d commit 793b4d6

29 files changed

Lines changed: 30 additions & 30 deletions

.github/workflows/apple.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525
- cron: '0 10 * * *' # Runs daily at 2 AM PST
2626

2727
concurrency:
28-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
28+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
2929
cancel-in-progress: true
3030

3131
jobs:
@@ -161,7 +161,7 @@ jobs:
161161
device-type: ios
162162
# For iOS testing, the runner just needs to call AWS Device Farm, so there is no need to run this on macOS
163163
runner: linux.2xlarge
164-
test-infra-ref: ''
164+
test-infra-ref: main
165165
# This is the ARN of ExecuTorch project on AWS
166166
project-arn: arn:aws:devicefarm:us-west-2:308535385114:project:02a2cf0f-6d9b-45ee-ba1a-a086587469e6
167167
# This is the custom device pool that only includes iOS devices

.github/workflows/build-cadence-runner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
workflow_dispatch:
1616

1717
concurrency:
18-
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.sha }}
18+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}
1919
cancel-in-progress: true
2020

2121
jobs:

.github/workflows/build-cmsis-pack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ on:
4242
type: string
4343

4444
concurrency:
45-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
45+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
4646
cancel-in-progress: true
4747

4848
jobs:

.github/workflows/build-presets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
workflow_dispatch:
1010

1111
concurrency:
12-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
1313
cancel-in-progress: true
1414

1515
jobs:

.github/workflows/check-c10-sync.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- runtime/core/portable_type/c10/**
99

1010
concurrency:
11-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
1212
cancel-in-progress: true
1313

1414
jobs:

.github/workflows/check-labels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525
required: true
2626

2727
concurrency:
28-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
28+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
2929
cancel-in-progress: true
3030

3131
jobs:

.github/workflows/cuda-perf.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ on:
3131
default: "50"
3232

3333
concurrency:
34-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
34+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
3535
cancel-in-progress: true
3636

3737
permissions:

.github/workflows/cuda-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020
workflow_dispatch:
2121

2222
concurrency:
23-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
23+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
2424
cancel-in-progress: false
2525

2626
permissions:

.github/workflows/cuda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ on:
2828
workflow_dispatch:
2929

3030
concurrency:
31-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
31+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
3232
cancel-in-progress: false
3333

3434
permissions:

.github/workflows/docker-builds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
- cron: 1 3 * * 3
2020

2121
concurrency:
22-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
22+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
2323
cancel-in-progress: true
2424

2525
env:

0 commit comments

Comments
 (0)