Skip to content

Commit

Permalink
Use testthat
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau committed Mar 18, 2024
1 parent c686f0e commit cf9a6ec
Show file tree
Hide file tree
Showing 10 changed files with 728 additions and 725 deletions.
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: r.releases.internals
Title: Internal Infrastructure for An R Universe of Package Releases
Description: Internal infrastructure for an R universe of package releases.
Version: 0.0.15
Version: 0.0.16
License: MIT + file LICENSE
URL: https://github.com/r-releases/r.releases.internals
BugReports: https://github.com/r-releases/r.releases.internals/issues
Expand Down Expand Up @@ -33,6 +33,8 @@ Imports:
pkgsearch,
utils,
vctrs
Suggests:
testthat (>= 3.0.0)
Encoding: UTF-8
Language: en-US
Config/testthat/edition: 3
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# r.releases.internals 0.0.16

* Retry failed merge attempts.
* Use `testthat`

# r.releases.internals 0.0.15

* Add explicit check that each contribution has only 1 line.
Expand Down
33 changes: 9 additions & 24 deletions R/review_pull_request.R
Original file line number Diff line number Diff line change
Expand Up @@ -175,34 +175,19 @@ pull_request_merge <- function(owner, repo, number) {
silent = TRUE
)
if (inherits(out, "try-error")) {
pull_request <- gh::gh(
"/repos/:owner/:repo/pulls/:number",
gh::gh(
"POST /repos/:owner/:repo/issues/:number/comments",
owner = owner,
repo = repo,
number = number,
state = "open",
.limit = Inf
)
labels <- pull_request_labels(pull_request)
if (!(label_manual_review %in% labels)) {
gh::gh(
"POST /repos/:owner/:repo/issues/:number/comments",
owner = owner,
repo = repo,
number = number,
body = paste0(
"There was a problem merging pull request ",
number
)
body = paste0(
"There was a problem merging pull request ",
number,
". Error message: ",
try_message(out),
"\n\nThe bot will retry merging next time it reviews pull requests."
)
gh::gh(
"POST /repos/:owner/:repo/issues/:number/labels",
owner = owner,
repo = repo,
number = number,
labels = list(label_manual_review)
)
}
)
} else {
gh::gh(
"POST /repos/:owner/:repo/issues/:number/comments",
Expand Down
248 changes: 0 additions & 248 deletions tests/test-assert_package.R

This file was deleted.

Loading

0 comments on commit cf9a6ec

Please sign in to comment.