Fix an issue where Packrat would fail to restore packages from subdirectories of repositories.
Approach
There were a few complex nested calls to as.data.frame(), c(), and list() spread across getSourceForPkgRecord() that I attempted to simplify in an earlier update. I simplified them incorrectly, causing subdir properties to be dropped.
Because we don't have end-to-end tests set up, and this transformation was part of a long function, no tests caught the issue. I moved the transformations into their own function and added unit tests.
Stepping back, this problem stems from the overall complexity of Packrat's workflows. This solution does not directly address the complexity. It adds a bit of indirection to make the outer-level workflow clearer, but it doesn't reduce the overall complexity of the data flows in the restore process.
QA Notes
End-to-end validation should involve restoring a Packrat environment that contains a package in a subdirectory. I have already tested that myself, and I'll walk through it with the package's maintainers before this merges.
Intent
Fix an issue where Packrat would fail to restore packages from subdirectories of repositories.
Approach
There were a few complex nested calls to
as.data.frame()
,c()
, andlist()
spread acrossgetSourceForPkgRecord()
that I attempted to simplify in an earlier update. I simplified them incorrectly, causingsubdir
properties to be dropped.Because we don't have end-to-end tests set up, and this transformation was part of a long function, no tests caught the issue. I moved the transformations into their own function and added unit tests.
Stepping back, this problem stems from the overall complexity of Packrat's workflows. This solution does not directly address the complexity. It adds a bit of indirection to make the outer-level workflow clearer, but it doesn't reduce the overall complexity of the data flows in the restore process.
QA Notes
End-to-end validation should involve restoring a Packrat environment that contains a package in a subdirectory. I have already tested that myself, and I'll walk through it with the package's maintainers before this merges.