Repository navigation
Turn off setup-uv's cache in jobs that can finish without running uv - #60
Merged
Merged
Conversation
setup-uv's post-job step fails a job whose uv cache directory does not exist, which is the case when no uv command ran. The changelog job on a Dependabot pull request that changes only uv.lock, and the versioning job on a merge without fragments, both finish without running uv, so both fail while their setup-uv steps keep the default cache. The new test, registered as rule emitter.ci.uv-cache-only-where-uv-runs, fails on this commit for pr.yaml's changelog job and push.yaml's versioning job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pr.yaml's changelog job passes a Dependabot pull request that changes only uv.lock without running uv, and push.yaml's versioning job runs no uv command on a merge without changelog fragments. setup-uv's post-job step then fails each job because uv's cache directory does not exist, which blocks Required checks on Dependabot's pull requests and would end the Push run failed although nothing is released. Neither job needs the cache, so both setup-uv steps set enable-cache: false. Every other setup-uv step's job runs uv in every successful run: the quality, tests and build-packages jobs start with uv sync --locked, the rules job with uv tool install, and tools/check-collector.sh runs uv sync --locked before any branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- README and push.yaml's header comment: only a merge that adds changelog fragments releases; a merge without them runs push.yaml once and commits nothing. - README: the uv a developer needs is whatever the root required-version lower bound accepts, instead of a restated "0.13.6 or later in the 0.13 series" that the >=0.13 bound does not enforce; it also explains why two jobs turn off setup-uv's cache. - emitter.dependencies.install-from-lock and test-from-lock: the locked-installs check reads, in the Python scripts under tools/, only calls whose leading arguments (or the list or tuple passed first) give the command as string literals, so the statements say so. - emitter.distributions.version-from-fragments: tools/bump-version.py, not every release, refuses missing fragments, since tools/update-version.sh releases nothing without them. - emitter.dependencies.uv-version-pinned: the check accepts a bound written >=X.Y or >=X.Y.Z and does not check Dependabot's uv release, so the statement and the guard's docstring say so. Rendered views regenerated with python -m scripts.rules render. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fixed fragment, so merging releases 0.11.6 of both distributions; the wheels' contents are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in #50 (single-command run: steps, shellcheck and tests for the tools scripts) and the 0.11.6 release. Only the rendered rule views, AGENTS.md and docs/generated/rules.md, conflicted; both were regenerated with python -m scripts.rules render from the merged registry, which keeps #50's rules and this branch's new rule and corrected statements. The registry, README, tests/test_workflows.py and the workflows merged without conflicts. This branch's fragment now makes the release 0.11.7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # README.md
anth-volk
added a commit
that referenced
this pull request
Nov 2, 2026
#60 becomes the bottom of the stack. The only conflict was in docs/generated/rules.md, which python -m scripts.rules render regenerated from the merged registry; AGENTS.md was rendered the same way. setup-uv keeps enable-cache: false in pr.yaml and push.yaml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
marked this pull request as ready for review
November 2, 2026 14:25
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.
Fixes #59
Follow-up to #48. Dependabot's first pull request, #56, which changes only
uv.lock, fails "Check changelog fragment", and so "Required checks". This PR fixes that failure, and the same failure in the Push workflow on a merge without fragments, and corrects the documentation and rule statements the third review of #48 found inaccurate.Cause
astral-sh/setup-uvcaches by default on GitHub-hosted runners (enable-cache: auto). Its post-job step fails the job when uv's cache directory does not exist andignore-nothing-to-cacheis false (src/save-cache.tsat the pinned commitd0d8abe). The directory exists only once a uv command has used the cache.pr.yaml):tools/check-changelog.shlets a Dependabot pull request that changes onlyuv.lockpass before running uv. Run 41097041571 on Bump the locked-dependencies group across 1 directory with 3 updates #56 shows the script exiting 0, then "Cache path … does not exist on disk".push.yaml): on a merge without fragments,tools/update-version.shwritesreleased=falseand exits before any uv command, so the run would end failed although nothing is released. Not yet observed: no merge without fragments has happened.Changes
cb12a5f):tests/test_workflows.py::test_setup_uv_caches_only_in_jobs_that_always_run_uv, registered as the new ruleemitter.ci.uv-cache-only-where-uv-runs. For every setup-uv step in every workflow, it requiresenable-cache: falseunless a later step of the same job, with noif:, runs a command starting withuvoruvx, or runsbash tools/<script>.shwhere the script's unindented lines reach such a command before anyif,case, loop, function definition orexit.cb12a5f: failed, listing('pr.yaml', 'changelog')and('push.yaml', 'versioning').0c894e6):enable-cache: falseon the setup-uv steps of those two jobs. Locally on0c894e6: passed.quality,testsandbuild-packagesinci.ymlstart withuv sync --locked,rulesinpr.yamlwithuv tool install, andtools/check-collector.sh, which thecollectorjob runs, reachesuv sync --lockedbefore any branch.e0f6bd9):push.yaml's header comment now say that only a merge with changelog fragments releases, and that a merge without them runspush.yamlonce and commits nothing.required-version = ">=0.13"does not enforce. It now points to the lower bound in[tool.uv] required-version, and to.github/uv-version.txtfor the one release CI installs.emitter.dependencies.install-from-lockandemitter.dependencies.test-from-lockclaimed every command the Python scripts undertools/start. The locked-installs check reads only calls whose leading arguments, or the list or tuple passed first, give the command as string literals, and the statements now say exactly that.emitter.distributions.version-from-fragmentssaid the release refuses missing fragments. Now onlytools/bump-version.pydoes, sincetools/update-version.shreleases nothing without them, and the statement names it.emitter.dependencies.uv-version-pinnedsaid the bound is written>=X.Yand that Dependabot's uv still runs. The check also accepts>=X.Y.Zand does not check Dependabot's uv release, so the statement and the guard's docstring now say what is checked.python -m scripts.rules renderregeneratedAGENTS.mdanddocs/generated/rules.md.bdfe968): every pull request except Dependabot's lock-only ones needs one, so this PR addschangelog.d/uv-cache-without-uv.fixed.md. Merging releases 0.11.7 of both distributions (after Check that workflow steps are single commands, and that tools scripts pass shellcheck and have tests #50 released 0.11.6) (a patch bump; the wheels' contents are unchanged).Local checks
cb12a5fand passed on0c894e6, with uv 0.13.6.python -m scripts.rules guard --base-ref origin/main: passed.scripts/run_quality_guards.py: all four guards passed.pr.yamlandpush.yaml: passed.Secrets and variables of the changed jobs
PR_AUTHORtools/check-changelog.shin the changelog jobgithub.event.pull_request.user.login, from thepull_requesteventenv:; unchanged by this PRBASE_REFgithub.base_ref, set onpull_requesteventsenv:; unchangedsecrets.APP_ID,secrets.APP_PRIVATE_KEYwith:; unchanged. Run 41096704729 created the token after #48 mergedsteps.app-token.outputs.tokenactions/create-github-app-token, at run timeGITHUB_OUTPUTtools/update-version.shsteps.version.outputs.releasedgithub.tokengithub-tokeninput in both jobs, and checkout in the changelog jobpermissions: contents: read; unchanged.github/uv-version.txtversion-fileinputenable-cache: falseadds no variable. setup-uv no longer restores or saves a cache in these two jobs, so they no longer use the runner's cache service. The repository has no repository-level secrets or variables, and no Dependabot secrets. Nothing in this table is unverified, except that the versioning job's run without fragments onmainwill first happen when a merge without fragments, such as #56, lands.After merging
#56 was opened before this fix, so it needs a rebase (for example
@dependabot rebase) to pick up the newpr.yaml. This PR does not comment on #56.🤖 Generated with Claude Code