fix: pin functional test toolchain outside .github/workflows - #176
Merged
Conversation
The nightly `Update Functional Test Toolchain` job fails when a new Lean release exists, because it edits `.github/workflows/functional_tests.yml` and GitHub refuses to push changes to files under `.github/workflows/` without a token holding the `workflows` permission, which the default `GITHUB_TOKEN` cannot be granted. Move the pinned toolchain into `.github/functional_test_toolchain`, read it from a `resolve-toolchain` job that exposes it as a job output, and point the updater at that file so it no longer writes to a workflow file. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The nightly Update Functional Test Toolchain job fails whenever a newer Lean release exists (example run). It detects the release and rewrites
.github/workflows/functional_tests.ymlcorrectly, then dies on the push:GitHub blocks any token from committing to files under
.github/workflows/unless it carries theworkflowscope. The defaultGITHUB_TOKENcannot have it —workflows: writeis not a grantable key in a workflow'spermissions:block — so no permissions change can fix this.This PR removes the need for such a token by moving the pinned toolchain out of the workflow file:
.github/functional_test_toolchain(new) holdsleanprover/lean4:v4.32.2, mirroring the format of Lean's ownlean-toolchainfiles.functional_tests.ymlgains aresolve-toolchainjob that reads that file — or theworkflow_dispatchinput when one is given — and exposes the result as a job output. The toolchain-consuming jobs takeneeds: resolve-toolchainand reference${{ needs.resolve-toolchain.outputs.toolchain }}. The two legacy-leancheckerjobs are unchanged, since nothing auto-editslegacy_toolchain..github/workflows/and the defaultGITHUB_TOKENsuffices.paths:filter so a toolchain bump still triggers the functional tests.Notes
workflow_dispatchinput default is now""rather than a prefilled version; leaving it blank uses the pinned toolchain. The screenshot inCONTRIBUTING.mdis slightly stale in that respect.GITHUB_TOKENstill do not triggerpull_requestworkflows, so functional tests will not run automatically on the generated PR. SettingTOOLCHAIN_UPDATE_TOKEN— now needing onlycontentsandpull-requests, notworkflow— or closing and reopening the PR remains the workaround. That caveat is still documented in the updater's header comment.🤖 Generated with Claude Code