merge-bot icon indicating copy to clipboard operation
merge-bot copied to clipboard

Not detecting reviews?

Open aaron-trout opened this issue 4 years ago • 3 comments

Describe the bug Hi again @squalrus, sorry to bombard you with PR's and issues 😅

Seeing a weird behaviour and was hoping you could help me figure out what is happening? I had this PR where reviewers were auto assigned from CODEOWNERS, but once all the conditions were met the auto merge didn't happen.

Before approvals it said Waiting on code owner review from limejump/platform and/or limejump/sig-kubernetes.

After approvals I see this in the logs:

pull: {"labels":["automerge","ready"],"owner":"limejump","pull_number":1375,"reviews":[],"ref":"heads/automerge-fixes","repo":"k8s-gitops","requested_reviewers":[],"checks":{}}

Notice how reviews and requested_reviewers are just an empty list! So all the jobs passed, but it didn't merge.

Screenshot 2020-09-03 at 14 21 04

Any ideas / extra things to check?

aaron-trout avatar Sep 03 '20 13:09 aaron-trout

It must be this line of code: https://github.com/squalrus/merge-bot/blob/7cc41ca7a2cba9e8ede4381d0f2716de7f43b12c/lib/pull.js#L26

if (Object.keys(this.reviews).length == 0) {
    return false;
}

In our logs reviews is an empty array (for some reason), so this check returns false.

bartelemi avatar Sep 03 '20 13:09 bartelemi

Yeah, I've been having a poke about in the Github API as well. Seems in this specific flow where the reviewers are automatically assigned by CODEOWNERS and it happens to be a group, then when this event happens:

Screenshot 2020-09-03 at 14 49 09

Seem to end up with no "requested" reviewers:

Screenshot 2020-09-03 at 14 48 19

But if you call the endpoint to list the reviews:

Screenshot 2020-09-03 at 14 50 10

So maybe it is because they were not explicitly "requested" as reviewers?

aaron-trout avatar Sep 03 '20 13:09 aaron-trout

@aaron-trout and @bartelemi -- no problem with the PRs and issues -- I appreciate the help!

I am working on getting your PRs in and then can look at this issue.

squalrus avatar Sep 12 '20 22:09 squalrus