Skip to content

per-package interactive recovery in restore()#2216

Closed
kevinushey wants to merge 6 commits intomainfrom
feature/restore-interactive-recovery
Closed

per-package interactive recovery in restore()#2216
kevinushey wants to merge 6 commits intomainfrom
feature/restore-interactive-recovery

Conversation

@kevinushey
Copy link
Copy Markdown
Collaborator

Summary

  • When a package fails during an interactive restore() (prompt = TRUE), the user is now prompted with a menu offering three choices: install the latest version, skip the package, or cancel the restore.
  • Adds continue parameter to restore() for non-interactive error accumulation (reports all failures at the end).
  • Handler selection: prompt = TRUE → interactive recovery menu; continue = TRUE → accumulate errors; neither → immediate error (existing default).

Closes #1893

Test plan

  • New test: "restore prompts for recovery on failure when prompt = TRUE" — verifies skip path via renv.menu.choice = 2L
  • New test: "restore recovery can install latest version" — verifies install-latest path via renv.menu.choice = 1L
  • New test: "restore recovery can cancel the restore" — verifies cancel path via renv.menu.choice = 3L
  • Manual test: run renv::restore() interactively after upgrading R with a lockfile containing an old package version

When a package fails during an interactive restore (prompt = TRUE),
the user is now prompted with a menu to install the latest version,
skip the package, or cancel the restore. This is useful after R
upgrades when old package versions may no longer compile.

The handler selection follows three modes:
- prompt = TRUE: per-package interactive recovery menu
- continue = TRUE: accumulate errors, report at end
- neither: error propagates immediately (existing default)

Closes #1893
The interactive recovery menu now includes a fourth choice allowing the
user to enter a version number (e.g. "1.2.0") or an arbitrary remote
(e.g. "user/repo") to install when a package fails to restore.
@kevinushey
Copy link
Copy Markdown
Collaborator Author

This PR won't be compatible with the new parallel installation code; we'll need to rework this.

@kevinushey kevinushey closed this Feb 23, 2026
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.

Allow renv::restore to help updating packages when restore fails

1 participant