I have a question regarding best practices for deployment on RStudio Connect in combination with RStudio Package Manager (or any other internal package repo).
Our current design pattern for developing products in R mandates using R-packages for all content - e.g. all types of data science products, whether it's utility packages, RMarkdown reports, plumber APIs or Shiny Dashboards, should be encapsulated in a package to motivate environment encapsulation, tests, documentation and modularity. We use Golem for Shiny, and a modified setup for APIs/MDs, placing content files in inst/api or inst/markdown.
In my view, there's two options for deploying such content packages to Connect:
- Publish product packages to RSPM or repo. Only deploy content file to Connect (e.g. app.R, entrypoint.R, report.md) - the content file takes dependencies on the RSPM-package.This would require the package to live on RSPM, even for development and testing.
- Deploy the full package to Connect, and use pkgload::load_all or similar in the content-file. This will allow publishing the product directly to Connect without requiring putting the package on RSPM first.
Personally, I like option 1 best, as this seems to be more "pure" in terms of dependency separation, and also forcing users to put all packages on RSPM, which will allow for reuse of functions, etc. However, in the traditional DevOPS mindset, the deploy artifact seems to be the full software package.
Any thoughts would be appreciated!