Hi HN, weâre Spriha and Ankit, founders of MergeQueue (https://mergequeue.com/). We enable automatic merges for your Github Pull Requests, based on configurable rules you can set for each repo. These automated merges ensure you never have failing builds on master/main and save time on rebasing your feature branches.
If you have a monorepo where a big engineering team is regularly merging changes, the stability of the main branch degrades considerably. This happens because more engineers working on the same codebase introduce incompatible changes, causing builds to break even though their commits pass independently. Hereâs an example: https://blog.mergequeue.com/managing-github-merges-for-high-....
Github has a setting to restrict branches to be up to date before merging, but turning on that setting ends up forcing a rebase-athon within the team. This results in wasted time, and all too often, a stressful scramble to figure out what changes broke the build.
We had this problem in our previous company where we looked for a solution to automate the process. We found this paper [1] published by Uber to manage monorepos at scale and we built a lightweight version of that internally. It immediately eliminated the overhead of keeping builds healthy. After that, we decided to build a public version to save others from re-inventing the wheel.
We spoke to engineers at Airbnb, Stripe, Uber, Shopify, Quora and other large companies who have internally built similar tools, but teams who need such tools the most often donât have the bandwidth to dedicate developers to building and maintaining them.
MergeQueue (MQ) is a FIFO queue of Pull Requests (PRs) that works as a Github app. To use MQ as a developer, instead of merging manually, you just add a Github Label âmergequeueâ to the PR. MQ then takes care of the rest: it sequentially updates or rebases the branch, monitors the configured CI checks and eventually merges the changes. If the checks fail, it will dequeue the PR, add comments describing the reason and move to the next one. For high output teams, MQ also offers batch mode to run CI in parallel batches. If youâd like to learn more, thereâs a lot more here: https://mergequeue.com/documentation.
Currently, we are also piloting a way to manage âflakyâ (i.e. unreliable) tests through MQ. This integrates with your CI provider (we currently support CircleCI), analyses test results and flags the tests that fail inconsistently. When flaky tests are identified, MQ reruns the test depending on the configuration set.
We charge by usage in an organization, so for instance if your organization has 100 developers but only 20 of them use MQ, only those 20 will be billed. You can sign up for a free 14 day trial without a credit card. We also support single tenant or on-prem deployments, have webhooks to connect to your other apps, offer multi-queue support, and are SOC2 certified!
Weâd love for you to try MergeQueue and give us any feedback you have. If you've used something similar in the past, we're also curious to learn what problems you faced so we're better prepared for them ourselves :)
[1] https://eng.uber.com/research/keeping-master-green-at-scale/ - discussed at the time: Keeping master green at scale - https://news.ycombinator.com/item?id=19692820 - April 2019 (115 comments)
4 years ago by eatonphil
Really dumb question while I'm trying to decide whether to use something like git vs. CRDTs to handle version control for user changes made in an app I'm working on: why do we even use git anymore for source code version control if we want behavior like this?
Nobody likes merge conflicts. We all want versioning. So long as we have versions at all why isn't the ideal interface for developing in teams something more like editing in Google docs? Why aren't we just doing that? Why are we still using systems that produce merge conflicts?
Hoping for insight from folks who have either done this themselves or looked into it.
Edit: one particularly nice feature of Google docs over Confluence is that in Google docs I can suggest changes that is somewhat akin to branches with git. I don't need to force my change through without review. This isn't a natural part of CRDTs, but it sounds like the nicest source control system might be CRDTs plus branches?
4 years ago by ankitdce
Feels like this should be a post in itself! This is just my opinion so open to any push backs / comments.
IMO the main reasons for source control are: - having revisions / diffs that can be reviewed by someone else - while working independently in a distributed fashion - easy way to rollback to an older revision
I'm not too familiar with CRDTs, will add more comments after reading more about it, but let's take Google docs as example here. What if we were all writing code in Google docs, how would that turn out.
Google docs do a decent job of versioning, so the last point can still be satisfied. I think with a source code styled version of Google docs, one can easily tag versions and do rollbacks. The issue happens when collaborating. Just from my experience working in spreadsheets where > 10 users are actively trying to modify, overwriting each other becomes very common. You can argue that it might make it easy to also fix this, but what about running the code locally?
One would have to still take a snapshot - hope that it actually compiles. From my personal experience, while I'm writing code, it rarely compiles in the first attempt. So then we would really have to work on snapshots where we know it compiles. At that point, you are really creating "commits" and pushing it to the remote. I am not sure if we can really completely avoid conflicts in such model.
4 years ago by tobr
In real time collaboration, like Google docs, merge conflicts can be avoided because you see them play out live, and can react to them.
In an offline collaboration system merge conflicts are a feature, they bring attention to inconsistencies you might otherwise overlook.
This has very little to do with how the data is stored.
4 years ago by lifekaizen
Itâs a good question. Well, CRDTs are just an underlying data type that guarantee conflict free eventual consistency. That doesnât mean the result would be an English paragraph or buildable code, however. Then what git does really well that bare CRDTs donât are things like branching and local experimentation. Being intentional with commit points can also keep file sizes down, for a more real-time tool like Docs potentially every character change would be stored. CRDTs can have performance problems with things like file size growth.
For, your use case of user changes, CRDTs seem like a good option. It would be interesting to explore building a version control system on top of CRDTs, if done right it could have the benefits of git with less merge conflicts.
4 years ago by ramses0
Fork => Modify => Merge.
Suppose you have a 100 page gdoc. You start editing one paragraph per page, and voila, everything is fine. Casual edits are consistent "in context".
However, if you start editing on page 1, then skip to page 100 and go back to page 50, then it's possible that while "there was no conflict" (people weren't editing the same section of the doc at the same time), however, the document was in a "semantically inconsistent state" while you were making your edits (ie: someone trying to "compile" your doc in between the beginning and conclusion of your changes would have had a logic error until you'd made that final edit).
Git (and branching, as you're suggesting) allows you to select the next "actual" future from many "plausible" futures.
Think of A.C.I.D. You want your changes to be atomic (gdoc edits are not atomic across multiple "pages"), you want your changes to be durable (gdocs may/may not hit your definition for durability if changes can be made to the lines arbitrarily), consistency and isolation are also compromised with the free-flowing editing style you're describing.
Imagine dumping a python script into gdocs, pulling down the contents, and running it through a local python interpreter.
You could get pretty far with low amounts of edits and using the "comment" feature liberally, but once you try and "propose a refactor" you immediately need to "fork the universe" and have two (or more) semantically distinct representations of the document, or some way of queuing "multi-page edits" such that each could come in ... some sort of "merge queue" .... ;-)
4 years ago by h3mb3
How does this compare to Bors NG?
4 years ago by spriha
bors solves a similar problem, but we've found that enterprises require a lot of additional features to get their dev teams to actually use it, so we've focused on those to make this production-ready. Specifically:
1. We focus on being "no-maintenance", since our primary value prop to customers is "you won't have to spend eng resources on merge problems any more". This means: a one-click "set and forget" install, no additional config files to maintain or DSL to learn, unlike bors.
2. We have all the security and access-control features you'd want (we're Soc2 compliant, offer on-prem etc). This is important since the product interacts with our customers' source code.
3. We offer various customizations on merge workflows to help our customers optimize the exact parameters they care about (eg: developer wait time vs CI costs vs time to identity bad PRs in a batch, optimistic merge heuristics etc)
4. We offer a whole host of useful analytics to show you merge bottlenecks. We initially just put these as a nice-to-have, but we've now got customers who use us specifically because of these analytics!
We're also constantly adding new features based on customer requests (for instance, the flaky test features we're piloting originally came from customer requests we kept hearing over and over!). Speaking of which, if there's something you'd like to see that you don't currently get from your existing system/bors, do let me know :)
4 years ago by JensRantil
We're a >200 people company that's been using bors-ng for more than 4 years now for a monorepo. It's been a joy to use Bors! I'd thought I'd just chime in a little here:
> 1. We focus on being "no-maintenance", since our primary value prop to customers is "you won't have to spend eng resources on merge problems any more". This means: a one-click "set and forget" install, no additional config files to maintain or DSL to learn, unlike bors.
Bors was a breeze to set up and has been super stable and easy to upgrade. We used their Docker container and you need a PostgreSQL database.
> 2. We have all the security and access-control features you'd want (we're Soc2 compliant, offer on-prem etc). This is important since the product interacts with our customers' source code.
For a monorepo you can get really far using Github's CODEOWNERS file and requiring an approval in bors.toml.
> 3. We offer various customizations on merge workflows to help our customers optimize the exact parameters they care about (eg: developer wait time vs CI costs vs time to identity bad PRs in a batch, optimistic merge heuristics etc)
Nice! One issue we've seen is that a large backlog of PRs that needs to be merged, combined with a failing PR, is that bifurcations can easily build up a large backlog. We've looked at various different strategies to cope with that[1].
[1] https://forum.bors.tech/t/draft-rfc-support-building-batches...
Above said, I really think the _real_ solution to handling large backlogs really lies in speeding up the CI build, not adding even more complexity to handle a backlog. This includes adding caching Ă -la Earthly[2] et al., but also moving away from heavy integration/system tests etc.
4 years ago by rokob
This was my question too. I considered making a company out of Bors but didnât think it would work because Bors mostly just works.
4 years ago by spriha
Haha yeah we're that company- turns out there's actually a lot to do, especially when handling this at scale! come join us :)
4 years ago by jameshush
Perfect YC business. When an engineer made a similar solution at my previous company we celebrated him for months. This seems small but you have huge potential here, good luck! :D
4 years ago by jeremyis
A previous employer that underwent a massive multi-billon dollar migration to SOA (and then folks went too far and made everything a micro-service so had to rollup some work) basically because merging became too slow into our monorail as we got to ~O(1k) engineers. We had an in-house solution like this that we used for 2-3 years (and a worse version for years before that). What a great idea to productive it!
IMO the SOA migration simply due to merging was such a heavy-handed solution. If we could have made our MergeQueue way better, perhaps we could have avoided that multi-billion dollar (+ the rollback work) fiasco.
Congrats!
4 years ago by ankitdce
Wow, that's a great story, maybe we should quote that :) If you are open to sharing more of that experience, I would love to hear that. You can also directly email me at ankit[at]mergequeue[dot]com if you don't want to post publicly.
4 years ago by joshribakoff
Started making something similar then joined a new company (Brex) and we use https://github.com/bors-ng/bors-ng which is open source and works great. It merges huge batches of PRs and can automatically bisect them if they fail CI checks to find divide and conquer and merge in fewest batches possible. Itâs written in Elixir.
4 years ago by horse666
How does this compare to Mergify? https://mergify.io/
4 years ago by karlding
Neat! Pretty much every large company seems to have some variation of this.
I skimmed through your documentation, but it wasn't clear if this would handle workflows like the Chromium/AOSP workflows, where you have multiple repositories that are managed together via Google's repo [0] tool to give the illusion that it is a monorepo?
Occasionally you may have changes that span repositories and either need to be merged in a specific order, or in a single shot all-or-nothing merge "batch" [1]. This dependency information would be tracked either when the changes are originally submitted together to CI or directly in the commit message.
Of course, this means that you potentially have a small window where repo syncs may pull a partial set of changes, but usually this is solved via something similar to what Chromium calls "Sync to Green" [2].
[0] https://gerrit.googlesource.com/git-repo/
[1] https://chromium.googlesource.com/chromiumos/docs/+/HEAD/con...
[2] https://chromium.googlesource.com/chromiumos/docs/+/HEAD/dev...
4 years ago by gscho
How does this compare to Shipit?
4 years ago by spriha
similar to how we compare with bors, actually! https://news.ycombinator.com/item?id=27858794
tl;dr: Our goal is to be the absolute lowest-maintenance option for your team :)
Daily digest email
Get a daily email with the the top stories from Hacker News. No spam, unsubscribe at any time.