From a2121fc4630a7243f57b4c5cadd89466eca05d16 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Tue, 15 Sep 2026 08:19:33 -0400 Subject: [PATCH] Skip the candidate wheel build on PR heads that predate the release tooling The "Unpublished release wheel" job checks out the reviewed PR head (not the merge commit) and runs .github/release_lock.py and .github/release_build.py from that checkout. A branch opened before those scripts landed on main has nothing to run and fails with "can't open file"; #9422 hit this at 04:15Z today and 27 of the 30 open PRs would on their next push. Detect the two scripts on the head and skip the build steps with a notice when they are absent. The ReleaseLock job still checks the committed lock on the merge commit for every PR. Co-Authored-By: Claude Fable 5.1 --- .github/workflows/pr.yaml | 22 +++++++++++++++++++ ...candidate-wheel-skip-legacy-heads.fixed.md | 1 + 2 files changed, 23 insertions(+) create mode 100644 changelog.d/ci-candidate-wheel-skip-legacy-heads.fixed.md diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 9fd725d2060..84983ba724a 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -56,27 +56,49 @@ jobs: uses: actions/checkout@v6 with: ref: ${{ github.event.pull_request.head.sha }} + - name: Detect the release tooling on the PR head + id: tooling + # The job builds from the reviewed head, not the merge commit, so a + # branch that predates the release tooling has no script to run. + # Skip the build with a notice instead of failing the PR; the + # ReleaseLock job above still checks the lock on the merge commit. + run: | + if [ -f .github/release_lock.py ] && [ -f .github/release_build.py ]; then + echo "present=true" >> "$GITHUB_OUTPUT" + else + echo "present=false" >> "$GITHUB_OUTPUT" + echo "::notice title=Candidate wheel skipped::The PR head predates the release tooling (.github/release_lock.py and .github/release_build.py). Merge main into the branch to build its candidate wheel." + fi - name: Set up Python + if: steps.tooling.outputs.present == 'true' uses: actions/setup-python@v6 with: python-version: "3.14.7" - name: Install uv + if: steps.tooling.outputs.present == 'true' uses: astral-sh/setup-uv@v8.1.0 with: version: "0.12.13" - name: Check committed registry lock + if: steps.tooling.outputs.present == 'true' run: python .github/release_lock.py --committed - name: Predict release version with the release helper + if: steps.tooling.outputs.present == 'true' run: python .github/release_build.py --prepare "${{ matrix.kind }}" - name: Refresh only the release version in the registry lock + if: steps.tooling.outputs.present == 'true' run: python .github/release_lock.py --refresh - name: Install package + if: steps.tooling.outputs.present == 'true' run: uv sync --locked --extra dev - name: Build package from unchanged policy source + if: steps.tooling.outputs.present == 'true' run: uv run --no-sync make - name: Record and verify release build + if: steps.tooling.outputs.present == 'true' run: uv run --no-sync python .github/release_build.py - name: Retain unpublished wheel and build receipt + if: steps.tooling.outputs.present == 'true' uses: actions/upload-artifact@v4 with: name: release-wheel-${{ matrix.kind }}-${{ github.event.pull_request.head.sha }} diff --git a/changelog.d/ci-candidate-wheel-skip-legacy-heads.fixed.md b/changelog.d/ci-candidate-wheel-skip-legacy-heads.fixed.md new file mode 100644 index 00000000000..045265d5216 --- /dev/null +++ b/changelog.d/ci-candidate-wheel-skip-legacy-heads.fixed.md @@ -0,0 +1 @@ +Skip the pull-request candidate wheel build, with a notice, when the PR head predates the release tooling, instead of failing the check on every branch opened before that tooling landed.