rstudio / renv

renv: Project environments for R.
https://rstudio.github.io/renv/
MIT License
1.02k stars 154 forks source link

Feature Request: `renv::validate()` to check if current lock file is reproducible #2031

Open gowerc opened 1 week ago

gowerc commented 1 week ago

When using renv there are several ways that the user can shoot themselves in the foot and end up with an non-reproducible lock file. We most commonly see this when a user changes the repo URL to a posit-package-manager snapshot date that doesn't contain the versions of the packages that they have in their lock file or if they manually install a newer package without ensuring the repo URL is recorded.

It would be awesome to have a function that can check the state of the lockfile and throw an error if the lock file is in a broken state (e.g. unable to to find all the correct package versions). An added bonus would be if this checking process could be super light weight so that we could combine it with git hooks to check the project before a commit is made.

(Apologies if this functionality already exists and I missed it 🫣 )

kevinushey commented 6 days ago

This does not yet exist, but it does seem reasonable.