8000 feat(events): when a PR is merged, re-evaluate all candidates by nicolai86 · Pull Request #7 · nicolai86/github-rebase-bot · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Oct 26, 2022. It is now read-only.
< 8000 div class="position-relative js-review-state-classes js-suggested-changes-files-tab" data-pjax data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled >

feat(events): when a PR is merged, re-evaluate all candidates #7

Merged
merged 1 commit into from
May 1, 2017
Merged
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
17 changes: 17 additions & 0 deletions event.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ func processMerge(client *github.Client, input <-chan *github.PullRequest) <-cha
fmt.Printf("Failed deleting branch: %q\n", err)
}

// TODO check for PRs which could be affected by this merge (e.g. green and Ready to merge)

ret <- pr
}
close(ret)
Expand Down Expand Up @@ -79,6 +81,21 @@ func prHandler(client *github.Client) http.HandlerFunc {
go func() {
for pr := range doneQueue {
fmt.Printf("merged PR #%d\n", *pr.Number)

// re-evaluate all open PRs to kick off new rebase if necessary
prs, _, err := client.PullRequests.List(
context.Background(),
owner,
repository,
&github.PullRequestListOptions{
State: "open",
})
if err != nil {
continue
}
for _, pr := range prs {
prQueue <- pr
}
}
}()

Expand Down
0