kodiak icon indicating copy to clipboard operation
kodiak copied to clipboard

Kodiak randomly closed a pull request

Open scriptnull opened this issue 2 years ago • 5 comments

We noticed that kodiak randomly closed a pull request in a repo (precisely 23 hours ago). The pull request didn't contain any labels that kodiak config makes use of. Did something change recently in kodiak that we can relate this to?

scriptnull avatar Aug 12 '21 04:08 scriptnull

Can you paste your Kodiak config?

Also, can you paste a screenshot of your branch protection rules?

Was the pull request's base branch deleted? Kodiak doesn't have logic to close pull requests, but it will delete branches if configured.

I wonder if a branch was deleted and that closed a related PR.

chdsbd avatar Aug 12 '21 11:08 chdsbd

Also, can you provide a URL for the PR that was closed unintentionally?

chdsbd avatar Aug 13 '21 01:08 chdsbd

Additionally, I happened to know this information from the author of the PR which might help in debugging this: They seem to have reused a branch name for opening this pull request that had already been merged and reverted.

(maybe you could relate it to a situation where Kodiak is looking at the branch name of the PR and notices that there is already a pull request that is merged for that branch and so closes and deletes the PR)

Also, if you still need the above information that you requested, could you share an email to which I could drop them?

scriptnull avatar Aug 13 '21 06:08 scriptnull

Hey @scriptnull, can you send an email to [email protected] and I can ask for more info

chdsbd avatar Aug 13 '21 11:08 chdsbd

@scriptnull The only case I could see where Kodiak might cause a PR to be closed is when the merge.delete_branch_on_merge setting is enabled. In this case, Kodiak will delete the branch if there are no other dependent PRs.

Here's the related code:

https://github.com/chdsbd/kodiak/blob/d0e8c04ba4285ec74449a96ed25c44834c50954b/bot/kodiak/evaluation.py#L772-L793

A simple workaround might be to disable that setting and use the built in "Automatically delete head branches" GitHub repository setting.

chdsbd avatar Aug 13 '21 14:08 chdsbd