PredictiveEcology/SpaDES

better versioning of parent modules

achubaty opened this issue · 4 comments

I ran into this issue while dealing with #319.

For non-parent modules (i.e., child modules), it is straightforward to download a particular version of a module, which is essential for reproducibility.

downloadModule("fireSpeadLcc", version = "1.1.0") ## always get v1.1.0
downloadModule("fireSpeadLcc", version = "1.1.1") ## always get v1.1.1

But the version for a parent module doesn't quite work the same way, because we are not tracking the versions of the children!

downloadModule("LCC2005", version = "1.1.1") ## always get v1.1.1 of parent
                                             ## but unknown versions of children!

While this does retrieve v1.1.1 of the parent module, depending on when it's run you will get different child module versions (because parent modules always download the most recent version of their children). This morning you would get fireSpreadLcc v1.1.0 but this afternoon that child module was bumped to v1.1.1.

This means that using parent modules is currently irreproducible out-of-the-box!

@eliotmcintire we need to record the version of the children in the parent module's metadata, which will require several tweaks:

  1. using the existing version slot, allow a named list/vector of numeric_versions to be stored
  2. ensure that downloadModule properly matches child version to that read from the parent's metadata

using a named list for versions also allows us to include the SpaDES version:

version = list(SpaDES = '1.3.1.9017', child1 = '0.1.0', child2 = '0.2.1', ...)

since we currently aren't enforcing the SpaDES version , this provides a better mechanism to do so.

@eliotmcintire Implemented in SpaDES but not yet implemented for the modules in the SpaDES-modules repo (it is backwards compatible, but we shouldn't update the modules until the CRAN version of the package is updated).

Also TO DO: implement a nice way to use the version info from the module metadata and implement strict checking of parent/child versions. Currently, it's possible to download the correct module versions but then if the user or another module updates one of the child modules, running the parent won't catch the change.

This issue was moved to PredictiveEcology/SpaDES.core#31