Live data from Hacker News

Monorepos: Please don’t

medium.com

111–120 of 402 posts

Re: Monorepos: Please don’t

#111

Earlier quoted context omitted.

Microsoft doesn't use a monorepo. Bloomberg, Dropbox, and Amazon don't either.

Microsoft switched all of windows to a mono repo.

I think Windows was already a single repo forever. IMHO, that's exactly what is slowing it right now.

Other products have their own repos, sometimes multiple. As of 2016.

Re: Monorepos: Please don’t

#112
post #50

Earlier quoted context omitted.

Can a monorepo support module- or subdirectory-level ownership controls? Or do teams using a monorepo just do without them? Partially answering my own question: SVN, recommended in a prior comment [0], supports path-based authorization [1]. But what about teams using another version control system? [0] https://news.ycombinator.com/item?id=18810313 [1] http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.serverc...

SVN allows for you to create mutliple repos within a repo. (That's probably why the path based auth works). Git has the idea of sub-modules, but they're really just filters. (They're in the same repo). So ultimately, you don't have that kind of control.

Git submodules are not in the same repo, they are a link from one repo to another, and you need to push to both if you make a change to the submodule. Maybe you're thinking of subtrees? I've never used those.

Re: Monorepos: Please don’t

#113
post #32

My advice is that if components need to release together, then they ought to be in the same repo. I'd probably go further and say that if you just think components might need to release together then they should go in the same repo, because you can in fact pretty easily manage projects with different release schedules from the same repo if you really need to. On the other hand if you've got a whole bunch of component…

My rule of thumb is: if you need to do PRs in several repositories to do one features, you should probably merge the repositories. At work, we have code spread among a bunch of repositories, and having to link to the 2/3 related PRs in other repos is a major PITA, and even more so for the reviewers.

Re: Monorepos: Please don’t

#114
post #90

Earlier quoted context omitted.

You can't split monorepos after the fact, at least not without immense costs. You can always just put all your small repos into a big one.

I think there's a nuance to this that should be pointed out: Monorepos allow you to do very bad hacks (I need this other component over there; let me just put in a Symlink. Done.). And if people can, they will use those hacks. If you split your repo up from the get go, the worst thing you can get that you'll have to assemble multiple distinct, well-encapsulated (in terms of project structure) things into one. In Git,…

> Monorepos allow you to do very bad hacks (I need this other component over there; let me just put in a Symlink. Done.).

I've seen that with polyrepos as well: The entire project would require you to clone the individual repos into a specific directory structure so that things would work (no, not even submodules).

Re: Monorepos: Please don’t

#115
post #32

My advice is that if components need to release together, then they ought to be in the same repo. I'd probably go further and say that if you just think components might need to release together then they should go in the same repo, because you can in fact pretty easily manage projects with different release schedules from the same repo if you really need to. On the other hand if you've got a whole bunch of component…

I can think of situations where components 'need' to release together because of organizational rules and not any actual binding between the components, in that case of course they do not need to be in the same repository.

I agree that you should always start with one repo and split as needed, it's the MVR way (minimum viable repository)

Re: Monorepos: Please don’t

#116
post #90

Earlier quoted context omitted.

You can't split monorepos after the fact, at least not without immense costs. You can always just put all your small repos into a big one.

> You can't split monorepos after the fact, at least not without immense costs. Sure you can. The difficulty of doing so depends on many (many) factors. If your team does their job well then the costs won't be immense. It might be annoying, but not that hard. Speaking in absolutes or platitudes solves nothing. Sometimes monorepos make sense. Sometimes polyrepos make sense. It's entirely dependent on what your company…

Of course, if everybody is very diligent in keeping things in the monorepo distinct and independent, then it's easy to split it later on. But relying on constant diligence doesn't work out in the long run in my experience.

Re: Monorepos: Please don’t

#117
There's a lot wrong with this article. Most of the arguments are either not backed up or are misleading. I haven't heard anyone argue they can drop dependency management because of a monorepo.

The author lists downsides of monorepos without listing the upsides and downsides of polyrepos so its really half complete.

I don't think anyone who likes a monorepo is suggesting you just commit breaking changes to master and ignore downstream teams. What it does do is give the ability to see who those downstream teams (if any) might be.

The crux of the author's argument is that added information is harmful because you might use it wrong. Its just as easy (far easier in fact) to ignore your partners without the information a monorepo gives. Its not really an argument at all. There's really nothing here but "there be dragons".

Monorepo's provide some cross functional information for a maintenance price. Its up to you whether the benefit is worth the overhead.

Re: Monorepos: Please don’t

#118
post #90

Earlier quoted context omitted.

You can't split monorepos after the fact, at least not without immense costs. You can always just put all your small repos into a big one.

> You can always just put all your small repos into a big one. It's not quite as simple as that. You'll need to avoid rebuilding the entire repo for every change - using something like Bazel. This means your build tooling has to be replaced entirely, which is a non-trivial task and not something your devops/release engineering team will thank you for. For any 3rd party libraries used by your projects you need to eith…

Eh, if you small repos build separately before you put them into one big repository, they'll build separately after, even if you just have a Makefile in each. If building your software depended on building its parts first, you already have the tooling to do so.

Re: Monorepos: Please don’t

#119
I have worked with polyrepo madness... I do remember doing commits to up to 5 different repos just for a feature. And to roll this feature to prod, few of these repos had to go through release process. On top of everything we couldn't really write tests to ensure if the feature works. The best we could do is write tests on the "user facing" repo and keep fixing and releasing others until those pass.

Well, I am sure many companies doing better than we did, with poly repos though.

Re: Monorepos: Please don’t

#120
post #4

I wish this had touched on polyrepos' ability to pin known-good versions of dependencies; that tends to be the Achilles' heel of monorepos.

Yet who unpins them or updates when a new good version is available?

The person responsible for dependency management in your team. You have one right?
Post reply on HN