Repository navigation
fix: restore renv lockfiles from their own repositories - #58
Merged
Merged
Conversation
A global repos override made renv ignore the lockfile's repositories, so packages from r-universe or internal repos failed to restore. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Also keep non-CRAN Posit Package Manager repositories, such as Bioconductor. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
renv restores those with git too. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
The Dockerfile set
RENV_CONFIG_REPOS_OVERRIDEto the Posit Package Manager CRAN URL, sorenv::restore()ignored every repository in the lockfile. Packages from r-universe, Bioconductor or an internal CRAN-like repo failed to restore. The image also had nogit, which renv needs for packages from a git remote.ENV R_REPO, and used by the base install,install_deps_line()and the restore..../cran/...on packagemanager.posit.co or p3m.dev) withR_REPO, so they still install RHEL 9 binaries; other repositories are kept. A lockfile with no CRAN entry getsR_REPOas CRAN.gitis installed only when the lockfile has a package from a git remote (Source: git, orRemoteTypegit,xgitorgit2r, which renv treats as git).renvadded to Suggests, for the test that mocksrenv::restore().Related GitHub Issues and PRs
Are these changes tested?
Yes. New tests run the generated restore code with
renv::restore()mocked and check the repositories it gets: CRAN replaced and r-universe kept; a PPM entry for another OS (jammy) replaced; a PPM Bioconductor entry kept;R_REPOadded when there is no CRAN entry.lockfile_has_git()is tested for each git form. The Docker image test (R2LAMBDA_TEST_DOCKER=true) was not run; it builds an image from a pinned renv.lock and is worth running before merge.Are there any user-facing changes?
Yes. renv lockfiles with non-CRAN repositories or git remotes now restore.
Was AI used for this PR?
In accordance with the AI generation guidelines, please disclose whether and how AI was used in this PR.
PR code and description written by:
Reviewed before submission by:
Checklist
fix:,feat:,docs:, ...); it becomes theNEWS.mdentry.air format .andjarl check ..devtools::document()if documentation changed.testthatunit tests totests/testthatfor any new functionality or fixed bug.Assisted-by: Claude Code