Skip to content

Commit

Permalink
Merge pull request #20 from r-multiverse/rebrand
Browse files Browse the repository at this point in the history
Rename and rebrand
  • Loading branch information
wlandau committed Mar 21, 2024
2 parents 09ef891 + 0523518 commit d5228b0
Show file tree
Hide file tree
Showing 23 changed files with 107 additions and 112 deletions.
1 change: 0 additions & 1 deletion .lintr
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ linters: linters_with_defaults(
object_length_linter = NULL,
object_name_linter = NULL,
object_usage_linter = NULL)
exclusions: list("inst/pipelines/use_targets.R", "R/class_database.R")
12 changes: 6 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Package: r.releases.internals
Title: Internal Infrastructure for An R Universe of Package Releases
Description: Internal infrastructure for an R universe of package releases.
Version: 0.0.16
Package: multiverse.internals
Title: Internal Infrastructure for R-multiverse
Description: Internal Infrastructure for R-multiverse
Version: 0.1.0
License: MIT + file LICENSE
URL: https://github.com/r-releases/r.releases.internals
BugReports: https://github.com/r-releases/r.releases.internals/issues
URL: https://github.com/r-multiverse/multiverse.internals
BugReports: https://github.com/r-multiverse/multiverse.internals/issues
Authors@R: c(
person(
given = c("William", "Michael"),
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

export(aggregate_listings)
export(assert_cran_url)
export(assert_package)
export(assert_release_exists)
Expand All @@ -8,7 +9,6 @@ export(record_versions)
export(review_pull_request)
export(review_pull_requests)
export(try_message)
export(write_universe_manifest)
importFrom(gh,gh)
importFrom(jsonlite,parse_json)
importFrom(jsonlite,read_json)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# multiverse.internals 0.1.0

* Rename the package to `multiverse.internals`.

# r.releases.internals 0.0.16

* Retry failed merge attempts.
Expand Down
35 changes: 18 additions & 17 deletions R/write_universe_manifest.R → R/aggregate_listings.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#' @title Build the `packages.json` manifest for the universe.
#' @title Build an R-universe `packages.json` manifest from a collection of
#' text file contributions with individual package URLs.
#' @export
#' @keywords internal
#' @description Create the R-universe `packages.json` file
#' from constituent text files with URLs.
#' @description Build an R-universe `packages.json` manifest from a collection
#' of text file contributions with individual package URLs.
#' @return NULL (invisibly)
#' @param input Character of length 1, directory path with the
#' text file listings of R releases.
Expand All @@ -11,7 +12,7 @@
#' @param release_exceptions Character vector of URLs of GitHub owners
#' where `"branch": "*release"` should be omitted. Example:
#' `"https://github.com/cran"`.
write_universe_manifest <- function(
aggregate_listings <- function(
input = getwd(),
output = "packages.json",
release_exceptions = character(0L)
Expand All @@ -20,14 +21,14 @@ write_universe_manifest <- function(
assert_character_scalar(output, "invalid output")
assert_file(input)
packages <- list.files(input, all.files = FALSE, full.names = TRUE)
message("Processing ", length(packages), " package entries.")
entries <- lapply(
message("Processing ", length(packages), " package listings.")
listings <- lapply(
X = packages,
FUN = read_package_entry,
FUN = read_package_listing,
release_exceptions = release_exceptions
)
message("Aggregating ", length(entries), " package entries.")
aggregated <- do.call(what = vctrs::vec_rbind, args = entries)
message("Aggregating ", length(listings), " package listings.")
aggregated <- do.call(what = vctrs::vec_rbind, args = listings)
if (!file.exists(dirname(output))) {
dir.create(dirname(output))
}
Expand All @@ -36,23 +37,23 @@ write_universe_manifest <- function(
invisible()
}

read_package_entry <- function(package, release_exceptions) {
message("Processing package entry ", package)
read_package_listing <- function(package, release_exceptions) {
message("Processing package listing ", package)
name <- trimws(basename(package))
lines <- readLines(con = package, warn = FALSE)
json <- try(jsonlite::parse_json(lines), silent = TRUE)
if (inherits(json, "try-error")) {
json <- package_entry_url(name = name, url = lines)
json <- package_listing_url(name = name, url = lines)
} else {
json <- package_entry_json(name = name, json = json)
json <- package_listing_json(name = name, json = json)
}
decide_release_exceptions(
json = json,
release_exceptions = release_exceptions
)
}

package_entry_url <- function(name, url) {
package_listing_url <- function(name, url) {
message <- assert_package_lite(name = name, url = url)
if (!is.null(message)) {
stop(message, call. = FALSE)
Expand All @@ -64,15 +65,15 @@ package_entry_url <- function(name, url) {
)
}

package_entry_json <- function(name, json) {
package_listing_json <- function(name, json) {
fields <- names(json)
good_fields <- identical(
sort(fields),
sort(c("package", "url", "branch", "subdir"))
)
if (!good_fields) {
stop(
"Custom JSON entry for package ",
"Custom JSON listing for package ",
shQuote(name),
" must have fields 'packages', 'url', 'branch', and 'subdir' ",
"and no other fields.",
Expand Down Expand Up @@ -100,7 +101,7 @@ package_entry_json <- function(name, json) {
message = paste(
"Invalid value in field",
shQuote(field),
"in the JSON entry for package name",
"in the JSON listing for package name",
shQuote(name)
)
)
Expand Down
2 changes: 1 addition & 1 deletion R/assert_release_exists.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ no_release_message <- function(url) {
paste0(
"No full release found at URL ",
shQuote(url),
".\n\nThe R-releases project relies on GitHub/GitLab releases ",
".\n\nThe R-multiverse project relies on GitHub/GitLab releases ",
"to distribute deployed versions of R packages, so we must ",
"ask that each contributed package host a release for its ",
"latest non-development version.\n\n",
Expand Down
7 changes: 3 additions & 4 deletions R/package.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#' r.releases.internals: Internal infrastructure for an R universe
#' of package releases.
#' @description Utilities for an R universe of package releases.
#' @name r.releases.internals-package
#' multiverse.internals: Internal Infrastructure for R-multiverse.
#' @description Internal Infrastructure for R-multiverse.
#' @name multiverse.internals-package
#' @family help
#' @importFrom gh gh
#' @importFrom jsonlite parse_json read_json stream_in write_json
Expand Down
6 changes: 3 additions & 3 deletions R/record_versions.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
record_versions <- function(
manifest = "versions.json",
issues = "version_issues.json",
repo = "https://r-releases.r-universe.dev",
current = r.releases.internals::get_current_versions(repo = repo)
repo = "https://r-multiverse.r-universe.dev",
current = multiverse.internals::get_current_versions(repo = repo)
) {
if (!file.exists(manifest)) {
jsonlite::write_json(x = current, path = manifest, pretty = TRUE)
Expand All @@ -43,7 +43,7 @@ record_versions <- function(
#' @return A data frame of packages with their current versions and hashes.
#' @inheritParams record_versions
get_current_versions <- function(
repo = "https://r-releases.r-universe.dev"
repo = "https://r-multiverse.r-universe.dev"
) {
listing <- file.path(
contrib.url(repos = repo, type = "source"),
Expand Down
8 changes: 4 additions & 4 deletions R/review_pull_request.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#' @param number Positive integer of length 1, index of the pull request
#' in the repo.
review_pull_request <- function(
owner = "r-releases",
owner = "r-multiverse",
repo = "contributions",
number
) {
Expand Down Expand Up @@ -155,7 +155,7 @@ pull_request_defer <- function(owner, repo, number, message) {
body = paste0(
message,
"\n\nThis pull request has been marked for manual review. ",
"Please either wait for an R-releases moderator to review, ",
"Please either wait for an R-multiverse moderator to review, ",
"or close this pull request and open a different one ",
"which passes automated checks."
)
Expand Down Expand Up @@ -215,9 +215,9 @@ pull_request_merge <- function(owner, repo, number) {
number = number,
body = paste(
"This pull request was automatically merged",
"to incorporate new packages into R-releases.",
"to incorporate new packages into R-multiverse.",
"An automated GitHub actions job will deploy the packages",
"as described at https://r-releases.github.io/.",
"as described at https://r-multiverse.github.io/.",
"Thank you for your contribution."
)
)
Expand Down
2 changes: 1 addition & 1 deletion R/review_pull_requests.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @return `NULL` (invisibly).
#' @inheritParams review_pull_request
review_pull_requests <- function(
owner = "r-releases",
owner = "r-multiverse",
repo = "contributions"
) {
assert_character_scalar(owner)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# `r.releases.internals`
# `multiverse.internals`

[![check](https://github.com/r-releases/r.releases.internals/actions/workflows/check.yaml/badge.svg)](https://github.com/r-releases/r.releases.internals/actions?query=workflow%3Acheck)
[![lint](https://github.com/r-releases/r.releases.internals/actions/workflows/lint.yaml/badge.svg)](https://github.com/r-releases/r.releases.internals/actions?query=workflow%3Alint)
[![check](https://github.com/r-multiverse/multiverse.internals/actions/workflows/check.yaml/badge.svg)](https://github.com/r-multiverse/multiverse.internals/actions?query=workflow%3Acheck)
[![lint](https://github.com/r-multiverse/multiverse.internals/actions/workflows/lint.yaml/badge.svg)](https://github.com/r-multiverse/multiverse.internals/actions?query=workflow%3Alint)

`r.releases.internals` is an R package to support the internal infrastructure for the R-releases project.
`multiverse.internals` is an R package to support the internal infrastructure for the R-multiverse project.

For all matters please refer to <https://r-releases.github.io/>.
For all matters please refer to <https://r-multiverse.github.io/>.
15 changes: 8 additions & 7 deletions man/write_universe_manifest.Rd → man/aggregate_listings.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_current_versions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions man/multiverse.internals-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions man/r.releases.internals-package.Rd

This file was deleted.

4 changes: 2 additions & 2 deletions man/record_versions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/review_pull_request.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/review_pull_requests.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
12 changes: 2 additions & 10 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
# This file is part of the standard setup for testthat.
# It is recommended that you do not modify it.
#
# Where should you do additional test configuration?
# Learn more about the roles of various files in:
# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
# * https://testthat.r-lib.org/articles/special-files.html

library(testthat)
library(r.releases.internals)
library(multiverse.internals)

test_check("r.releases.internals")
test_check("multiverse.internals")
Loading

0 comments on commit d5228b0

Please sign in to comment.