Conversation
There was a problem hiding this comment.
Pull request overview
Adds an rv export renv workflow to generate an renv.lock-compatible JSON lockfile from an existing rv project (config + rv lockfile), including snapshot-based tests to validate the exported structure.
Changes:
- Implement
to_renv_lock()conversion fromLockfile+Configto a serializableRenvLock(including Git/GitHub/Local sources). - Add
rv export renv --output <path>CLI subcommand that writes the exportedrenv.lockJSON and surfaces mapping warnings. - Extend
Lockfile/public exports and add aninstasnapshot test for the exported lockfile.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/renv.rs | Adds renv lock export conversion logic and snapshot tests. |
| src/cli/commands/export.rs | New CLI command implementation for exporting renv.lock. |
| src/cli/commands/mod.rs | Wires new export command module into the CLI command set. |
| src/cli/mod.rs | Re-exports the new export_renv command. |
| src/main.rs | Adds Export -> Renv CLI plumbing and output formatting for warnings. |
| src/lockfile.rs | Adds getters needed by the exporter (packages(), r_version_string()). |
| src/lib.rs | Re-exports LockedPackage for use by the renv exporter. |
| src/snapshots/rv__renv__tests__renv_export.snap | Snapshot for the exported renv.lock JSON. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
My biggest question/concern is going to be around git handling and mapping it to renv such that renv itself properly restores the correct version. There is a specific edge case we hit in my vibe'd code as well of runiverse repos, since runiverse doesn't maintain an archive, it also inserts the git repo information to restore from there, so we should be able to support that. Anne hit that trying to export a shiny app to deploy to connect and then connect/renv/packrat couldn't find and restore that repo. Could we add a couple e2e test that do the full export to a renv lock, then allow renv to attempt to restore the packages and confirm that the restoration does match the expected package version. I think those could live in a separate area of e2e that gets run either manually or on some trigger only if code in specific file(s) changes since hopefully we kinda lock this code in and don't need to change it often/ever after |
where os-info is from our r-universe repo |
Uh oh!
There was an error while loading. Please reload this page.