-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
385 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#' @title Report issues from R-universe package check results. | ||
#' @export | ||
#' @family issues | ||
#' @description Check R-universe package check results. | ||
#' @details [issues_checks()] function scrapes the R-universe check API | ||
#' to scan all R-multiverse packages for issues that may have | ||
#' happened during building and testing. | ||
#' @inheritSection record_issues Package issues | ||
#' @return A named list of information about packages which do not comply | ||
#' with `DESCRPTION` checks. Each name is a package name, | ||
#' and each element contains specific information about | ||
#' non-compliance. | ||
#' @param meta A data frame with R-universe package check results | ||
#' returned by [meta_checks()]. | ||
#' @examples | ||
#' meta <- meta_checks(repo = "https://wlandau.r-universe.dev") | ||
#' issues <- issues_checks(meta = meta) | ||
#' str(issues) | ||
issues_checks <- function(meta) { | ||
fields_check <- c( | ||
"_linuxdevel", | ||
"_macbinary", | ||
"_wasmbinary", | ||
"_winbinary", | ||
"_status" | ||
) | ||
fields_info <- c( | ||
"_buildurl" | ||
) | ||
fields <- c(fields_check, fields_info) | ||
for (field in fields) { | ||
meta[[field]][is.na(meta[[field]])] <- "src-failure" | ||
} | ||
success <- rep(TRUE, nrow(meta)) | ||
for (field in fields_check) { | ||
success <- success & (meta[[field]] %in% c("success", "skipped")) | ||
} | ||
meta <- meta[!success,, drop = FALSE] # nolint | ||
issues_list(meta[, c("package", fields)]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#' @title Check package `DESCRIPTION` files. | ||
#' @export | ||
#' @family issues | ||
#' @description Check the `DESCRIPTION` files of packages for specific | ||
#' issues. | ||
#' @details This function scrapes the `src/contrib/PACKAGES.json` file | ||
#' of the universe to check the data in the `DESCRIPTION` files of packages | ||
#' for compliance. Right now, the only field checked is `Remotes:`. | ||
#' A packages with a `Remotes:` field in the `DESCRIPTION` file may | ||
#' depend on development versions of other packages and so are | ||
#' excluded from the production universe. | ||
#' @inheritSection record_issues Package issues | ||
#' @return A named list of information about packages which do not comply | ||
#' with `DESCRPTION` checks. Each name is a package name, | ||
#' and each element contains specific information about | ||
#' non-compliance. | ||
#' @param meta A data frame of package metadata returned by [meta_packages()]. | ||
#' @examples | ||
#' meta <- meta_packages(repo = "https://wlandau.r-universe.dev") | ||
#' issues <- issues_descriptions(meta = meta) | ||
#' str(issues) | ||
issues_descriptions <- function(meta) { | ||
meta <- issues_descriptions_remotes(meta) | ||
fields <- "remotes" | ||
meta <- meta[, c("package", fields)] | ||
issues_list(meta) | ||
} | ||
|
||
issues_descriptions_remotes <- function(meta) { | ||
meta$remotes <- meta$remotes %|||% replicate(nrow(meta), NULL) | ||
meta$remotes <- lapply(meta$remotes, function(x) x[nzchar(x)]) | ||
meta[vapply(meta$remotes, length, integer(1L)) > 0L, ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#' @title List metadata about R-universe package checks | ||
#' @export | ||
#' @family list | ||
#' @description List package checks results reported by the | ||
#' R-universe package API. | ||
#' @return A data frame with one row per package and columns with | ||
#' package check results. | ||
#' @param repo Character of length 1, URL of the package repository. | ||
#' R-multiverse uses `"https://multiverse.r-multiverse.org"`. | ||
#' @examples | ||
#' meta_checks(repo = "https://wlandau.r-universe.dev") | ||
meta_checks <- function(repo = "https://multiverse.r-multiverse.org") { | ||
fields <- c( | ||
"_buildurl", | ||
"_linuxdevel", | ||
"_macbinary", | ||
"_wasmbinary", | ||
"_winbinary", | ||
"_status" | ||
) | ||
listing <- file.path( | ||
repo, | ||
"api", | ||
paste0("packages?stream=true&fields=", paste(fields, collapse = ",")) | ||
) | ||
out <- jsonlite::stream_in( | ||
con = gzcon(url(listing)), | ||
verbose = FALSE, | ||
simplifyVector = TRUE, | ||
simplifyDataFrame = TRUE, | ||
simplifyMatrix = TRUE | ||
) | ||
colnames(out) <- tolower(colnames(out)) | ||
out | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#' @title List package metadata | ||
#' @export | ||
#' @family meta | ||
#' @description List package metadata in an R universe. | ||
#' @return A data frame with one row per package and columns with package | ||
#' metadata. | ||
#' @inheritParams meta_checks | ||
#' @examples | ||
#' meta_packages(repo = "https://wlandau.r-universe.dev") | ||
meta_packages <- function(repo = "https://multiverse.r-multiverse.org") { | ||
fields <- c("Version", "Remotes", "RemoteSha") | ||
listing <- file.path( | ||
contrib.url(repos = repo, type = "source"), | ||
paste0("PACKAGES.json?fields=", paste(fields, collapse = ",")) | ||
) | ||
out <- jsonlite::stream_in( | ||
con = gzcon(url(listing)), | ||
verbose = FALSE, | ||
simplifyVector = TRUE, | ||
simplifyDataFrame = TRUE, | ||
simplifyMatrix = TRUE | ||
) | ||
colnames(out) <- tolower(colnames(out)) | ||
out | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.