News for hackers. Stuff that matters.
Re:Debian Git Monorepo by Archelaos on Tuesday April 02, 2024 @06:24AM (#39904107)
> Turns out, feature X wasn't as well understood as we thought it was and we are still changing things around all the time.

If you publish something as a library for someone else, you should generally commit to supporting the public interface of that library as if it were a long-term support release. Exactly how long that should be depends on many factors, of course. But as a rule of thumb, I would recommend supporting this library version for at least two years. If that doesn't make sense, don't release it or look for a subset, where it makes sense.

Re:Debian Git Monorepo by The_Colonel on Tuesday April 02, 2024 @06:36AM (#39904190)
This is exactly the friction/overhead the other person means and what monorepo works around.

(but also keep in mind this is an internal library for likely a couple of internal apps, supporting BC for 2 years is in most cases unwarranted)

Re:Debian Git Monorepo by Repulsion9513 on Tuesday April 02, 2024 @06:39AM (#39904211)
Monorepo doesn't "work around" it, it means you have to support everything (including migrating/BC) on the current version, instead of having to support old stuff on the old version.
Re:Debian Git Monorepo by sjducb on Tuesday April 02, 2024 @07:18AM (#39904442)
You can see where the “library” is used. Often the bit you want to change is only used by your project so you can change it freely. If someone else is using it you know who to talk to about changing it.
Re:Debian Git Monorepo by actionfromafar on Tuesday April 02, 2024 @06:48AM (#39904281)
You can “fork” inside the monorepo too, just take a copy.
Re:Debian Git Monorepo by surajrmal on Tuesday April 02, 2024 @06:43AM (#39904246)
This guidance is far too specific to make sense in the general case. Not every scenario has the same constraints. If I had to pay a 2 year maintenance cost for every library I write and wanted to reuse between projects I'd never end up writing it. If you can migrate all library clients over to the new version, there is no reason to maintain old versions.
Re:Debian Git Monorepo by Archelaos on Tuesday April 02, 2024 @06:53AM (#39904317)
I would not call this a "library", but a set of interrelated project with "shared moduls" instead. With a "library" I mean a piece of code where the publisher does know who is using it for what exact purpose. Of couse we could now fight over a proper general definition for "library", but this is how I would use the term in this context, because thee long term aspect is what really makes outsourcing such code meaningful -- in contrast to the parents observation that it does not make sense to incorporate foreign code that constantly changes.
Re:Debian Git Monorepo by mewpmewp2 on Tuesday April 02, 2024 @08:08AM (#39904821)
The argument then is also that monorepo allows you to use this as "shared modules" instead of published "libraries".

The point is you have some code that you want to reuse, and either within a monorepo or between multiple repositories.

Re:Debian Git Monorepo by Archelaos on Tuesday April 02, 2024 @09:35AM (#39905597)
The question is, when it is wise to do so. Changing the public interface of a "shared module" or published "library" comes with a liability. Code reuse is almost a no brainer in the case of a standard library that rarely or never changes. Using a permanently changing modul whose modifications provide no real benefits for your project makes no economic sense. The sweetspot is somewhere in between.

What the parent actually did when copying the library/module code was creating a sort of a a long-term support version for himself maintained by himself. His cost-benefit analysis told him that this is better than always trying to keep up with the changes of the library/modul.

My comment was aimed at setting the bar rather high for when to share reusable libraries. And even for my own modules I rather prefer copying code instead of reusing it in different contexts. There is a reason why the contexts differ and it is typically easier and more economic to adress this differences in its particular place instead of preparing for them in shared code.

The more up-stream a library/module is, the more general it must be, but the less liable to change it should be.

Re:Debian Git Monorepo by mewpmewp2 on Wednesday April 03, 2024 @08:41AM (#39916690)
With monorepo he wouldn't have had to worry about this decision, since the decision to go back and forth would have been much lower cost. It's low cost decision either way and low cost impact if you make a wrong decision.
Re:Debian Git Monorepo by ownagefool on Tuesday April 02, 2024 @06:45AM (#39904259)
It depends.

If you drop a library for internal usage only and you want to change the contract, and the tests, library, and api are all in the same repo, you just change them in a single PR and that's done. This works because the single commit hash contains all information. It requires people put their code in the monorepo and hookup their tests, but assuming they do, you can build a reasonable degree of confidence on a green build.

Once you separate the library different repo, and let people consume that as something in their own repos, you need to do the versioning dance as you have no idea if their still is still working.

A lot of people go for the latter because it contextually allows them to ignore the rest of the stack, and there are some pros to doing this, but testing, deploying, versioning, etc, all become more difficult, and that's something struggle with.

Thus, unless you have a crap load of code / commits, monorepos arguably have more advantages than disadvantages.

Re:Debian Git Monorepo by bluGill on Tuesday April 02, 2024 @09:16AM (#39905400)
If the same problem doesn't exist in a monorepo in a different form then your project is not large enough to be in this discussion in the first place.
Re:Debian Git Monorepo by ownagefool on Tuesday April 02, 2024 @10:36AM (#39906214)
It's actually just trade offs that we should be able to have professional discussions about, otherwise your advocating for "always use a monorepo" unless your library is for public consumption.

The reality is, at some point, having repos that are hundreds of GB with hundreds of active PRs also has its own downsides that requires tooling and workflows to combat. Meanwhile, splitting it all up introduces integration problems.

It's definitely pick your poison, though specific requirements and circumstances make specific paths more or less potent.

Re:Debian Git Monorepo by bluGill on Tuesday April 02, 2024 @11:38AM (#39906989)
The problem is many people arguing for a mono repo feel like the size of their project means breaking into multiple repos mean put each function in a separate repository - which is obviously absurd. It is good if your project is that small, but you also are not facing the same pains as large projects are.
Re:Debian Git Monorepo by Cu3PO42 on Tuesday April 02, 2024 @07:04AM (#39904379)
This isn't wrong, but somewhat orthogonal. Yes, I "published" it on our package registry, but it wasn't public. Access was still scoped to the team developing the application I was speaking about.
Re:Debian Git Monorepo by actionfromafar on Tuesday April 02, 2024 @06:46AM (#39904271)
This is orthogonal to mono-repo vs not mono-repo and indeed distribution mechanism.
Re:Debian Git Monorepo by JackSlateur on Tuesday April 02, 2024 @10:33AM (#39906190)
This is exactly why monorepo is advised : you do not need to keep and maintain useless code for years. Instead, you can "git grep", then write and submit MR to quickly change all users.

I have never encounter this use case, tho