Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge retries and testthat #19

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
14 changes: 10 additions & 4 deletions R/review_pull_request.R
Original file line number Diff line number Diff line change
Expand Up @@ -184,23 +184,27 @@ pull_request_merge <- function(owner, repo, number) {
.limit = Inf
)
labels <- pull_request_labels(pull_request)
if (!(label_manual_review %in% labels)) {
if (!(label_retry_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
"Pull request ",
number,
" is approved in its current state, ",
"but the bot encountered an error trying to merge it. ",
"The bot will repeat the review and retry the merge ",
"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)
labels = list(label_retry_review)
)
}
} else {
Expand Down Expand Up @@ -231,3 +235,5 @@ pull_request_labels <- function(pull_request) {
}

label_manual_review <- "manual-review"

label_retry_review <- "retry-review"
248 changes: 0 additions & 248 deletions tests/test-assert_package.R

This file was deleted.

Loading