Skip to content

[backport] Don't save renv and Typst caches after an interrupted restore - #14998

Merged
cderv merged 1 commit into
v1.10from
backport/renv-cache-cancelled-save
Oct 6, 2026
Merged

cderv merged 1 commit into
v1.10from
backport/renv-cache-cancelled-save

Conversation

@cderv

@cderv cderv commented Oct 5, 2026

Copy link
Copy Markdown
Member

Important

Backport from #14997

The renv and Typst cache save steps in test-smokes.yml no 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):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR
AI-assisted PR
  • AI tool used: Claude Code
  • Codebase grounding: local clone, GitHub Actions run logs and cache listing via gh
  • Human review: I have reviewed, tested, and verified the AI-generated content before submitting.

Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.

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)
@posit-snyk-bot

posit-snyk-bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cderv
cderv merged commit 21738d9 into v1.10 Oct 6, 2026
43 of 44 checks passed
@cderv
cderv deleted the backport/renv-cache-cancelled-save branch October 6, 2026 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants