Skip to content

Commit b7742f8

Browse files
authored
Default test-infra-ref to "main" in reusable job workflows (#8472)
The reusable `*_job*` / `build_wheels_*` / `_binary_upload` workflows default `test-infra-ref` to `""` and pass it to `actions/checkout` as `ref:`. An empty `ref` makes checkout do a "Determining the default branch" REST call per job, which under large fan-out exhausts the org GitHub App installation rate limit — the cause of the `Checkout repository (pytorch/test-infra@)` failures in [pytorch-gha-infra#1375](meta-pytorch/pytorch-gha-infra#1375). Default it to `"main"` instead. `main` is what an empty ref already resolves to, so no checkout behavior changes — checkout just skips the default-branch lookup, dropping that call from the quota path for consumers that don't pin their own ref. Mitigation, not a full fix: it doesn't bound the fan-out or the separate runner-registration quota (see #1375), and explicit `test-infra-ref: ''` callers still override it. Draft for infra owners to confirm on CI. Authored with assistance from Claude Code.
1 parent 1f20bec commit b7742f8

11 files changed

Lines changed: 12 additions & 10 deletions

.github/workflows/_binary_upload.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
type: string
1818
test-infra-ref:
1919
description: "Test infra reference to use"
20-
default: ""
20+
default: "main"
2121
type: string
2222
build-matrix:
2323
description: "Build matrix to utilize"

.github/workflows/build_wheels_linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
type: string
1818
test-infra-ref:
1919
description: "Test infra reference to use"
20-
default: ""
20+
default: "main"
2121
type: string
2222
build-matrix:
2323
description: "Build matrix to utilize"

.github/workflows/build_wheels_macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
type: string
1818
test-infra-ref:
1919
description: "Test infra reference to use"
20-
default: ""
20+
default: "main"
2121
type: string
2222
build-matrix:
2323
description: "Build matrix to utilize"

.github/workflows/build_wheels_windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
type: string
1818
test-infra-ref:
1919
description: "Test infra reference to use"
20-
default: ""
20+
default: "main"
2121
type: string
2222
build-matrix:
2323
description: "Build matrix to utilize"

.github/workflows/linux_job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ on:
5656
type: string
5757
test-infra-ref:
5858
description: "Test infra reference to use"
59-
default: ""
59+
default: "main"
6060
type: string
6161
docker-image:
6262
description: Identifies the Docker image by name.

.github/workflows/linux_job_v2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ on:
6969
type: string
7070
test-infra-ref:
7171
description: "Test infra reference to use"
72-
default: ""
72+
default: "main"
7373
type: string
7474
use-custom-docker-registry:
7575
description: "Use the custom ECR registry. Applies only if build.sh exists in docker-build-dir."

.github/workflows/linux_job_v3.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ on:
7070
type: string
7171
test-infra-ref:
7272
description: "Test infra reference to use"
73-
default: ""
73+
default: "main"
7474
type: string
7575
use-custom-docker-registry:
7676
description: "[Ignored on OSDC] Kept for compatibility with linux_job_v2.yml."

.github/workflows/macos_job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ on:
5656
type: string
5757
test-infra-ref:
5858
description: "Test infra reference to use"
59-
default: ""
59+
default: "main"
6060
type: string
6161
job-name:
6262
description: "Name for the job, which is displayed in the GitHub UI"

.github/workflows/mobile_job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ on:
4747
type: string
4848
test-infra-ref:
4949
description: Test infra reference to use
50-
default: ''
50+
default: "main"
5151
type: string
5252

5353
# iOS-specific inputs

.github/workflows/windows_job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ on:
5656
type: string
5757
test-infra-ref:
5858
description: "Test infra reference to use"
59-
default: ""
59+
default: "main"
6060
type: string
6161
job-name:
6262
description: "Name for the job, which is displayed in the GitHub UI"

0 commit comments

Comments
 (0)