Move rmarkdown::render action to happen in a temp directory #330
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This resolves #329 (thanks @jcarbaut for the catch!)
Better detailed in the bug issue above, the issue is that when we called
rmarkdown::render
to render the report from an Rmd file within the installed package directory, it creates interim files within the installed package directory. This is technically a CRAN violation. It is rectified in line withrmarkdown
's recommendation for this issue which is to move all Rmd files to a temp directory and then callrmarkdown::render
there.Why didn't we catch this before?
My money is on:
pkgnet
as well as all test packages in a temporary directory for testing. Therefore, these modifications of the installed directory were happening within the temp directory, leaving the original directory untouched.Why didn't CRAN catch this before?
We have passed CRAN checks for years. My guess is that that our unique process of installing within a temp directory for testing is what allowed this error to go undetected.
For our unit tests, we now leverage
file.info()
to compare last modification date for the package directory (installed within a temporary directory) before and after testing. A change in this date can catch this error.