Record the manifest of versions of packages and their hashes.
Usage
record_versions(
versions = "versions.json",
repo = "https://community.r-multiverse.org",
current = multiverse.internals::get_current_versions(repo = repo)
)
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.
- repo
Character of length 1, URL of the package repository. R-multiverse uses
"https://community.r-multiverse.org"
.- current
A data frame of current versions and hashes of packages in
repo
. This argument is exposed for testing only.
Value
NULL
(invisibly). Writes a package version manifest
and a manifest of version issues as JSON files.
Details
This function tracks a manifest containing the current version,
the current hash, the highest version ever released, and
the hash of the highest version ever released.
issues_versions()
uses this information
to determine whether the package complies with best
practices for version numbers.
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.
Examples
# R-multiverse uses https://community.r-multiverse.org as the repo.
repo <- "https://wlandau.r-universe.dev" # just for testing and examples
output <- tempfile()
versions <- tempfile()
# First snapshot:
record_versions(
versions = versions,
repo = repo
)
readLines(versions)
#> [1] "["
#> [2] " {"
#> [3] " \"package\": \"crew\","
#> [4] " \"version_current\": \"0.9.5\","
#> [5] " \"hash_current\": \"8ca02085fb1880ad87788bd1eb0ca331da69e60e\""
#> [6] " },"
#> [7] " {"
#> [8] " \"package\": \"crew.aws.batch\","
#> [9] " \"version_current\": \"0.0.5.9000\","
#> [10] " \"hash_current\": \"4d9e5b44e2942d119af963339c48d134e84de458\""
#> [11] " },"
#> [12] " {"
#> [13] " \"package\": \"crew.cluster\","
#> [14] " \"version_current\": \"0.3.1\","
#> [15] " \"hash_current\": \"1adfcebbb02bd06e4687e11f1fedfa238e822433\""
#> [16] " },"
#> [17] " {"
#> [18] " \"package\": \"mirai\","
#> [19] " \"version_current\": \"1.1.0.9007\","
#> [20] " \"hash_current\": \"a60b4d30e70159dcd5faa5ba58f02bdeb83de67a\""
#> [21] " },"
#> [22] " {"
#> [23] " \"package\": \"nanonext\","
#> [24] " \"version_current\": \"1.1.1.9000\","
#> [25] " \"hash_current\": \"a7d19f4789fd2d39f34170c238838a144af4377c\""
#> [26] " }"
#> [27] "]"
# In subsequent snapshots, we have historical information about versions.
record_versions(
versions = versions,
repo = repo
)
readLines(versions)
#> [1] "["
#> [2] " {"
#> [3] " \"package\": \"crew\","
#> [4] " \"version_current\": \"0.9.5\","
#> [5] " \"hash_current\": \"8ca02085fb1880ad87788bd1eb0ca331da69e60e\","
#> [6] " \"version_highest\": \"0.9.5\","
#> [7] " \"hash_highest\": \"8ca02085fb1880ad87788bd1eb0ca331da69e60e\""
#> [8] " },"
#> [9] " {"
#> [10] " \"package\": \"crew.aws.batch\","
#> [11] " \"version_current\": \"0.0.5.9000\","
#> [12] " \"hash_current\": \"4d9e5b44e2942d119af963339c48d134e84de458\","
#> [13] " \"version_highest\": \"0.0.5.9000\","
#> [14] " \"hash_highest\": \"4d9e5b44e2942d119af963339c48d134e84de458\""
#> [15] " },"
#> [16] " {"
#> [17] " \"package\": \"crew.cluster\","
#> [18] " \"version_current\": \"0.3.1\","
#> [19] " \"hash_current\": \"1adfcebbb02bd06e4687e11f1fedfa238e822433\","
#> [20] " \"version_highest\": \"0.3.1\","
#> [21] " \"hash_highest\": \"1adfcebbb02bd06e4687e11f1fedfa238e822433\""
#> [22] " },"
#> [23] " {"
#> [24] " \"package\": \"mirai\","
#> [25] " \"version_current\": \"1.1.0.9007\","
#> [26] " \"hash_current\": \"a60b4d30e70159dcd5faa5ba58f02bdeb83de67a\","
#> [27] " \"version_highest\": \"1.1.0.9007\","
#> [28] " \"hash_highest\": \"a60b4d30e70159dcd5faa5ba58f02bdeb83de67a\""
#> [29] " },"
#> [30] " {"
#> [31] " \"package\": \"nanonext\","
#> [32] " \"version_current\": \"1.1.1.9000\","
#> [33] " \"hash_current\": \"a7d19f4789fd2d39f34170c238838a144af4377c\","
#> [34] " \"version_highest\": \"1.1.1.9000\","
#> [35] " \"hash_highest\": \"a7d19f4789fd2d39f34170c238838a144af4377c\""
#> [36] " }"
#> [37] "]"