Skip to content

Fail early when renv packages are not synchronized after restore in CI#14424

Merged
cderv merged 1 commit intomainfrom
fix/renv-restore-fail-early
Apr 23, 2026
Merged

Fail early when renv packages are not synchronized after restore in CI#14424
cderv merged 1 commit intomainfrom
fix/renv-restore-fail-early

Conversation

@cderv
Copy link
Copy Markdown
Member

@cderv cderv commented Apr 23, 2026

When renv::restore() encounters network errors (e.g. the package manager returning HTTP errors for binary packages), it can complete without failing even though some packages were not properly installed. Downstream test steps then fail with cryptic errors like object 'select' not found whilst loading namespace 'dplyr'.

Fix

Add renv::status() after the restore call and exit with status 1 if $synchronized is not TRUE. This surfaces the installation failure at the right point rather than letting the workflow continue with a broken R library.

When renv::restore() encounters network errors (e.g. package manager
returning HTTP errors), it can complete without failing even though some
packages were not properly installed. Downstream steps then fail with
cryptic errors like missing package functions.

Add renv::status() after restore and exit with status 1 if the library
is not synchronized with the lockfile, surfacing the failure at the
right point rather than later in the test run.
@cderv cderv merged commit 2355f22 into main Apr 23, 2026
51 checks passed
@cderv cderv deleted the fix/renv-restore-fail-early branch April 23, 2026 18:53
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.

1 participant