Skip to content

Commit 0f91bf5

Browse files
committed
prefer closedAt over updatedAt for closed issues
1 parent 2913af1 commit 0f91bf5

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: dashboard
22
Title: What the Package Does (One Line, Title Case)
3-
Version: 0.0.1.001
3+
Version: 0.0.1.002
44
Authors@R:
55
person(given = "First",
66
family = "Last",

R/editors.R

+13-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ editor_gh_data <- function () {
2323
has_next_page <- TRUE
2424
end_cursor <- NULL
2525

26-
number <- state <- assignees <- updated_at <- titles <- NULL
26+
number <- state <- assignees <- updated_at <- closed_at <- titles <- NULL
2727

2828
page_count <- 0L
2929

@@ -59,6 +59,13 @@ editor_gh_data <- function () {
5959
updated_at,
6060
vapply (nodes, function (i) i$updatedAt, character (1L))
6161
)
62+
# closedAt is 'null' for open issues:
63+
closed_at <- c (
64+
closed_at,
65+
vapply (nodes, function (i) {
66+
ifelse (is.null (i$closedAt), "", i$closedAt)
67+
}, character (1L))
68+
)
6269
titles <- c (
6370
titles,
6471
vapply (nodes, function (i) i$title, character (1L))
@@ -77,8 +84,13 @@ editor_gh_data <- function () {
7784
state <- state [index]
7885
assignees <- assignees [index]
7986
updated_at <- updated_at [index]
87+
closed_at <- closed_at [index]
8088
titles <- titles [index]
8189

90+
# Prefer closedAt over updatedAt for closed issues:
91+
index <- which (nzchar (closed_at))
92+
updated_at [index] <- closed_at [index]
93+
8294
# Then find latest issue for each editor:
8395
ed_index <- vapply (editors$login, function (i) {
8496
index <- which (vapply (assignees, function (j) any (j == i), logical (1L)))

R/gh-queries.R

+1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ gh_issue_assignees_qry <- function (org = "ropensci",
143143
nodes {
144144
number
145145
state
146+
closedAt
146147
updatedAt
147148
assignees (first: 100) {
148149
nodes {

codemeta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"name": "dashboard: What the Package Does (One Line, Title Case)",
77
"codeRepository": "https://github.com/ropensci-review-tools/dashboard",
88
"license": "https://spdx.org/licenses/MIT",
9-
"version": "0.0.1.001",
9+
"version": "0.0.1.002",
1010
"programmingLanguage": {
1111
"@type": "ComputerLanguage",
1212
"name": "R",

0 commit comments

Comments
 (0)