Skip to content

Commit

Permalink
prefer closedAt over updatedAt for closed issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Mar 7, 2024
1 parent 2913af1 commit 0f91bf5
Show file tree
Hide file tree
Showing 4 changed files with 16 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.0.1.001
Version: 0.0.1.002
Authors@R:
person(given = "First",
family = "Last",
Expand Down
14 changes: 13 additions & 1 deletion R/editors.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ editor_gh_data <- function () {
has_next_page <- TRUE
end_cursor <- NULL

number <- state <- assignees <- updated_at <- titles <- NULL
number <- state <- assignees <- updated_at <- closed_at <- titles <- NULL

page_count <- 0L

Expand Down Expand Up @@ -59,6 +59,13 @@ editor_gh_data <- function () {
updated_at,
vapply (nodes, function (i) i$updatedAt, character (1L))
)
# closedAt is 'null' for open issues:
closed_at <- c (
closed_at,
vapply (nodes, function (i) {
ifelse (is.null (i$closedAt), "", i$closedAt)
}, character (1L))
)
titles <- c (
titles,
vapply (nodes, function (i) i$title, character (1L))
Expand All @@ -77,8 +84,13 @@ editor_gh_data <- function () {
state <- state [index]
assignees <- assignees [index]
updated_at <- updated_at [index]
closed_at <- closed_at [index]
titles <- titles [index]

# Prefer closedAt over updatedAt for closed issues:
index <- which (nzchar (closed_at))
updated_at [index] <- closed_at [index]

# Then find latest issue for each editor:
ed_index <- vapply (editors$login, function (i) {
index <- which (vapply (assignees, function (j) any (j == i), logical (1L)))
Expand Down
1 change: 1 addition & 0 deletions R/gh-queries.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ gh_issue_assignees_qry <- function (org = "ropensci",
nodes {
number
state
closedAt
updatedAt
assignees (first: 100) {
nodes {
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.0.1.001",
"version": "0.0.1.002",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit 0f91bf5

Please sign in to comment.