Skip to content

Skip the candidate wheel build on PR heads that predate the release tooling - #9476

Merged
MaxGhenis merged 1 commit into
mainfrom
ci-candidate-wheel-skip-legacy-heads
Sep 15, 2026
Merged

MaxGhenis merged 1 commit into
mainfrom
ci-candidate-wheel-skip-legacy-heads

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Problem

The "Unpublished release wheel (rc1, final)" job added in PolicyEngine/policyengine-us#9467 checks out github.event.pull_request.head.sha and runs .github/release_lock.py and .github/release_build.py from that checkout. The workflow definition comes from the merge ref, so the job runs on every open PR, but the two scripts exist only on heads that include #9428 (9/12) and #9467 (today). Any older head fails at the first script:

python: can't open file '/home/runner/work/policyengine-us/policyengine-us/.github/release_lock.py': [Errno 2] No such file or directory
##[error]Process completed with exit code 2.

PolicyEngine/policyengine-us#9422 hit this at 04:15Z today (run 34928136338). As of this morning 27 of the 30 open PRs have a head without release_build.py, so each of them goes red on its next push.

Building from the reviewed head rather than the merge commit is deliberate: the retained wheel is meant to be the reviewed source. Running the scripts from a second checkout of the base branch does not help, because both resolve the repository root from their own location and check the head's pyproject.toml and uv.lock, and a head that predates the lock regime cannot pass that check anyway.

Change

Add a step after the head checkout that detects both scripts. When either is missing, emit a notice ("merge main into the branch to build its candidate wheel") and skip the remaining steps, so the job reports success without an artifact. The ReleaseLock job still validates and rehearses the committed lock on the merge commit for every PR, so no PR loses that check. Heads that carry the tooling build exactly as before.

Alternative considered: drop the ref: so the job builds the merge ref like every other job in pr.yaml. That makes the wheel buildable for any mergeable PR but the receipt then names a merge commit nobody reviewed. This PR keeps the head-exact design.

Verification

  • pr.yaml parses; the CandidateWheel job has 11 steps and every step after the detection carries if: steps.tooling.outputs.present == 'true'.
  • Release tooling tests: RELEASE_LOCK_REAL_UV=1 python -m unittest discover -s .github/tests -p 'test_release_*.py' passes (43 tests).
  • This PR's own head carries both scripts, so its candidate wheel jobs run the full path.

🤖 Generated with Claude Code

…ooling

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 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis merged commit fb70ebe into main Sep 15, 2026
35 checks passed
@MaxGhenis
MaxGhenis deleted the ci-candidate-wheel-skip-legacy-heads branch September 15, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant