Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Notify when merge conflict arises #224

Open
OliverJAsh opened this issue Jul 1, 2014 · 56 comments
Open

Notify when merge conflict arises #224

OliverJAsh opened this issue Jul 1, 2014 · 56 comments
Labels
automation Reducing manual interactions and increasing productivity through automated processes merge notifications

Comments

@OliverJAsh
Copy link

My colleagues always have to ping me when there's a merge conflict.

This could be automated if GitHub notified the PR author whenever a merge conflict arises, saving my colleagues precious finger energy.

@cirosantilli

This comment has been minimized.

@Mithgol
Copy link

Mithgol commented Jul 2, 2014

Is it different from #203 and how? (Do you mean such situations where the merge conflict arises not because of the pull request itself, but once the target branch moves on?)

@OliverJAsh
Copy link
Author

@Mithgol Yes, that's what I mean. When the target branch (the branch I'm requesting a merge for) moves on and a conflict arises.

@cirosantilli
Copy link
Collaborator

The difficulty with this feature is of course performance: if you have 100 PRs, all have to be checked on each push to master.

It might also generate a huge number of notifications if an user has multiple PRs (I have ~50 on GitLab =( ). But true, a single conflict digest email could be sent per time chunk.

GitLab and likely GitHub cache the mergeability, and only update it when someone visits the PR show page.

Related discussion on GitLab for another feature that suffers from the same limitation: showing mergeability on the PR index: http://feedback.gitlab.com/forums/176466-general/suggestions/6472237-show-on-index-view-merge-requests-can-be-automatic

Of course, the email could be triggered only when the cache is updated by some visitor.

@amcsi

This comment has been minimized.

4 similar comments
@aiko0403
Copy link

+1

@rmihael
Copy link

rmihael commented May 27, 2016

+1

@BenDTU
Copy link

BenDTU commented Jun 2, 2016

+1

@mayurshivakumar
Copy link

+1

@arenaq
Copy link

arenaq commented Aug 8, 2016

+1 (make it +20 for all developers here :D)

@arenaq
Copy link

arenaq commented Aug 8, 2016

@cirosantilli Of course it is performace issue and of course you can get spammed. But not all developers have so many pending MR's. For example, we have 1-2 in team, because we are constantly doing code reviews and merging them. But even if it was more, I would not consider it spamming. Either way it would be nice to have this option in settings so anyone could either turn it on or turn it off (perhaps both options - spamming one and periodically).

@enumag
Copy link

enumag commented Aug 24, 2016

Need this too. And even better than a notification would be an automatically added label / icon / whatever on the PR list page.

@kf6kjg
Copy link

kf6kjg commented Aug 28, 2016

Heavy annoyance: too many times wondering why my reviewer-approved PR hasn't been merged in and come to find out that the target moved on and those very busy people with write access have been skipping it because it suddenly developed conflicts. The same people are too busy to spend the time either merging it themselves or taking the time to send an email - such is the system's job.

@gitresolve
Copy link

@OliverJAsh GitResolve does this. It determines if there is a merge conflict and notifies the users who can fix the them whenever conflicts arise. A shareable link with a preview of the merge conflict is also provided. Here's how it works: https://gitresolve.com/how-it-works Check it out.

@arenaq
Copy link

arenaq commented Nov 18, 2016

@OliverJAsh And I though it is a plugin to GitLab. Such a commercial :D

@arenaq
Copy link

arenaq commented Nov 18, 2016

@OliverJAsh Can you explain how is this thread solved?

@OliverJAsh
Copy link
Author

Oops, meant to unsubscribe, not close.

@OliverJAsh OliverJAsh reopened this Nov 18, 2016
@gitresolve
Copy link

RE: And I though it is a plugin to GitLab. Such a commercial :D
It's actually a service, hoping people find it useful :)

RE: Need this too. And even better than a notification would be an automatically added label / icon / whatever on the PR list page.
Updated the service so it now automatically labels pull request with a "conflicted" label when it is unmergeable. The label also automatically gets removed when the pull request returns to a mergeable state. The label and notify settings are both configurable via a gitresolve.yml settings file so you can selectively turn on and off the behaviors.

@arenaq
Copy link

arenaq commented Nov 19, 2016

@gitresolve You are talking about label. That would mean to start using the service instead of/with gitlab, right? Why to use two services when you can use just one?

Only these notifications make sense but I doubt that any Ops team would like to install it just for notifications about conflicts. :)

@gitresolve
Copy link

@arenaq RE: GitLab. Oh ic. Sorry, yup, this only works with GitHub :( It is completely fair that an ops team will not be ok with installing it just for notifications. It is starting with merge conflicts and will hopefully automate more mundane tasks later. Thanks for the feedback.

@GrahamTheCoder
Copy link

@gitresolve It's really great that you're tackling this problem. I think this could be really helpful.

I'm looking for a solution that goes further, and will notify about PRs that would conflict with each each other once the other was merged. You can cut down the apparent n x n complexity significantly in the average case by maintaining a dictionary of file path to list of {time last changed, PR that changed it}, then only check those particular file/PR combos for conflicts when they change again. Bonus points: Do it for branches that don't have PRs yet.

If anyone knows of someone who's already solved this, on GitHub or as a local application, let me know.

@kpedro88
Copy link

+1
Since this info is cached by GitHub, it should be included as part of the state of the pull request and accessible via the API.

@hkraji

This comment has been minimized.

5 similar comments
@eddie-git
Copy link

+1

@natashawang
Copy link

+1

@nesterchung
Copy link

+1

@ldu-iRiS
Copy link

ldu-iRiS commented Sep 7, 2017

+1

@TwanVermeulen
Copy link

+1

@JackPotte
Copy link

+1

@vojtapol
Copy link

vojtapol commented Mar 1, 2018

+1, if you are worried about performance, make it configurable, disabled by default, per user, whatever

@pqtrang

This comment has been minimized.

4 similar comments
@eperales
Copy link

eperales commented Mar 5, 2018

+1

@benja83
Copy link

benja83 commented Mar 5, 2018

+1

@Colin-R
Copy link

Colin-R commented Mar 12, 2018

+1

@jonvnieu
Copy link

+1

@GautamGupta
Copy link

GautamGupta commented Mar 26, 2018

This is now exposed via the API using the mergeable attribute: https://developer.github.com/v3/pulls/#response-1 (on a per-PR basis) or https://developer.github.com/v4/enum/mergeablestate/

@ukjinlee

This comment has been minimized.

2 similar comments
@mbana
Copy link

mbana commented May 18, 2018

+1

@howdou
Copy link

howdou commented Aug 22, 2018

+1

@abinoda
Copy link

abinoda commented Nov 6, 2018

I'm the developer of Pull Reminders, a Slack bot for GitHub that provides real-time DM notifications.

I've tried adding merge conflict notifications but found that it was basically unfeasible given that mergeability status is only calculated by GitHub when a pull request is loaded.

This means that it generally requires a minimum of two API requests to get the mergeability status of a pull request. I did a longer write-up here.

@abinoda
Copy link

abinoda commented Feb 23, 2019

Update: Pull Reminders now offers merge conflict notifications for Slack 🕺

@TPS TPS added notifications merge automation Reducing manual interactions and increasing productivity through automated processes labels Feb 25, 2019
@Kallin
Copy link

Kallin commented Mar 21, 2019

Update: Pull Reminders now offers merge conflict notifications for Slack 🕺

I don't see this listed as a feature on pullreminders. Is it available?

@abinoda
Copy link

abinoda commented Mar 21, 2019

@Kallin Where are you looking? It is available under personal notification settings:

Screen Shot 2019-03-21 at 3 58 14 PM

@KyleWiering
Copy link

What about just auto-closing the request when conflict arises?
Then you'd limit the amount of churn to relevant PR's

And notifications for closed PR's already work

@PeterMTaylor
Copy link

Is it possible/feasible that a conflict state detected by Github for a given PR being checked also trigger a new tag named “Conflict” formatted in say orange as opposed to red automatically against the PR number so when the Github search list filter is used with PR having such conflicts shows up easily so @cirosantilli concern about 100 could be listed better by authors after finding which ones got conflicts. Chances are in the description/comments of a particular PR indicates which issues number a particular fixed/intending to close is being applied by selected master. Development culture could be encouraged to adopt such practices that helps managing these conflicts.

@dpashkevich
Copy link

So... Pull Reminders has been acquired by GitHub and is shutting down soon, but I don't see the merge conflict notification feature in GitHub. Am I missing something?

@jblac
Copy link

jblac commented Sep 16, 2020

@dpashkevich dealing with this same thing now, my devs really need the ability to be notified in some fashion. I'd be happy with it being available in the API and I can build the rest via a slack notification. Sadly since microsoft now owns github it'll take 30 years for anything to change (i.e the internet explorer era of developer hell)

@dpashkevich
Copy link

dpashkevich commented Oct 8, 2020

Forgot to post back! So this functionality actually is there in GitHub now, but in a very unobvious place. Here it is:
image

Yes, real-time alerts are hidden inside scheduled reminders, the two concepts are almost logically opposite :) Also it only works with Slack.

@gsouf
Copy link

gsouf commented Jun 2, 2021

Apparently we cannot use scheduled reminder if for an organization account if we don't have slack integration...
Any reason I cannot just enable email notifications for this?

image

@sileht
Copy link

sileht commented Jun 9, 2021

Mergify can also be used to automate some workflow when pull request conflict: https://docs.mergify.io/actions/comment/#request-for-action

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automation Reducing manual interactions and increasing productivity through automated processes merge notifications
Projects
None yet
Development

No branches or pull requests