Skip to content

Commit

Permalink
add editor info to review history for #21
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Apr 16, 2024
1 parent e1b4c55 commit 4fac10f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dashboard
Title: What the Package Does (One Line, Title Case)
Version: 0.1.7.010
Version: 0.1.8
Authors@R:
person(given = "First",
family = "Last",
Expand Down
6 changes: 6 additions & 0 deletions R/gh-queries.R
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ gh_issues_qry_dates_states <- function (org = "ropensci",
}
}
}
assignees (first: 100) {
nodes {
name
login
}
}
}
}
}
Expand Down
18 changes: 17 additions & 1 deletion R/review-history.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ review_history <- function (quiet = FALSE) {
end_cursor <- NULL

# Suppress no visible binding notes:
number <- opened_at <- closed_at <- submission_type <- state <- NULL
number <- opened_at <- closed_at <- submission_type <- state <-
assignees <- NULL
labels <- list ()

page_count <- 0L
Expand Down Expand Up @@ -59,6 +60,17 @@ review_history <- function (quiet = FALSE) {
ifelse (is.null (closed), NA_character_, closed)
}, character (1L))
)
assignees <- c (
assignees,
lapply (edges, function (i) {
assignee <- i$node$assignees$nodes
res <- NA_character_
if (length (assignee) > 0) {
res <- vapply (assignee, function (i) i$login, character (1L))
}
return (res)
})
)

page_count <- page_count + 1L
if (!quiet) {
Expand Down Expand Up @@ -89,6 +101,9 @@ review_history <- function (quiet = FALSE) {
submission_type <- submission_type [pkg_index]
state <- state [pkg_index]
labels <- labels [pkg_index]
assignees <- assignees [pkg_index]

assignees <- vapply (assignees, function (i) i [1], character (1L))

# labels are then only used to identify stats submissions:
stats <- vapply (labels, function (i) "stats" %in% i, logical (1L))
Expand All @@ -98,6 +113,7 @@ review_history <- function (quiet = FALSE) {
number = number,
state = state,
stats = stats,
editor = assignee,
opened_at = lubridate::date (lubridate::ymd_hms (opened_at)),
closed_at = lubridate::date (lubridate::ymd_hms (closed_at))
) |> dplyr::arrange (number)
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"name": "dashboard: What the Package Does (One Line, Title Case)",
"codeRepository": "https://github.com/ropensci-review-tools/dashboard",
"license": "https://spdx.org/licenses/MIT",
"version": "0.1.7.010",
"version": "0.1.8",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit 4fac10f

Please sign in to comment.