ropensci / software-review

rOpenSci Software Peer Review.
286 stars 104 forks source link

rix: Reproducible Environments with Nix #624

Closed b-rodrigues closed 4 months ago

b-rodrigues commented 5 months ago

Submitting Author Name: Bruno Rodrigues Submitting Author Github Handle: !--author1-->@b-rodrigues<!--end-author1-- Other Package Authors Github handles: !--author-others-->@philipp-baumann<!--end-author-others-- Repository: https://github.com/b-rodrigues/rix Submission type: Pre-submission Language: en


Package: rix
Title: Rix: Reproducible Environments With Nix
Version: 0.5.1.9000
Authors@R: c(
    person("Bruno", "Rodrigues", , "bruno@brodrigues.co", role = c("aut", "cre"),
           comment = c(ORCID = "0000-0002-3211-3689")),
    person("Philipp", "Baumann", , "baumann-philipp@protonmail.com", role = "aut",
           comment = c(ORCID = "0000-0002-3194-8975"))
  )
Description: Provides helper functions to create reproducible development
    environments using the Nix package manager.
License: GPL (>= 3)
URL: https://b-rodrigues.github.io/rix/
BugReports: https://github.com/b-rodrigues/rix
Depends: 
    R (>= 2.10)
Imports: 
    codetools,
    httr,
    jsonlite,
    sys,
    utils
Suggests: 
    knitr,
    rmarkdown,
    stringr,
    testthat
VignetteBuilder: 
    knitr
Config/fusen/version: 0.5.2
Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3

Scope

The package's aim is to help users define reproducible development environment which can then be built using the Nix package manager. These environments will contain all the required software.

Anyone that needs reproducibility.

There is no other package, as far as we know, that accomplishes the same thing. This package generates Nix expressions and by itself will not generate the reproducible development environment. This environment will need to be built using Nix. To achieve the same thing, Docker+renv (for example) should be used.

Not applicable.

We will likely not be able to reach the 75% of unit test coverage. This is mainly for two reasons:

We were wondering if we could have an exemption of this requirement? We could likely install Nix on GA runners so that the tests that require Nix could pass, but I don't know if we could solve the issue with covr::package_coverage(). We use skip_covr() for now.

Here's the output of test coverage on GA:

> test_check("rix")
GitHub Actions workflow file save to: /tmp/Rtmp81tuqn
[ FAIL 0 | WARN 0 | SKIP 2 | PASS 10 ]

══ Skipped tests (2) ═══════════════════════════════════════════════════════════
• nix_shell_available() is not TRUE (1): 'test-find_rev.R:123:3'
• On covr (1): 'test-find_rev.R:97:3'

[ FAIL 0 | WARN 0 | SKIP 2 | PASS 10 ]
> 

Here's the coverage:

Running specific tests for package ‘rix’
  Running ‘testthat.R’
rix Coverage: 28.83%
R/find_rev.R: 26.95%
R/tar_nix_ga.R: 66.67%
R/detect_os.R: 75.00%
R/detect_versions.R: 100.00%

and here's the pkgcheck action complaining:

Running Pkgcheck...
Error: Package coverage is 28.8% (should be at least 75%).

If Nix is available, all tests pass locally with devtools::test(), but computing the coverage fails because of that one test that for some reason fails with covr::package_cover() (which now has a skip, as explained), if Nix is not available, the test that requires Nix gets also skipped.

b-rodrigues commented 5 months ago

We’ve added some more tests:

image

more than this will be tricky though.

jhollist commented 5 months ago

@b-rodrigues Just wanted to confirm that this is on our radar. {rix} looks really interesting.

The editorial board is having some discussions about the rix package and we will get back to you shortly!

b-rodrigues commented 5 months ago

Hi, thanks for letting us know! There's no rush we are still ironing out some bugs 🪲🪲

jhollist commented 5 months ago

@b-rodrigues We have had a chance to discuss your pre-submission inquiry. The gist of our discussion was that, {rix} looks really interesting and has an obvious use case for reproducibility, and {rix} best fit is in the workflow automation category.

We would like to invite you to make a full submission. A few things to keep in mind in that full submission.

First, as long as tests are adequate and they run locally, not running on CI is fine, just make sure to document how to demonstrate local coverage in the packages CONTRIBUTING. Second, it might be possible to add Nix to the RO build system but we would need to look a little more closely at it. @mpadge will be doing that and will follow up with you.

One quick logistical note, my stint as Editor in Chief has come to an end. @ldecicco-USGS just started her rotation and she will take over for me!

Thank you again for this pre-submission!