Live data from Hacker News

Ask HN: How are pull requests integrated in a repo with high commit frequency?

news.ycombinator.com

21–30 of 71 posts

Re: Ask HN: How are pull requests integrated in a repo with high commit frequency?

#21
While tools like Github check for patch conflicts, they don't check for semantic conflicts (e.g. one PR adds a new use of a function another PR removes).

This is where merge queues come into play which have a variety of names (merge queue, submit queue, merge train, etc)

I have a write up on merge queues [0] that goes into other benefits (e.g. speeding up PR builds), design considerations and their trade offs, and a comparison of various implementations.

[0] https://epage.github.io/dev/submit-queue/

Re: Ask HN: How are pull requests integrated in a repo with high commit frequency?

#22
This is a real problem in my current place (huge monorepo, 100+ devs, 100+ merges per day).

Like others said, "merge queue" is the solution. GitHub's one has been in beta for many months now.

There are also dedicated companies doing this like https://mergify.com/

But there's several tricky aspects like "what if I want some commit to jump in front of queue?", compliance etc.

Due to the multitude of requirements and off-the-shelf solutions being somehow limited, infra folks in my place are considering building a custom solution :)

Re: Ask HN: How are pull requests integrated in a repo with high commit frequency?

#23
post #5

Check out something like Bors, which implements a paradigm that fixes this class of issue: https://github.com/bors-ng/bors-ng (Homepage: https://bors.tech/ )

Does bors stand for something? what does the ng stand for? (I wasn't able to find out while googling.)

Re: Ask HN: How are pull requests integrated in a repo with high commit frequency?

#24
post #5

Check out something like Bors, which implements a paradigm that fixes this class of issue: https://github.com/bors-ng/bors-ng (Homepage: https://bors.tech/ )

Does bors stand for something? what does the ng stand for? (I wasn't able to find out while googling.)

Historical context: https://github.com/graydon/bors

Re: Ask HN: How are pull requests integrated in a repo with high commit frequency?

#25
post #2

Sounds like you want to implement something like merge trains?[0] [0]: https://about.gitlab.com/blog/2020/01/30/all-aboard-merge-tr...

Merge trains are the way. They do optimistic testing of the prior branches in the queue so the happy path goes fast.

Re: Ask HN: How are pull requests integrated in a repo with high commit frequency?

#27
post #8

Is it possible that the solution is to look at why there is such a high frequency of commits by different devs into the same main branch? Rather than look for a technical solution I would explore process and culture changes, such as having the various devs making all the different commits start pairing.

Sounds like a good way to cut productivity in half!

Re: Ask HN: How are pull requests integrated in a repo with high commit frequency?

#28
post #2

Sounds like you want to implement something like merge trains?[0] [0]: https://about.gitlab.com/blog/2020/01/30/all-aboard-merge-tr...

Another question I got on this. What do you do with merge conflicts between the branches? Do you then provide the system with patches for the merge conflicts somehow, so that it can resolve them as needed?

E.g. when merging A, B and C. C might have no conflict with master or A but it has a conflict with B. Now for the queuing to work A -> B -> C it will have to know somehow how to patch C to fit on top of B.

Maybe B breaks if it is not working after merged into A, and then the queue becomes A -> C -> B (modified), now B probably needs a patch to merge cleanly on C?

Re: Ask HN: How are pull requests integrated in a repo with high commit frequency?

#29
post #5

Check out something like Bors, which implements a paradigm that fixes this class of issue: https://github.com/bors-ng/bors-ng (Homepage: https://bors.tech/ )

does bors limit the commit frequency / PR merge frequency to one merge every test runtime (5 minutes in OP), or does it do something more complex and speculate / run some stuff in parallel?

OP’s numbers are 120 commits per hour and 5 minute test run, I’m wondering if adopting bors would necessarily reduce that to 12 commits per hour.

Post reply on HN