diff --git a/.github/workflows/compile_table.yaml b/.github/workflows/compile_table.yaml index 12c5b10..744ff7a 100644 --- a/.github/workflows/compile_table.yaml +++ b/.github/workflows/compile_table.yaml @@ -37,7 +37,7 @@ jobs: - name: List open PRs run: | - gh pr list --search=rPackages -R NixOS/nixpkgs --json title,updatedAt,url > open_prs.json + gh pr list --search=rPackages -R NixOS/nixpkgs --json title,url > open_prs.json - name: Compile website run: | diff --git a/_targets.R b/_targets.R index efd1b68..3d9cb42 100644 --- a/_targets.R +++ b/_targets.R @@ -77,14 +77,30 @@ list( ), tar_target( - results_table, + results_table_with_rank, safe_packageRank(packages = unique_packages) ), + tar_target( + open_prs_raw, + fromJSON("open_prs.json") |> + subset(subset = grepl("r(p|P)ackages", title)) + ), + tar_target( open_prs, - fromJSON("open_prs.json") - ) + transform( + open_prs_raw, + title = gsub("^r(p|P)ackages\\.", "", title) + ) |> + transform( + packages = gsub(":.*$", "", title), + PR = paste0('', url, '') + ) |> + subset( + select = -c(title, url) + ) + ), tar_render( name = paper, diff --git a/r-updates-fails.Rmd b/r-updates-fails.Rmd index 5dac0a1..4acfa59 100644 --- a/r-updates-fails.Rmd +++ b/r-updates-fails.Rmd @@ -8,12 +8,13 @@ format: html targets::tar_load(last_jobset_url) -targets::tar_load(results_table) +targets::tar_load(results_table_with_rank) +targets::tar_load(open_prs) # if everything fails, stop here -stopifnot("Table has error’d" = !is.null(results_table)) +stopifnot("Table has error’d" = !is.null(results_table_with_rank)) -results_df <- subset(results_table$package.data, +results_df <- subset(results_table_with_rank$package.data, select = c(-date, -total.downloads, -total.packages, -downloads)) @@ -26,7 +27,9 @@ as computed by the `{packageRank}` package: targets::tar_load(failing_jobs) merge(failing_jobs, results_df) |> - reactable::reactable(columns = list(build = reactable::colDef(html = TRUE))) + merge(open_prs, all.x = TRUE) |> + reactable::reactable(columns = list(build = reactable::colDef(html = TRUE), + PR = reactable::colDef(html = TRUE))) ```