parkr / auto-reply

:loop: Handle GitHub webhooks and manage issues on your repositories. Used to run @jekyllbot, now at github.com/jekyll/jekyllbot
https://byparker.com/go/auto-reply
BSD 3-Clause "New" or "Revised" License
69 stars 13 forks source link

Add a `has-conflicts` badge to PRs automatically #39

Open ashmaroli opened 6 years ago

ashmaroli commented 6 years ago

GitHub status already reports a list of conflicts in a PR and disables merge as a consequence. It'd be better if JekyllBot could piggyback on that status and automatically add a has-conflicts label to such PRs or use Jekyll's existing pending-resolution label.

pathawks commented 6 years ago

Maybe also add a comment to the PR letting the author/maintainers know that there are new conflicts that need to be resolved?

I'm not sure exactly how this would work though. Would every open PR need to be checked for conflicts each time a commit is added to master?

ashmaroli commented 6 years ago

Maybe also add a comment to the PR letting the author/maintainers know that there are new conflicts that need to be resolved?

That's a good idea. But I'm :-1: on it as its only going to leave behind Off-topic comments that the maintainers will have to manually minimize.. Instead, I favor the silent labeling. We, the maintainers then shout-out to the author if we're not able to resolve the conflicts ourselves (either from lack of branch-access, or from lack of time, or from lack of the know-how to best proceed further..)

Would every open PR need to be checked for conflicts each time a commit is added to master?

Yeah, that's how I vision it.. But how hard would it be for a Bot to traverse open PRs in reverse order and check for a conflict status from Github..? Definitely faster than a human doing the same, anyways.. :stuck_out_tongue:

DirtyF commented 6 years ago

We, the maintainers then shout-out to the author if we're not able to resolve the conflicts ourselves

👎 I'd rather minimize a comment than handle all conflicts.

ashmaroli commented 6 years ago

I'd rather minimize a comment that handle all conflicts.

Probably that's how the rest of team feels as well.. :+1:

DirtyF commented 6 years ago

According to https://developer.github.com/v3/repos/merging/ @jekyllbot could add a label if a merge returns a Status: 409 Conflict

Maybe something to check in https://github.com/parkr/auto-reply/blob/master/labeler/pending_rebase.go#L48

parkr commented 6 years ago

Yeah, checking if we get a 409 and adding some kind of unmergable label would be helpful feedback for maintainers, especially those using mobile. 📱