Repository navigation
[backport] Don't save renv and Typst caches after an interrupted restore - #14998
Merged
Merged
Conversation
Both save steps ran on always() with only a cache-hit != 'true' guard. A job cancelled while actions/cache/restore was extracting never sets cache-hit, so the save step uploaded the half-extracted directory under the exact primary key. Every later run on that branch then gets an exact hit, skips the save, and keeps restoring the partial cache until the entry is deleted by hand. This happened on v1.10: a cancelled Windows job saved a 196 MB renv cache over the 347 MB one it was extracting, and later runs failed the knitr SQL docs with "'DBI' is not a valid installed package". renv::restore() linked DBI from the truncated cache, and renv::status() still reported the library as synchronized, so a status check can't catch this. Save now requires the restore pipeline to have completed: the renv save needs the "Restore R packages" step to succeed (skipped after an interrupted cache restore, failed when renv::restore leaves the library out of sync), and the Typst save needs its restore step to succeed. !cancelled() replaces always() rather than being dropped, so caches are still saved when tests fail. julia-actions/cache applies the same rule and refuses to save unless its restore completed. (cherry picked from commit 0d52026)
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
Important
Backport from #14997
The renv and Typst cache save steps in
test-smokes.ymlno longer run after an interrupted cache restore, which on v1.10 left a truncated renv cache under the exact key and made later runs fail with'DBI' is not a valid installed package.Checklist
I have (if applicable):
AI-assisted PR
ghNote: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.