3 ms·
The disadvantages are more like "it's not affordable" ``` Monorepos could slow down developers because of slow build times, poor tooling, and merge conflicts.
by justicezyx 6y ago
The disadvantages are more like "it's not affordable"
```
Monorepos could slow down developers because of slow build times, poor tooling, and merge conflicts.
Most developers still in 2020 struggle to cleanly merge code.
Git is slow for projects with large numbers of files and history.
There is cognitive overhead involved as developers have to get comfortable with a much larger code base than they would have with multirepo setup.
To do monorepo well require investment in tooling that most organization non-tech leadership will fail to understand
```
Monorepo is clearly more desirable than distributed repo. But it's not a cheap solution.
- 908B64B197 6y ago> Most developers still in 2020 struggle to cleanly merge code Sounds like the hiring bar is too low.
- deathanatos 6y agoWe regularly¹ have unclean merges at my company, and I consider my coworkers competent, and well above "the bar". The biggest problem we have with clean merges is that nearly every CI system & code review tool out there doesn't test the final product — the merge commit — until after it is merged. GitHub follows this flow by default, and usually even with more CI tooling on the side. Something like bors-ng is what one has to adopt. (And we're struggling to do this for our monorepo due to other points the article touches on.) While it is possible (if difficult) in git, some VCS systems struggle even harder with this: Perforce and derivatives, for example, simply can't, by design, perform atomic test & commit. ¹like once a month, or so, over the whole company
- 908B64B197 6y agoCould this be fixed by using a better branching strategy?
- michael1999 6y agoThis is my experience too. Traditional ci hygiene requires that the build runs clean on the developer machine before publishing a change. But once the build time crosses 10 minutes, people resent waiting and start to run test subsets, and count on the ci server to catch breakage. Once that becomes normal, breakage is inevitable. And if commit tempo is higher than a developer can finish a test-run, then it is impossible. Solutions include patch queues, pr builds, etc. but those are all more complicated than a single stream on head.
- gct 6y agomerge into a stabilize branch and test that...
- deathanatos 6y agoThis would be a rose by a different name. So long as you're testing your branch's state, and not the end result of the merge — as most CI systems & GitHub end up pushing people towards — you're going to run into problems. What makes testing the end result of the merge tricky, I suppose, is that it changes over time. (As other people merge into whatever "stabilize branch" you have, the result of merging your branch and the new HEAD of the stabilize branch must change.)
- vikiomega9 6y agoI haven't used github in a while, when does an unclean merge happen? When two people merge their branches at the same time?
- deathanatos 6y agoAny two commits that conflict in a semantic sense (either change individually is okay, but both together don't work), but don't conflict in a syntactic sense (the changes are not textually near enough to each other to cause git to consider them conflicts, so an automatic merge can & will still happen; alternatively, they make the exact same change, and so don't conflict). We see this often with lockfiles (someone updates a dep, someone else adds a new dependency; the merge is a new dependency to a version of the dependency that no longer exists), or version numbers that get incremented (each author increments once; the second merge, git will consider it the same add on both sides, and not a conflict, so the result it original_version+1, when it should be original_version+2).