Skip to content

Commit

Permalink
PRs linked
Browse files Browse the repository at this point in the history
  • Loading branch information
b-rodrigues committed Feb 22, 2024
1 parent 86137cd commit 70e7385
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/compile_table.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
22 changes: 19 additions & 3 deletions _targets.R
Original file line number Diff line number Diff line change
Expand Up @@ -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('<a href="', url, '">', url, '</a>')
) |>
subset(
select = -c(title, url)
)
),

tar_render(
name = paper,
Expand Down
11 changes: 7 additions & 4 deletions r-updates-fails.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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)))
```

Expand Down

0 comments on commit 70e7385

Please sign in to comment.