Repository navigation
Key each uv cache on the file that pins its tools - #26
Conversation
setup-uv keys its cache on a project's dependency files, requirements, pyproject.toml, uv.lock and the like, and this repository has none: the versions of actionlint-py, pytest and pyyaml are pinned in premerge.yaml. So nothing matched, the cache key never changed, and both jobs that set up uv warned on every run that the cache would never be invalidated. Keyed on premerge.yaml, a changed pin starts a new cache, and the warnings stop, so a new warning on these jobs is not lost among them. Each uvx call names exact versions, so the old cache never installed a wrong one; the cost was the noise. Signed-off-by: Gavin Lucas <Gavin@L337.org>
Claude review: approveWhat changedThe range changes one file, What I checked
Findings1. maintainability (non-blocking, existed before this change): the two jobs share one cache key, so one job's tools are never cached.
Note, not a finding: the glob hashes the whole of What I did not check
full review of |
actionlint and shared-behaviour installed different tools under one cache key, and setup-uv saves nothing on an exact hit, so whichever job saved first kept the other's tools out of the cache, and that job downloaded them on every run. The job's name is now the key's suffix. Signed-off-by: Gavin Lucas <Gavin@L337.org>
The action set up uv with setup-uv's default glob, which looks in the caller's workspace for requirements and project files. The script pins its one dependency inline and lives in the action's directory, so in a caller with no Python project files nothing matched, and every caller's hygiene job warned that the cache would never be invalidated; quaffed's does. setup-uv hashes files outside the workspace, so the glob is now the script itself, through github.action_path. Signed-off-by: Gavin Lucas <Gavin@L337.org>
Claude review: approveResolved
Still openNone. DeclinedNone. NewNone. The delta is the
delta review of |
|
The shared key: confirmed and fixed in 393d457. setup-uv's key at the pinned commit ends in the suffix ( Your note about |
Claude review: approveResolved
Still openNone. DeclinedNone. NewNone.
delta review of |
What
actionlintand "Shared workflows and actions behave") now key setup-uv's cache on.github/workflows/premerge.yaml, throughcache-dependency-glob. That file is where their tools are pinned. Each job also gets its owncache-suffix(${{ github.job }}).repo-hygieneaction keys its uv cache on its own script, through${{ github.action_path }}/check-repo-hygiene.py. The script pins its one dependency inline.Why
pyproject.tomland lock files in the workspace. This repository has none, and neither do callers like quaffed, so every run warned "The cache will never get invalidated". That is two warnings here, and one in every caller's hygiene job.No wrong version was ever installed: every tool is pinned exactly.
Checked
68559e99:cache-dependency-globandcache-suffixare real inputs;hashFilessays it "supports hashing files outside the GITHUB_WORKSPACE".Not yet observed
repo-hygienechange: nothing in this repository runs that action, so it is first seen on a caller's run once a release movesv2. Ifgithub.action_pathdid not resolve there, setup-uv would warn as before, or the glob would match nothing; the hygiene check itself is unaffected. That run is what confirms it.