r/ProgrammerHumor • • 21d ago

Meme theJoysOfMonorepo

Post image
3.9k Upvotes

106 comments sorted by

36

u/Soggy_Porpoise 21d ago

Sounds like a coworker problem.

21

u/Melodic-Ebb-7781 20d ago

You forgot that someone pushed tests that randomly fails in the pipeline 

6

u/Manticore-Mk2 20d ago

The original draft had "flaky pipeline" but couldn't make it fit into the template xD

1

u/DeHub94 20d ago

So what? You break it you fix it. I'm not the only one that does this, right?

531

u/theucm 21d ago

We got a new boss who demanded everything be merged into a monorepo, it's been the absolute highest priority and every decision and plan is made in light of the prime directive of getting everything in the monorepo.

Then in a one-on-one I was giving this boss my progress on moving my projects into the monorepo and they asked me, "okay great, now, what will be the benefits of moving these into the monorepo? Why are we doing it?" and I had to stop myself from answering "because you told me to".

265

u/allozzieadventures 21d ago

You have more restraint than me. I don't think I would have had been able to stop myself from reminding him whose idea it was.

77

u/PhantomTissue 21d ago

If it were me that’s exactly what I would’ve told him.

11

u/CodNo7461 21d ago

Had something similar where my boss wanted me to setup performance metrics for our work in one of our system.
To his defense, it was more work than anticipated because it involved another team which wasn't very cooperative.
But in the end we were in a similar situation where he did not consider actually using the metrics would also take time, and there was more important work for me to do, and he of course did not want to do the work himself. We literally never used the metrics in the end... This was about a year ago by now.

9

u/hdgy2k 20d ago

i wouldn’t have stopped myself lol. Some people need a mirror desperately

61

u/Entuaka 21d ago

Even if he asked it, you should understand why he asked it.

If you're working on tasks without understanding why it's required, you're just executing and it leads to similar problem than when AI agents doesn't have enough context: the result is bad.

Maybe your manager have bad reasons to move to a monorepo, but you should have a conversation about it.

Even if it's a bad reason (from your point of view), it can have some benefits that it's hard to see if you don't have the big picture

84

u/theucm 21d ago

I know you mean well, but the answer to "why he asked it" is genuinely, and I mean this sincerely, because he doesn't know what he is doing, is spinning his wheels, and desperately trying to figure out how to impress the private equity company that bought us, fired his predecessor, and hired him from a 6-month tenure at a startup crypto exchange that if you search for it will bring up reddit threads with titles and comments like "have I been scammed?!" or "is this company legit?".

He's made a number of decisions in his managerial role, reversed course, then reversed course again, that all seem to be dictated based on what's currently popular rather than any real consideration about what is most useful for our product.

1

u/Trysupe 20d ago

And what did he answer afterwards?

2

u/theucm 20d ago

Honestly I just gave him some canned "it'll improve efficiency and be more cost effective and enable us to more easily work on the product" non-answer that he seemed satisfied with because he then started talking excitedly about how fast the migration is going now even though the initial "slowness" was the planning and prep-work which was frequently described to him in stand-ups.

115

u/StarHammer_01 21d ago

Rebasing is one task Im glad is getting replaced by AI

49

u/ACoderGirl 21d ago

Yeah, I've been using it a lot for my merge conflicts and have yet to see it mess up. It surely can, but it's honestly got a better track record than me, as I've messed up merge resolution plenty of times.

9

u/CodNo7461 21d ago

Until half a year ago, Claude at least regularly messed up. Dangerous stuff sometimes. By now with the skill I've written I'm doing the rebasing blind. Hasn't failed me for a long time.

10

u/masthema 21d ago

How does the skill look like?

6

u/GumboSamson 20d ago

Well it’s a markdown file

4

u/Rinveden 20d ago

Btw it's either "how does it look" or "what does it look like"

1

u/kk66 20d ago

Would you mind sharing the skill?

1

u/wasdninja 17d ago

How do you trust it to that? Seems like a minefield with no real gain. Either the rebase is messy and you need to make sure it's done properly or it's easy and you don't need any help. 

3

u/StarHammer_01 17d ago edited 17d ago

Yes complete trust. So far I have a 100% success rate across 1000s of rebases for a year now.

It can track of features across branches and worktrees better than I can.

The gain is that instead of spending 1-2hr on a rebase, I spend 5-10 minutes and save the sanity.

Only time its NOT done properly is always from human error of me giving the AI the wrong instructions on which features to include. And even then, since a rebase is only at most 10 or so minutes, its easy to just revert and try again.

Basically I can try again 10 times and still be faster than doing so manually and while the AI is working I can grab a coffee and work on something that requires real thoughts.

75

u/pqpm 21d ago

This hit me, to close to home.

The joys of large teams where everyone expects everyone else to review, so nobody reviews.

33

u/SilasTalbot 21d ago

In economics it's known as the tragedy of the employee lounge.

15

u/clericc-- 21d ago

Trying to get upstream fixes into Crossplane for close to two years now - this describes it exactly. Except its weeks or months on top

11

u/caleblbaker 20d ago

Title is misleading. You've got 4 problems that I can see and monorepo is only related to one of them and is the direct cause of none of them. 

Main problem is your reviewers are too slow. Aside from exceptional circumstances (e.g. only two guys have the necessary context to review this and one is sick while the other is on vacation) changes should not spend days waiting on review. They should generally be reviewed within a business day. This has nothing to do with monorepos.

Second problem is your reviewers are too quick to short circuit their reviews. "Please rebase" should not be the only feedback you get. Unless the reviewer is specifically aware of something upstream that invalidates your change (which shouldn't be common) they should still be able to review it merge conflict or no. So they should either have additional things they want you to fix in addition to rebasing or they should be able to tell you that it looks good aside from the conflict. This also is unrelated to monorepos.

Third problem is you're not being proactive enough with the changes you have out for review. You own your changes and should be regularly checking for merge conflicts while they're out for review not just waiting for the reviewer to tell you that there's a merge conflict. This too has nothing to do with monorepos. 

Final problem is that you might have too many people working in the same file at the same time. This is not caused by monorepos but does have the potential to be exacerbated by monorepos if you don't have clear owners of folders within the monorepos or if the code owners don't notice the problem and take steps to mitigate it.

9

u/awesome-alpaca-ace 21d ago

I work in a large org with employees across the world and this is not an issue for us.

3

u/HansTeeWurst 20d ago

How/why? I'm in a relatively small team and this happens quite often.

4

u/Primary-Ad-9741 20d ago

I work at a large org as well, its only an issue if i do it to myself - worked on the same lines of code in another PR

Reasons it is an issue for you are:

  1. No proper feature work separation. You are all hammering the same piece of logic.
  2. No proper separation of concerns, causing all your stuff to be roughly in the same place.
  3. No proper modularization

3

u/Atrio-Ventricular 20d ago

It's almost like if things are well designed this would never happen

2

u/Lba5s 20d ago

merge queues ftw

1

u/luluhouse7 19d ago

Standardised branch structure and names, all branches are associated with a particular team, and each team branch has a branch owner who’s in charge of RI/FI operations. So the branches that engineers are PRing directly into don’t have a lot of traffic, and those get RI-d in batches and changes from other branches then get FI-d back into the team engineering branch. And because branches loosely follow the org structure, conflicts are generally dealt with at the PR level, not the RI/FI level.

4

u/art0rz 20d ago edited 20d ago

I work in a large org with hundreds of engineers across the world and this is a major issue for us.

It has only been made worse by the fact that everyone's velocity has increased at least ten-fold since the rise of AI and changes are constant, resulting in conflicts occuring way more quickly, management expecting features to be developed more quickly, and engineers being too overworked as a result.

31

u/vanit 21d ago

The PR owner's responsibility doesn't end when the PR is up for review, you own it until it's merged. You need to chase review, don't just yeet it up and tag someone or yes, you will find yourself stuck in this cycle. Chase the person (nicely), or re-assign it if they have a legit higher priority.

11

u/DrMobius0 21d ago

I'm pretty sure I'd just check in assuming the merge isn't horrible. A review process that has you constantly re-reviewing minor revisions sounds ineffective and unsustainable.

8

u/ElCthuluIncognito 21d ago

This 100%, and bartering is not dead. “I’ll review yours if you review mine” has been said at least once a month.

3

u/awesome-alpaca-ace 21d ago

This only works if other people on your team need stuff reviewed...

8

u/7heWafer 20d ago

Responsible code reviewers check the size of the conflict and often review the code anyways if it's small enough.

7

u/JackNotOLantern 21d ago

Yeah, we started rotating the "must-review guy" in our team, so reviews don't wait longer than a day

6

u/xwolpertinger 21d ago

Gotta race to be the first to merge

I call it PVP programming

6

u/za72 21d ago

so why use monorepo??

28

u/ACoderGirl 21d ago

OP's complaint isn't a mono repo one. You only get merged conflicts if people changed the exact same files as you. That will happen regardless of repo type. All you can do is avoid having multiple devs working in the same area at the same time.

I work in a mono repo and it's amazing. Alternatives like git subrepos suck and are confusing. While you do have more instability because of changes in dependencies, it also means you're catching those issues earlier, which is easiest. It's easier to prevent those incompatibilities in a mono repo due to the ease of running tests at the current main version. Also easier to fix other team's issues and extend tooling and such because you don't need to figure out their repo and as much of their workflow, etc.

5

u/ElCthuluIncognito 21d ago

For me it’s having everything in a review in one place. So much better, and contrary to OPs experience, has made getting a review markedly easier. I just have to chase one person instead of putting together a strike team every time. Though that may be more because it came together with dissolving hard lines between projects on our small team (Conways law in full effect)

2

u/minequack 18d ago

And you understated it. You only get merge conflicts if people changed the exact same lines as you.

0

u/BigBoetje 17d ago

You get conflicts for changes in the same file but most tools can handle changes for different lines without issue.

1

u/minequack 17d ago

No, same lines. 

  Merge conflicts often happen when people make different changes to the same line of the same file, or when one person edits a file and another person deletes the same file.

4

u/RavingGigaChad 21d ago

Because companies love it especially in the AI age. Easy for Claude to write code for every context or domain if it can access everything at once.

3

u/Test_NPC 20d ago

Multi repo structures have the exact same problem; instead it's distributed between 10 repos & prs AND you're almost guaranteed to hit conflicts on the files specifying out the versions between repos (since literally everyone is forced to touch those files).

Multi repos are effectively just monorepos but with 10x the work handling merges and versioning between them.

1

u/za72 20d ago

sounds like picking the right tool for the job

1

u/El_RoviSoft 21d ago

You either should use custom monorepo (like Yandex and their SVN fork) or shouldn’t at all. Yandex’s arc have sticky ship for cases like this.

12

u/[deleted] 21d ago edited 21d ago

[removed] — view removed comment

8

u/Reashu 21d ago

As someone who will happily rant about the superiority of the tab, I still have to admit that repository structure matters a good deal more. Sure, you can do anything if you invest in tooling, but you can do it ten times faster if you just choose the model that fits existing tools.

2

u/[deleted] 21d ago

[removed] — view removed comment

5

u/Reashu 21d ago

Some problems I've seen (on both sides...):

  • The aforementioned merge queues vs syncing changes between repos
  • Access control woes
  • Having to do a sparse/shallow checkout due to size vs having to checkout three repos to work on one service
  • Seeing PRs, alerts, etc. you can't do anything about vs having to check for them in multiple places
  • People thinking that backwards compatibility doesn't matter for a service if you update the client in the same PR (users won't get the new client immediately...)

1

u/[deleted] 21d ago

[removed] — view removed comment

1

u/Reashu 21d ago

Just because you can doesn't mean you should. As I said, tools exist that support particular models of work already, e.g. most GitHub features are organized around repositories. There are probably ten or so companies in the world that can justify building their own source control platform, but the rest should design their work around one of the existing ones.

1

u/za72 21d ago

oh kinda like inheriting a terrible code base and doing a rewrite?

1

u/ThoseThingsAreWeird 21d ago

I'm sure however theyve set it up they could keep the monorepo and quash the persistent merge conflict problem somehow.

Yeah this is the confusing thing to me

Being a monorepo doesn't inherently mean PRs will have persistent conflicts. It just sounds like a bad setup of some sort, or projects not getting properly scoped

Like right now another team is working on an area of the codebase that my team also wants to be updating for a project. So we shuffled projects around and they're going first, sticking us on all the PRs. We've taken a different project on instead, and we'll touch the shared code in the new year 🤷‍♂️

0

u/love_weird_questions 21d ago

monorepo done well doesn't expose this kind of problems, you'd have them as well in a polyrepo setup on the specific app/component affected by the conflict

0

u/[deleted] 21d ago

[removed] — view removed comment

1

u/love_weird_questions 21d ago

yes sorry it was meant to reinforce your point

2

u/EarlMarshal 21d ago

Just use work trees and do it every morning and put more time on the tickets than it took you and push your PM and your chef to force faster reviews.

2

u/wint3ria 21d ago

Forgot to mention: boss complains you're too slow, doesnt care or understand he is responsible for this organisation

1

u/Major_Fudgemuffin 21d ago

My last job decided that everything from the last 15 years should be combined into a monorepo so that AI can maintain it more efficiently.

Turns out it was not more efficient. Shocking.

2

u/ACoderGirl 21d ago

I'm surprised. I've loved working in a mono repo more than when I did a bunch of git sub repos. And AI definitely does better with a mono repos because it makes it easier to find and update the code.

1

u/instilledbee 21d ago

Monorepo in a slow-moving enterprise be like

1

u/Ok_Tea_7319 21d ago

Bad monorepo.

1

u/knabbels 21d ago

You review your changes? Like by a human?

1

u/El_RoviSoft 21d ago

That’s why we have sticky ship at the company

1

u/Stunning_Ride_220 21d ago

LoL...just slapping everything in one repo is not monorepo tho

1

u/Chuck_Loads 21d ago

I think this is my new discord avatar

1

u/FedUpKoala 21d ago

Doesn’t using a monorepo make it difficult to view the history and find information on past versions due to the shear amount of code?

3

u/AntiSocial_Vigilante 20d ago

You can filter commit logs for changes only affecting certain files/directories.

1

u/caleblbaker 20d ago

That's not been my experience but I've only seen monorepo done well. Maybe that happens when monorepo is done poorly but it's certainly not unavailable.

1

u/davidellis23 20d ago

I think that depends on how large the monorepo is.

1

u/luluhouse7 19d ago

That’s what git GVFS is for

0

u/[deleted] 20d ago

[deleted] — view deleted comment

1

u/FedUpKoala 19d ago

I was thinking apart from git blame, like when you’re searching on commit messages relating to changes for which you don’t know which files are involved.

1

u/BosonCollider 19d ago

You can give git log a folder as input, then it will only show commits that touched that folder.

If you depend on a bunch of other folders then yes, its the equivalent of having thousands of dependabot commits where deps get updated and change APIs subtly

1

u/footsie 20d ago

Mono repos need mono repo tooling, processes and release structure. The only people who can say what those tools, processes and release structures look like are the dorks who decided to build a monorail... I mean mono repo

1

u/jdgrazia 20d ago

If this happened to one of my engineers more than twice I'd fire them.  You let a pr fall into conflict and then let that derail your review?

1

u/maochins 20d ago

Just joined a new company. This is literally my life now.

1

u/jobehi 20d ago

Skills issue

1

u/quisido 20d ago

GitHub has a new feature where Copilot can watch your PR and fix merge conflicts for you whenever they arise.

As of a few days ago, you could only enable this feature through the pull request UI. I hope they add it as a default setting soon.

1

u/fleck57 19d ago

Even worse when you fix the merge conflicts about 5 mins after the reviewer comments “please rebase” but still takes days to re-review

1

u/Flaky-Low-2262 19d ago

It is simple:
Someone says "need review". First Person who See this takes a Look. Finishing is always before continue as finished Stories will not block Organisation/re-prio.
Thats how it works.
Review > Bug > continue Task/Story > new Task/story

1

u/rysama 18d ago

Monorepos are great….

If your company has the capital to pay for an entire org to make it not a nightmare.

-3

u/BoBoBearDev 21d ago

You don't need to rebase to fix the problem. It signals you are part of the rebase-cult.

1

u/Manticore-Mk2 21d ago

You mean the repo owner is part of the rebase cult. I'm just a simple developer doing my best.

-2

u/BoBoBearDev 21d ago

Yes, they are in a rebase-cult.

2

u/ganja_and_code 21d ago

A merge conflict is still a merge conflict whether you're in merge-cult or rebase-cult lol

-1

u/BoBoBearDev 21d ago

Which is why it is a rebase-cult, because there are other tools to fix the merge conflict, and they specifically choose to only use rebase. Why is this hard to understand?

3

u/ACoderGirl 21d ago

Rebase is usually the right approach. It's generally cleanest for both review and history. It sounds more like the problem is the reviewing approach OP is using, such that a rebase invalidates the review.

-1

u/BoBoBearDev 21d ago

It is not. Which is why it is a rebase-cult.

0

u/ganja_and_code 21d ago

You can rebase to do it, or you can merge to do it, but you still have to accept which current/incoming changes to keep/discard, and should still have code review on the result before pushing/merging to your stable branch if you work in a team setting.

The problem the meme describes is the exact same, regardless of which command you prefer. Why is this hard to understand?

0

u/AWzdShouldKnowBetta 21d ago

Lol ur org sucks.

185

u/[deleted] 21d ago

[removed] — view removed comment

17

u/Sometimesiworry 21d ago

Power BI files.

Fuuuuu..

3

u/dktoao 21d ago

Lol, are you my former co-worker?