openpharma / staged.dependencies

R package to implement development stages for package development
https://openpharma.github.io/staged.dependencies/
MIT License
12 stars 3 forks source link

More easily handle case where repos are split between two remotes #142

Open nikolas-burkoff opened 2 years ago

nikolas-burkoff commented 2 years ago

Normally you can install the whole of your internal packages by doing the following:

x <- dependency_table("path/to/any_repo@https://remote.com", "repo@host", ref = "main")
install_deps(x, direction = "all")

But if your internal dependency packages are split between two different remotes one which is public and one which is private - so that the staged.dependency.yaml files in the public remote never reference those on the private remote then it's not as easy to install everything:

If t.c.1, t.c.2 and h.r are packages on the private remote (not connected via staged.deps yaml files) and t.m.h is a package in the public remote then you need to do the following:

x <- dependency_table("ie/t.m.h@https://public.com", "repo@host", ref = "main")
install_deps(x, direction = "all")

lapply(c("t.c.1", "t.c.2", "h.r"), function(pkg){
  x <- dependency_table(paste0(pkg, "@https://private.com", "repo@host", ref = "main")
  install_deps(x, direction = "all") # won't reinstall already installed packages
})

This could be simplified?