@@ -110,6 +110,7 @@ gh_prs_qry <- function (org = "ropensci-review-tools",
110
110
cm_data_prs_from_gh_api_internal <- function (path , n_per_page = 30L ) {
111
111
112
112
is_test_env <- Sys.getenv (" REPOMETRICS_TESTS" ) == " true"
113
+ n_per_page <- n_per_page_in_tests (n_per_page )
113
114
114
115
or <- org_repo_from_path (path )
115
116
end_cursor <- pr_data <- NULL
@@ -150,8 +151,16 @@ cm_data_prs_from_gh_api_internal <- function (path, n_per_page = 30L) {
150
151
paste0 (p , collapse = " ," )
151
152
}, character (1L ))
152
153
comments <- lapply (pr_data , function (i ) {
153
- created_at <- vapply (i $ comments $ nodes , function (j ) j $ createdAt , character (1L ))
154
- author <- vapply (i $ comments $ nodes , function (j ) j $ author $ login , character (1L ))
154
+ created_at <- vapply (
155
+ i $ comments $ nodes ,
156
+ function (j ) j $ createdAt ,
157
+ character (1L )
158
+ )
159
+ author <- vapply (
160
+ i $ comments $ nodes ,
161
+ function (j ) j $ author $ login ,
162
+ character (1L )
163
+ )
155
164
body <- vapply (i $ comments $ nodes , function (j ) j $ body , character (1L ))
156
165
data.frame (
157
166
author = author ,
@@ -160,12 +169,24 @@ cm_data_prs_from_gh_api_internal <- function (path, n_per_page = 30L) {
160
169
)
161
170
})
162
171
closing_issue_refs <- lapply (pr_data , function (i ) {
163
- vapply (i $ closingIssuesReferences $ nodes , function (j ) j $ number , integer (1L ))
172
+ vapply (
173
+ i $ closingIssuesReferences $ nodes ,
174
+ function (j ) j $ number ,
175
+ integer (1L )
176
+ )
164
177
})
165
178
reviews <- lapply (pr_data , function (i ) {
166
- login <- vapply (i $ reviews $ nodes , function (j ) j $ author $ login , character (1L ))
179
+ login <- vapply (
180
+ i $ reviews $ nodes ,
181
+ function (j ) j $ author $ login ,
182
+ character (1L )
183
+ )
167
184
state <- vapply (i $ reviews $ nodes , function (j ) j $ state , character (1L ))
168
- submitted_at <- vapply (i $ reviews $ nodes , function (j ) null2na_char (j $ submittedAt ), character (1L ))
185
+ submitted_at <- vapply (
186
+ i $ reviews $ nodes ,
187
+ function (j ) null2na_char (j $ submittedAt ),
188
+ character (1L )
189
+ )
169
190
body <- vapply (i $ reviews $ nodes , function (j ) j $ body , character (1L ))
170
191
data.frame (
171
192
login = login ,
@@ -175,26 +196,55 @@ cm_data_prs_from_gh_api_internal <- function (path, n_per_page = 30L) {
175
196
)
176
197
})
177
198
199
+ # A few extra pro-processing ones just to avoid long lines:
200
+ user_login <- vapply (pr_data , function (i ) i $ author $ login , character (1L ))
201
+ merged_by <- vapply (
202
+ pr_data ,
203
+ function (i ) null2na_char (i $ mergedBy $ login ),
204
+ character (1L )
205
+ )
206
+ merge_commit <- vapply (
207
+ pr_data ,
208
+ function (i ) null2na_char (i $ mergeCommit $ oid ),
209
+ character (1L )
210
+ )
211
+ review_decision <- vapply (
212
+ pr_data ,
213
+ function (i ) null2na_char (i $ reviewDecision ),
214
+ character (1L )
215
+ )
216
+ closed_at <- vapply (
217
+ pr_data ,
218
+ function (i ) null2na_char (i $ closedAt ),
219
+ character (1L )
220
+ )
221
+ changed_files <- vapply (pr_data , function (i ) i $ changedFiles , integer (1L ))
222
+ total_comments <- vapply (
223
+ pr_data ,
224
+ function (i ) i $ totalCommentsCount ,
225
+ integer (1L )
226
+ )
227
+
178
228
data.frame (
179
229
number = vapply (pr_data , function (i ) i $ number , integer (1L )),
180
- user_login = vapply ( pr_data , function ( i ) i $ author $ login , character ( 1L )) ,
230
+ user_login = user_login ,
181
231
state = vapply (pr_data , function (i ) i $ state , character (1L )),
182
232
merged = vapply (pr_data , function (i ) i $ merged , logical (1L )),
183
- merged_by = vapply ( pr_data , function ( i ) null2na_char ( i $ mergedBy $ login ), character ( 1L )) ,
184
- merge_commit = vapply ( pr_data , function ( i ) null2na_char ( i $ mergeCommit $ oid ), character ( 1L )) ,
233
+ merged_by = merged_by ,
234
+ merge_commit = merge_commit ,
185
235
closed = vapply (pr_data , function (i ) i $ closed , logical (1L )),
186
236
title = vapply (pr_data , function (i ) i $ title , character (1L )),
187
- review_decision = vapply ( pr_data , function ( i ) null2na_char ( i $ reviewDecision ), character ( 1L )) ,
237
+ review_decision = review_decision ,
188
238
created_at = vapply (pr_data , function (i ) i $ createdAt , character (1L )),
189
- closed_at = vapply ( pr_data , function ( i ) null2na_char ( i $ closedAt ), character ( 1L )) ,
239
+ closed_at = closed_at ,
190
240
updated_at = vapply (pr_data , function (i ) i $ updatedAt , character (1L )),
191
241
num_commits = num_commits ,
192
242
additions = vapply (pr_data , function (i ) i $ additions , integer (1L )),
193
243
deletions = vapply (pr_data , function (i ) i $ deletions , integer (1L )),
194
- changed_files = vapply ( pr_data , function ( i ) i $ changedFiles , integer ( 1L )) ,
244
+ changed_files = changed_files ,
195
245
commit_oids = commit_oids ,
196
246
closing_issue_refs = I (closing_issue_refs ),
197
- total_comments = vapply ( pr_data , function ( i ) i $ totalCommentsCount , integer ( 1L )) ,
247
+ total_comments = total_comments ,
198
248
participants = participants ,
199
249
body = vapply (pr_data , function (i ) i $ body , character (1L )),
200
250
comments = I (comments ),
0 commit comments