Skip to contents

Check package version number history for compliance.

Usage

issues_versions(versions)

Arguments

versions

Character of length 1, file path to a JSON manifest tracking the history of released versions of packages. The official versions file for R-multiverse is maintained and updated periodically at https://github.com/r-multiverse/checks/blob/main/versions.json.

Value

A named list of information about packages which do not comply with version number history checks. Each name is a package name, and each element contains specific information about version non-compliance: the current version number, the current version hash, and the analogous versions and hashes of the highest-versioned release recorded.

Details

This function checks the version number history of packages in R-multiverse and reports any packages with issues. The current released version of a given package must be unique, and it must be greater than all the versions of all the previous package releases.

Package issues

Functions like issues_versions() and issues_descriptions() perform health checks for all packages in R-multiverse. Only packages that pass these checks go to the production repository at https://production.r-multiverse.org. For a complete list of checks, see the issues_*() functions listed at https://r-multiverse.org/multiverse.internals/reference.html. record_versions() updates the version number history of releases in R-multiverse, and record_issues() gathers together all the issues about R-multiverse packages.

See also

Examples

  # See https://github.com/r-multiverse/checks/blob/main/versions.json
  # for the official versions JSON for R-multiverse.
  lines <- c(
    "[",
    " {",
    " \"package\": \"package_unmodified\",",
    " \"version_current\": \"1.0.0\",",
    " \"hash_current\": \"hash_1.0.0\",",
    " \"version_highest\": \"1.0.0\",",
    " \"hash_highest\": \"hash_1.0.0\"",
    " },",
    " {",
    " \"package\": \"version_decremented\",",
    " \"version_current\": \"0.0.1\",",
    " \"hash_current\": \"hash_0.0.1\",",
    " \"version_highest\": \"1.0.0\",",
    " \"hash_highest\": \"hash_1.0.0\"",
    " },",
    " {",
    " \"package\": \"version_incremented\",",
    " \"version_current\": \"2.0.0\",",
    " \"hash_current\": \"hash_2.0.0\",",
    " \"version_highest\": \"2.0.0\",",
    " \"hash_highest\": \"hash_2.0.0\"",
    " },",
    " {",
    " \"package\": \"version_unmodified\",",
    " \"version_current\": \"1.0.0\",",
    " \"hash_current\": \"hash_1.0.0-modified\",",
    " \"version_highest\": \"1.0.0\",",
    " \"hash_highest\": \"hash_1.0.0\"",
    " }",
    "]"
  )
  versions <- tempfile()
  writeLines(lines, versions)
  out <- issues_versions(versions)
  str(out)
#> List of 2
#>  $ version_decremented:List of 4
#>   ..$ version_current: chr "0.0.1"
#>   ..$ hash_current   : chr "hash_0.0.1"
#>   ..$ version_highest: chr "1.0.0"
#>   ..$ hash_highest   : chr "hash_1.0.0"
#>  $ version_unmodified :List of 4
#>   ..$ version_current: chr "1.0.0"
#>   ..$ hash_current   : chr "hash_1.0.0-modified"
#>   ..$ version_highest: chr "1.0.0"
#>   ..$ hash_highest   : chr "hash_1.0.0"