News for hackers. Stuff that matters.
Re:Benefits of a Monorepo by amelius on Wednesday May 01, 2019 @07:04AM (#19796020)
What tools are people using to manage multiple repos? A search reveals many, but what is the latest and greatest?
Re:Benefits of a Monorepo by pjmlp on Wednesday May 01, 2019 @07:11AM (#19796050)
NuGET, Maven, whatever is the package manager for the language in question.

The outcome of multiple repos should be modular libraries.

Re:Benefits of a Monorepo by Orphis on Wednesday May 01, 2019 @07:25AM (#19796119)
Unless you're a library vendor, the outcome of multiple repos is most likely a single final application. Or a few applications.
Re:Benefits of a Monorepo by pjmlp on Wednesday May 01, 2019 @07:59AM (#19796269)
That is not a reason not to write modular code.
Re:Benefits of a Monorepo by jacques_chester on Wednesday May 01, 2019 @08:01AM (#19796283)
Modular code works just fine in subdirectories.
Re:Benefits of a Monorepo by bluGill on Wednesday May 01, 2019 @08:24AM (#19796418)
It can work either way. There are pros can cons to both ways, code organization needs to be done correctly either way. Nothing about either ensures your code is a good modular structure vs a haphazard mess. In most cases code in fact has a modular structure behind it that is followed - but the structure is not always good (something that is easy to see in hindsight, but the wrong rules were put in place early and now it is hard to change)

Mono repo makes violation of modular rules easier, just link it in - in a complex project odds are nobody will notice. However this doesn't mean monorepo is bad, it just needs that you need to be careful to ensure the rules are written down.

Multi-repo makes violation of those same rules harder - you have to make a bunch of changes to ensure that the bad dependency is in the environment. This hints at the downside of multi-repo: you need to have some sort of dependency management system to ensure that the right version is there when you build.

Re:Benefits of a Monorepo by ivan_gammel on Wednesday May 01, 2019 @11:13AM (#19797771)
Dependency management systems are now a standard thing and they are integrated with CI servers very well - I would not say that the need to use it is a downside.
Re:Benefits of a Monorepo by bluGill on Wednesday May 01, 2019 @01:22PM (#19799422)
Depends on your target environment. Some targets/languages have great eco systems, some do not.
Re:Benefits of a Monorepo by pjmlp on Wednesday May 01, 2019 @08:03AM (#19796300)
Not when it gets compiled from scratch all the time, or is open to spaghetti code modifications.

Modular code in subdirectories is what gave microservices an excuse against the "monolith".

Re:Benefits of a Monorepo by ivan_gammel on Wednesday May 01, 2019 @11:10AM (#19797714)
Subdirectories can belong to different repos. In modern IDEs like Intellij or Eclipse it's possible to work with multiple project roots in the same window (e.g. if you have a common library for microservices and want to redesign its API and make changes everywhere at once). The good thing here is that in most cases you work with just a fraction of your code and with a single project root, switching to multi-project view only in rare big reengineering tasks.
Re:Benefits of a Monorepo by Cthulhu_ on Wednesday May 01, 2019 @07:22AM (#19796101)
> The outcome of multiple repos should be modular libraries.

Yes; also they should all be treated as separate, independent products. Where multi-repos go wrong is when a whole product spans multiple repos, and a feature of the product depends on features being added or altered in multiple projects.

Ideally, the split should be so that nobody has to work across multiple repos to finish a feature.

The github / NPM ecosystem is IMO a good way to look at it; libraries that are all independent of one another who have a (usually pretty good) adherence to semver.

Re:Benefits of a Monorepo by amelius on Wednesday May 01, 2019 @07:38AM (#19796168)
> Ideally, the split should be so that nobody has to work across multiple repos to finish a feature.

That does not sound realistic. Often I have to add a new function, and I think: where (in what library) does this function belong, and very often it's not the main library I'm working in at that moment.

Re:Benefits of a Monorepo by lmm on Wednesday May 01, 2019 @07:46AM (#19796196)
Adding a new function anywhere other than the leaf project where it's used is premature. Organize around user-facing functionality. Pull out common libraries as and when you have something common enough to factor out (and, crucially, test independently), not before.
Re:Benefits of a Monorepo by jacques_chester on Wednesday May 01, 2019 @08:00AM (#19796277)
So the answer to needing to open multiple PRs is to open multiple PRs.
Re:Benefits of a Monorepo by lmm on Wednesday May 01, 2019 @09:07AM (#19796661)
The answer is to adapt your working patterns so that you never have multiple PRs on the critical path. Long-term codebase quality may require multiple PRs, but delivering user-facing functionality doesn't.
Re:Benefits of a Monorepo by amelius on Wednesday May 01, 2019 @10:18AM (#19797189)
And what if I wanted to add a method to a class? Or a method and a data member?
Re:Benefits of a Monorepo by pjmlp on Wednesday May 01, 2019 @10:49AM (#19797487)
You get the library owner team to do it and bind to the new released version.

Microservices without network headaches.

Re:Benefits of a Monorepo by pjmlp on Wednesday May 01, 2019 @08:00AM (#19796279)
Usually libraries are owned by separate teams.
Re:Benefits of a Monorepo by amelius on Wednesday May 01, 2019 @10:42AM (#19797412)
> NuGET, Maven, whatever is the package manager for the language in question.

Sometimes a repo contains code written in multiple languages.

Re:Benefits of a Monorepo by pjmlp on Wednesday May 01, 2019 @10:48AM (#19797476)
Maven, NuGET among other package managers happen to support multiple languages.
Re:Benefits of a Monorepo by amelius on Wednesday May 01, 2019 @07:37AM (#19796162)
Sounds good in theory, but I'm wondering: your edit-test cycle now becomes edit-install-test?
Re:Benefits of a Monorepo by detaro on Wednesday May 01, 2019 @05:03PM (#19801614)
Depends on the environment you're working in, but generally: interpreted languages typically have no problem loading a package from a temporary dev-location, compiled languages have build systems that handle that.
Re:Benefits of a Monorepo by oblio on Wednesday May 01, 2019 @08:20AM (#19796395)
Not necessarily. With Java IDEs, if you have the sources you can usually modify those and the IDE knows to ignore the package manager dependencies.
Re:Benefits of a Monorepo by oblio on Wednesday May 01, 2019 @04:58PM (#19801573)
Re:Benefits of a Monorepo by pjmlp on Wednesday May 01, 2019 @07:58AM (#19796262)
Surely, on the QA server as CI/CD pipeline.
Re:Benefits of a Monorepo by aldanor on Wednesday May 01, 2019 @08:06AM (#19796313)
conda is not bad as a generic package manager for this sort of stuff (packages don't have to be Python although that's what it was initially aimed at).
Re:Benefits of a Monorepo by zb on Wednesday May 01, 2019 @08:41AM (#19796517)
Zuul (https://zuul-ci.org/) is an open source CI/CD system that does speculative execution of CI on changes across multiple repos. So if you have a change in one repo that depends on a change in another, you can test both together before merging either (and it enforces merging in the correct order).

IME it solves the same problem that monorepos are intended to solve, but without any of the downsides.

Re:Benefits of a Monorepo by ivan_gammel on Wednesday May 01, 2019 @11:15AM (#19797788)
What's more, same result can be achieved with practically every modern CI server with minor admin effort.
Re:Benefits of a Monorepo by bluGill on Wednesday May 01, 2019 @08:28AM (#19796435)
We wrote one in house, it works well and has useful features that nothing else has. Today I'd use conan.io, and add those useful features to that project. Our internal system works well so it is hard to find justification to tear it out, but the downside is no tool/IDE understands it, and so you can't use your favorite IDE unless your favorite IDE is the one obsolete version that we have modified to understand our tool.