Repository navigation
fix(ci): key E2E venv cache on the full Python version - #2333
Open
anishmehta24 wants to merge 1 commit into
Open
anishmehta24 wants to merge 1 commit into
anishmehta24 wants to merge 1 commit into
Conversation
The E2E cache stores e2e-tests/env, whose bin/python links to the exact CPython the runner had when the cache was saved. setup-python resolves '3.10' to whatever patch version the runner image has, so a cache saved on 3.10.22 and restored on 3.10.21 leaves a dangling interpreter and 'python -m venv env' fails before any test runs.
This branch has not been deployed
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.
Change Description
Both E2E jobs cache
e2e-tests/envunder a key that only has the OS, platform and the requirements hash. A venv'sbin/pythonis a symlink to the exact interpreter that created it, whilesetup-pythonwith'3.10'installs whatever 3.10 patch release the runner image has. When a cache saved on one patch release is restored on another, the link dangles andpython -m venv envfails before any test runs.This happened on the amd64 E2E job in #2331 (job 112786554063):
That cache entry had been saved by a runner on 3.10.22 (run 37551204723). Re-running the job does not help while the same entry keeps being restored.
The fix gives both
Set up Pythonsteps an id and addssteps.setup-python.outputs.python-version(the full version, e.g.3.10.21) to the cache key and the restore-key prefix. A cached venv is then only restored onto the interpreter it was built with. When the runner image moves to a new patch release, the first run misses the cache and rebuilds it.Issue reference
No issue. Found while looking into the red E2E (amd64) check on #2331.
Checklist
CI-only change, so no unit tests. actionlint 1.7.7 on
ci.ymlreports only theubuntu-slimrunner-label warnings that main already has. The local E2E jobs on this PR exercise the new keys.AI assistance (Claude Code) was used for this change.