1
1
# ' Apply the query above to extract data from GitHub GraphQL API, and
2
2
# ' post-process into a `data.frame`.
3
3
# '
4
+ # ' @param quiet If `FALSE`, display progress information on screen.
4
5
# ' @param open_only Include only open issues?
5
6
# ' @return (Invisibly) A `data.frame` with one row per issue and some key
6
7
# ' statistics.
7
8
# ' @noRd
8
- dashboard_gh_data <- function (open_only = TRUE ) {
9
+ dashboard_gh_data <- function (open_only = TRUE , quiet = FALSE ) {
9
10
10
11
has_next_page <- TRUE
11
12
end_cursor <- NULL
@@ -106,10 +107,12 @@ dashboard_gh_data <- function (open_only = TRUE) {
106
107
)
107
108
108
109
page_count <- page_count + 1L
109
- message (
110
- " Retrieved page [" , page_count , " ] to issue number [" ,
111
- max (number ), " ]"
112
- )
110
+ if (! quiet ) {
111
+ message (
112
+ " Retrieved page [" , page_count , " ] to issue number [" ,
113
+ max (number ), " ]"
114
+ )
115
+ }
113
116
}
114
117
115
118
# Reduce "event" data down to current labels only, and sort by labels so
@@ -211,15 +214,16 @@ dashboard_gh_data <- function (open_only = TRUE) {
211
214
# ' open issues.
212
215
# ' @param browse If `TRUE` (default), open the results as a \pkg{DT} `datatable`
213
216
# ' HTML page in default browser.
217
+ # ' @param quiet If `FALSE`, display progress information on screen.
214
218
# ' @return A `data.frame` with one row per issue and some key statistics.
215
219
# ' @export
216
220
217
- dashboard <- function (open_only = TRUE , browse = TRUE ) {
221
+ dashboard <- function (open_only = TRUE , browse = TRUE , quiet = FALSE ) {
218
222
219
223
# Suppress no visible binding notes:
220
224
editor <- editor_date <- NULL
221
225
222
- dat <- dashboard_gh_data (open_only )
226
+ dat <- dashboard_gh_data (open_only , quiet = quiet )
223
227
224
228
cmt_data <- extract_comment_info (dat )
225
229
dat $ comments <- NULL
@@ -228,7 +232,7 @@ dashboard <- function (open_only = TRUE, browse = TRUE) {
228
232
dplyr :: relocate (editor , .after = labels ) | >
229
233
dplyr :: relocate (editor_date , .after = editor )
230
234
231
- if (any (dat $ has_multiple_stages )) {
235
+ if (any (dat $ has_multiple_stages ) && ! quiet ) {
232
236
numbers <- dat $ number [which (dat $ has_multiple_stages )]
233
237
txt <- ifelse (
234
238
length (numbers ) == 1 ,
0 commit comments