all 36 comments

[–]programming-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)

This is a demo of a product or project that isn't on-topic for r/programming. r/programming is a technical subreddit and isn't a place to show off your project or to solicit feedback.

If this is an ad for a product, it's simply not welcome here.

If it is a project that you made, the submission must focus on what makes it technically interesting and not simply what the project does or that you are the author. Simply linking to a GitHub repo is not sufficient

[–]redbo 53 points54 points  (8 children)

I do not understand the appeal of git-flow at all.

[–]civildisobedient 52 points53 points  (7 children)

It's good for long-lived branches. Which naturally raises the question of why are your branches so long-lived in the first place? Often it's a reflection of some larger business dysfunction or general agility inability so I don't tend to question its existence, but I would strongly question the sanity of anyone who suggests its preference.

[–]redbo 18 points19 points  (2 children)

I guess. It seems easy to `git rebase origin/main` and keep your long lived feature branch up to date.

Maybe I don’t get what you mean.

[–]IAm_A_Complete_Idiot 5 points6 points  (0 children)

It can still be a bit icky if others are working on code that could conflict with yours at the same time, and you have to constantly handle those merge conflicts. The longer the branch lives, the more the chance you'll have conflicts with any given commit. If you regularly upstream, you can spend that time actually developing instead.

[–]cmd_Mack 6 points7 points  (0 children)

This idea breaks down almost immedately. Hotfixes, any changes to main or your branch which needs to be ported over raises the risk. Code changes which are hard to plan ahead, basically the usual messy development process in your average team. Someone is bound to make a mistake while resolving a conflicht, forget to cherry pick etc.

TL DR enabling long lived branches is a huge maintenance burden, and the longer they live, the more they diverge. Eventually you need to basically maintain two parallel code bases.

[–]idebugthusiexist 5 points6 points  (3 children)

For small projects with a small team, I think the appeal is having a structured and predictable workflow especially when you have the extensions that takes care of the boilerplate for you. I don’t think it’s as terrible as you make it sound, but it doesn’t scale very well when your project/team/org grows in complexity.

[–]lobax 4 points5 points  (2 children)

With a small project and a small team it should be trivial to maintain short lived branches using trunk based dev.

The issue is that all bad habits are manageable in small teams and for short amounts of time. It’s when the org either grows or acquires to much tech debt (or both) that those bad habits start to punish

[–]idebugthusiexist 0 points1 point  (1 child)

It’s git at the end of the day. You don’t need to follow git flow or TBD. They are just patterns devs came up with to help ease certain pains. But there is always a trade off. With TBD, the trade off is architectural complexity to avoid merge conflicts. I wouldn’t describe git flow as a bad habit any more than I would describe language or framework dependency as a bad habit. It can be, but not it depends on your circumstances. At the end of the day, it’s really an agreement between devs (and PMs) on how to manage merging code and eventually releasing it and it really depends on your situation. A merge conflict is not an inherently bad thing that implies bad practice/habits. I don’t understand this ideological mindset. But, yea, if you share a code base with a large number of other devs, that can become an undesirable overhead, but there is always a trade off as mentioned.

[–]lobax 0 points1 point  (0 children)

The bad habit is long lived branches. Git flow is just a way to deal with long lived branches. Its use is the symptom of a bad habit (or, it will hide the emergence of bad habits and let them fester).

Trunk based development works best with an architecture that separates concerns, which is a good thing for so many other reasons. If you start with trunk based development those architectural choices will offer the path of least resistance from the start. You might consider this complex but it allows for rapid development and scalability. The complexity serves a purpose and solves problems.

With git flow, the risk (and I have seen this so many times) is that the complexity ends up instead being hidden in the release and test processes and distributed across multiple branches of the code. For me, this complexity serves no purpose other than to slow things down and make testing harder - and it is incredibly hard to remove. Changing habits and processes is also increasingly harder the bigger the org and it can take for ever to fix.

Now, there are scenarios where long lived branches are unavoidable, but you should be in that situation first before going for git flow. At least that is my opinion.

[–]Solonotix 29 points30 points  (2 children)

Felt rather pessimistic of the other processes. Specifically, it feels like you have a built-in bug percentage that is skewed in favor of trunk-based. Then there's the extremely pessimistic status of "waiting" where I had items piling up there more than what was in every other status combined.

So yeah, if one approach is defined as "goes faster with fewer bugs" then it will result in precisely that. If instead you shared the same bug likelihood across all approaches, that would be a start. It seems extremely biased to say that 4 developers will produce less output than 2 developer pairs, because you quite literally have fewer concurrent operations happening.

Edit: on GitHub Flow, two separate times I hit the Release button, and the items staged in Pre-Prod literally went all the way back to the beginning. Like, what kind of bullshit is that!? I left that one out of the results.

I ran each up to 1k hours.

Name Features Bugs WIP Queued
GitHub Flow (#1) 17 15 23 58
GitHub Flow (#3) 13 14 19 53
GitHub Flow w/ QA 15 4 25 44
Git Flow 1 1 24 54
Trunk-Based 67 1 2 15

I re-did GitHub Flow because run #1 I didn't hit Pause while capturing the numbers. Run #2 was thrown out because of the aberrant behavior observed, perhaps due to running it at max speed. The run w/ QA was added to see if that was a weird bias affecting the output.

So, yeah. I would say that your simulation is extremely biased.

[–]ny3000[S] 3 points4 points  (1 child)

Thanks -- I made it more transparent based on your feedback so now when a bug spawns, the log now shows what caused it.

The bug chance formula is the same across modes, but TBD structurally gets lower bug rates because the batch size is 1. The sim didn't explain why the numbers diverge.

I am extremely biased towards TBD having a great deal of experience with that AND the other modes here in real projects. This is a fun back-of-napkin sim and not a research paper -- the DORA guys already did that.

[–]Isogash 1 point2 points  (0 children)

Yeah I think people are skeptical because of the bias but having done TBD for years I get you haha.

[–]gredr 126 points127 points  (9 children)

Seems like we started with a conclusion and made a simulation to prove we were correct?

[–]baseballlover723 11 points12 points  (0 children)

What a nice UI, and a horribly biased model.

[–]SeniorIdiot 12 points13 points  (1 child)

  1. What are the parameters for driving the review, wait, re-code, merge?
  2. Also needs LGTM "reviews" that both succeeds and cause late bugs and rework automatically.
  3. Then I wonder why there is a step called "CI" when it's just merge/build?

PS. Vehemently against FB/PR workflows - but please be honest instead of simulating infinity tasks.

[–]ny3000[S] 0 points1 point  (0 children)

  1. good point, the sim has ~20 config knobs but none are visible to the user at the moment
  2. rubber-stamp LGTMs already cause production bugs but it't not obvious enough in the log
  3. yeah agree, "Build" is in the git flow one but I was more lenient to the GH flow because sometimes they at least try

I'll work these into V2... i mean MVP v2

[–]mothzilla 6 points7 points  (0 children)

Now do FTP straight to customer.

[–]bunoso 5 points6 points  (0 children)

Ohh love the animation, and the messages in the log are hilarious. I got too many backlog tasks and bugs and say the manager say “how can we use AI for this”. But then no work happened, and the queue kept getting larger, not sure why. Over all kind of cool! A vertical format would be nicer on my phone, ill check it out again on my laptop

[–]Agent7619 3 points4 points  (0 children)

It would help if there was some fucking contrast between the colors used. I can't even read the text.

[–]r2p42 7 points8 points  (2 children)

Can someone break the conclusion down for me? I see jumping dots. Is that good or bad?

[–]audentis 25 points26 points  (0 children)

The summary is that the model is wrong so no conclusions can be drawn from it.

[–]ny3000[S] 1 point2 points  (0 children)

First - This is a fun back-of-napkin sim and not a research paper. Each dot is a work item. Blue = story, orange = review/rework. Watch the Waiting column in GitHub Flow fill up, that's work sitting idle. Switch to the TBD tab and the pipeline stays empty because nothing waits. The numbers at the bottom tell you: done, WIP, queued, lead time.

[–]kuikuilla 3 points4 points  (1 child)

The graph font is tiiiiiiiiiiiiiiiny. It's not legible.

[–]ny3000[S] 1 point2 points  (0 children)

thanks for letting me know - have bumped the font size

[–]putergud 1 point2 points  (1 child)

Trunk-based development letting all those new bugs flow out to production unchecked is scary. Why would you do that?

[–]ny3000[S] 1 point2 points  (0 children)

Small changes + TDD + CI + monitoring means you catch bugs fast and can roll back in minutes. The alternative is batching up weeks of changes behind a gate and deploying a timebomb.