Skip to contents

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.

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. For a complete list of checks, see the issues_*() functions listed at https://r-multiverse.org/multiverse.internals/reference/index.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\": \"autometric\","                                  
#>  [4] "    \"version_current\": \"0.1.2.9000\","                          
#>  [5] "    \"hash_current\": \"13ec8d2cfba955081cf3e19eb5e74af07ba89bef\""
#>  [6] "  },"                                                              
#>  [7] "  {"                                                               
#>  [8] "    \"package\": \"crew\","                                        
#>  [9] "    \"version_current\": \"0.10.2.9000\","                         
#> [10] "    \"hash_current\": \"04beece4e8b12a24ff004e48c1398a9843324a64\""
#> [11] "  },"                                                              
#> [12] "  {"                                                               
#> [13] "    \"package\": \"crew.aws.batch\","                              
#> [14] "    \"version_current\": \"0.0.7\","                               
#> [15] "    \"hash_current\": \"fc331371bc8c3f7722229849d77be0a031f34bdd\""
#> [16] "  },"                                                              
#> [17] "  {"                                                               
#> [18] "    \"package\": \"crew.cluster\","                                
#> [19] "    \"version_current\": \"0.3.3\","                               
#> [20] "    \"hash_current\": \"ffa70aa9f5f2b9ca512223c7bd66c71c5d3cef1b\""
#> [21] "  },"                                                              
#> [22] "  {"                                                               
#> [23] "    \"package\": \"mirai\","                                       
#> [24] "    \"version_current\": \"1.3.1.9000\","                          
#> [25] "    \"hash_current\": \"a40319e456cdf1f685d40c1845071ba7dd8d4da3\""
#> [26] "  },"                                                              
#> [27] "  {"                                                               
#> [28] "    \"package\": \"nanonext\","                                    
#> [29] "    \"version_current\": \"1.3.2.9000\","                          
#> [30] "    \"hash_current\": \"d713c85d02f1b9fac92796de78256b4d6c571a8a\""
#> [31] "  }"                                                               
#> [32] "]"                                                                 
  # In subsequent snapshots, we have historical information about versions.
  record_versions(
    versions = versions,
    repo = repo
  )
  readLines(versions)
#>  [1] "["                                                                  
#>  [2] "  {"                                                                
#>  [3] "    \"package\": \"autometric\","                                   
#>  [4] "    \"version_current\": \"0.1.2.9000\","                           
#>  [5] "    \"hash_current\": \"13ec8d2cfba955081cf3e19eb5e74af07ba89bef\","
#>  [6] "    \"version_highest\": \"0.1.2.9000\","                           
#>  [7] "    \"hash_highest\": \"13ec8d2cfba955081cf3e19eb5e74af07ba89bef\"" 
#>  [8] "  },"                                                               
#>  [9] "  {"                                                                
#> [10] "    \"package\": \"crew\","                                         
#> [11] "    \"version_current\": \"0.10.2.9000\","                          
#> [12] "    \"hash_current\": \"04beece4e8b12a24ff004e48c1398a9843324a64\","
#> [13] "    \"version_highest\": \"0.10.2.9000\","                          
#> [14] "    \"hash_highest\": \"04beece4e8b12a24ff004e48c1398a9843324a64\"" 
#> [15] "  },"                                                               
#> [16] "  {"                                                                
#> [17] "    \"package\": \"crew.aws.batch\","                               
#> [18] "    \"version_current\": \"0.0.7\","                                
#> [19] "    \"hash_current\": \"fc331371bc8c3f7722229849d77be0a031f34bdd\","
#> [20] "    \"version_highest\": \"0.0.7\","                                
#> [21] "    \"hash_highest\": \"fc331371bc8c3f7722229849d77be0a031f34bdd\"" 
#> [22] "  },"                                                               
#> [23] "  {"                                                                
#> [24] "    \"package\": \"crew.cluster\","                                 
#> [25] "    \"version_current\": \"0.3.3\","                                
#> [26] "    \"hash_current\": \"ffa70aa9f5f2b9ca512223c7bd66c71c5d3cef1b\","
#> [27] "    \"version_highest\": \"0.3.3\","                                
#> [28] "    \"hash_highest\": \"ffa70aa9f5f2b9ca512223c7bd66c71c5d3cef1b\"" 
#> [29] "  },"                                                               
#> [30] "  {"                                                                
#> [31] "    \"package\": \"mirai\","                                        
#> [32] "    \"version_current\": \"1.3.1.9000\","                           
#> [33] "    \"hash_current\": \"a40319e456cdf1f685d40c1845071ba7dd8d4da3\","
#> [34] "    \"version_highest\": \"1.3.1.9000\","                           
#> [35] "    \"hash_highest\": \"a40319e456cdf1f685d40c1845071ba7dd8d4da3\"" 
#> [36] "  },"                                                               
#> [37] "  {"                                                                
#> [38] "    \"package\": \"nanonext\","                                     
#> [39] "    \"version_current\": \"1.3.2.9000\","                           
#> [40] "    \"hash_current\": \"d713c85d02f1b9fac92796de78256b4d6c571a8a\","
#> [41] "    \"version_highest\": \"1.3.2.9000\","                           
#> [42] "    \"hash_highest\": \"d713c85d02f1b9fac92796de78256b4d6c571a8a\"" 
#> [43] "  }"                                                                
#> [44] "]"