News for hackers. Stuff that matters.
Re:Trunk-Based Development: Game Changers by fwlr on Thursday February 09, 2023 @09:01PM (#34734716)
Trunk-based development reminds me of Agile Development: the drawbacks mostly accrue to the developers while the benefits mostly accrue to the managers.
Re:Trunk-Based Development: Game Changers by fallbackboy on Thursday February 09, 2023 @09:15PM (#34734827)
What exactly is a drawback of Trunk-based development for developers?
Re:Trunk-Based Development: Game Changers by convolvatron on Thursday February 09, 2023 @09:22PM (#34734868)
not allowed to integrate with other people's work in progress without a trip through main. also dont know how you are supposed to put out maintenance releases.
Re:Trunk-Based Development: Game Changers by stetrain on Thursday February 09, 2023 @09:37PM (#34734955)
You can follow the core of trunk based and still work together with another person on a shared feature branch if that is needed.

I have found benefits though to structuring your WIP in a way that it can be merged into the trunk with minimal risk of breaking existing stuff. This is a mindset change around favoring adding new modules / components / endpoints without clobbering working code, especially for larger projects where the code is going to come in over the course of many releases.

Maintenance releases are done by going back to the tag or branch for your current prod release, making a new release branch from it, and pulling in whichever commits are needed.

Re:Trunk-Based Development: Game Changers by fallbackboy on Thursday February 09, 2023 @09:25PM (#34734887)
I don't think it's a great idea to integrate with other work in progress, living on another feature branch. As far as maintenance releases go, strategies for resolving this are well documented here https://trunkbaseddevelopment.com/branch-for-release/#fix-pr....
Re:Trunk-Based Development: Game Changers by atrandom on Thursday February 09, 2023 @09:24PM (#34734884)
Branch from a tag, make or cherry pick the fix, tag, deploy.
Re:Trunk-Based Development: Game Changers by jdlshore on Thursday February 09, 2023 @09:51PM (#34735054)
For that matter, what is the benefit of TBD for managers? It’s a development technique—specifically, a rebranding of continuous integration, because that name was coopted by tool vendors.
Re:Trunk-Based Development: Game Changers by osigurdson on Friday February 10, 2023 @01:29AM (#34736339)
I think it is good for book sellers and conference speakers. Particularly the Uncle Bob types that love simple and dogmatic ideas.
Re:Trunk-Based Development: Game Changers by ironmagma on Friday February 10, 2023 @12:26AM (#34735960)
Proliferation of feature flags, especially old ones, leads to combinatorial explosion of behaviors.
Re:Trunk-Based Development: Game Changers by sverhagen on Friday February 10, 2023 @01:24AM (#34736316)
Does it help to add removal of feature flags to the definition of done of your epics? Then isn't it much the same as staying on top of any kind of tech debt?
Re:Trunk-Based Development: Game Changers by ironmagma on Friday February 10, 2023 @01:33AM (#34736368)
It is much the same, which is to say, doesn't get done.
Re:Trunk-Based Development: Game Changers by MiyamotoAkira on Friday February 10, 2023 @01:51AM (#34736486)
So the problem is not the feature flags. If the code/system doesn't get improved bit by bit (is ok to have technical debt), then, whatever the technique, you are going to end in a bad place.
Re:Trunk-Based Development: Game Changers by ironmagma on Friday February 10, 2023 @02:55AM (#34736897)
Except that most technical debt does not suffer from combinatorial explosion. Feature flags do.
Re:Trunk-Based Development: Game Changers by sverhagen on Friday February 10, 2023 @02:59AM (#34736917)
Isn't it only combinatorial explosion if you need to maintain and test all those permutations. But those feature flags have a default value that they get stuck at. So the real remaining problem is pretty much: dead code. Which, again, that's "just" a common type of technical debt.

But hey, I am not arguing for feature flags. No, Sir, please no.

Re:Trunk-Based Development: Game Changers by Klaster_1 on Friday February 10, 2023 @05:37AM (#34737960)
> But hey, I am not arguing for feature flags. No, Sir, please no.

Why do you prefer not to work with feature flags? For context, the product I am working on (which is not very big) uses a simple development/production split to enable or disable features. Several people have recommended using feature flags, but since I have not previously worked on projects that utilized them, I want to learn more about the advantages and disadvantages from a developer's perspective.

Re:Trunk-Based Development: Game Changers by sverhagen on Friday February 10, 2023 @05:53AM (#34738070)
I was arguing against the notion that it necessarily leads to a combinatorial explosion. But there is a definitive cost to using feature flags, which I believe can be weighed against other options. In the types of environments where I work, we are able to avoid spending this cost most of the time, without major drawbacks. I'd say, the rare feature flags we have are very short-lived and mostly in the frontend (spa), very rarely in the backend, probably due to a decent team discipline around backward compatibility.
Re:Trunk-Based Development: Game Changers by osigurdson on Friday February 10, 2023 @01:27AM (#34736324)
Trunk based development, while fashionable today does have some theoretical downsides. Imagine a feature toggled code base in the limit - no actual functionality, just partially baked features behind toggles. The end result is a series of branches manifested in the code itself - with no actual "mainline" as nothing has ever been completed. I'm pretty sure that would not be awesome.

Of course, a branched code base in the limit is similarly never merged which obviously is terrible as well. My main point is don't follow trends, instead simply do what what makes sense - that might mean feature toggles, branches or some combination. Stay awake, be creative and avoid dogmatism: sometimes things are better out than in, other times better in than out.

Re:Trunk-Based Development: Game Changers by civilized on Friday February 10, 2023 @08:33AM (#34739399)
A single code base with half-baked code under feature toggles seems different from "a series of branches manifested in the code itself". Branches would mean there can be different versions of the same half-baked feature that need to be reconciled.

Are you saying that people in this thought experiment would go so crazy with feature toggles that they'd develop several different versions of the same feature, each with different toggles?

Re:Trunk-Based Development: Game Changers by osigurdson on Friday February 10, 2023 @09:13AM (#34739786)
This hypothetical is fairly broad but it is certainly possible to have a branch per feature (i.e. a feature branch).
Re:Trunk-Based Development: Game Changers by civilized on Friday February 10, 2023 @05:15PM (#34746715)
Yes it's possible for feature branches to look a bit like feature flagged code, but other than that, the administrative and organizational implications seem very different.
Re:Trunk-Based Development: Game Changers by osigurdson on Friday February 10, 2023 @08:39PM (#34748632)
The hypothetical is the code is half baked, never completed and obsolete. In TBD, work is required to remove it. If using a branch, nothing needs to be done.
Re:Trunk-Based Development: Game Changers by civilized on Saturday February 11, 2023 @10:02AM (#34752885)
I guess I would hope that some thought or review takes place prior to merging to the trunk, such that the work merged there is suitable to build on, not just everybody's unfiltered shower thoughts.

That, to me, is the difference between committing on a branch and merging back to trunk/main. A branch is just a way to record and share an idea. Merging back is saying with some confidence "this is something we should build on". Feature flags allow you to disentangle that social signal of "we should build on this" from "this works in production".

I'm not sure (and curious) about other ways of working that can fulfill the same collaborative social signaling function.

Re:Trunk-Based Development: Game Changers by dgb23 on Friday February 10, 2023 @03:06AM (#34736959)
I think it’s quite a reasonable method. But there’s no one size fits all.

Advocates of methodology will often speak in absolute terms. Plus their way of doing thinks is sometimes presented as a big magical revelation. This article is actually not like that, it reads like a historical summary.

It’s of course good to sometimes think about other ways of doing things. But in the end the way you’re using version control should reflect your requirements and development practice and not the other way around.

We do 1 main branch plus tagging. That’s it. It’s simpler for us and it’s a motivator to write code that works _now_.

But if we ended up in feature flag hell we would probably reconsider or simply branch off. Just be pragmatic about it.

There are of course companies with predefined rules about these things. I can’t speak to that.

Re:Trunk-Based Development: Game Changers by drewcoo on Friday February 10, 2023 @06:14AM (#34738217)
If you have . . .

- a merge process that happens on CI

- and that takes some time, running checks on the merge branch with main merged into it to effectively test what main will be

- and you want to make sure that there's no contention, so you finish one merge before testing the next

then you effectively have a merge lock in CI.

And that can lead to merge convoys where lots of merges to main line up and take a long time.

Re:Trunk-Based Development: Game Changers by nl on Thursday February 09, 2023 @10:04PM (#34735139)
Depends if you define dependency management as a developer or management concern.

Google's trunk-based monorepo approach is a developer-centric approach seeming primarily driven by dependency management concerns.

Re:Trunk-Based Development: Game Changers by MiyamotoAkira on Friday February 10, 2023 @01:57AM (#34736524)
The Agile manifesto was created by devs, for the benefit of creating software. Everyone gets the benefits.

After having used release and feature branches, and trunk based development, as a developer I see mostly benefits (there are some drawbacks, there is no perfect technique) with trunk based development.

Re:Trunk-Based Development: Game Changers by Nursie on Friday February 10, 2023 @04:57AM (#34737678)
The agile manifesto bears almost no resemblance to ‘agile’ as it is practiced in the industry today.
Re:Trunk-Based Development: Game Changers by MiyamotoAkira on Friday February 10, 2023 @06:56AM (#34738530)
Sadly that is the case with most ideas/techniques, because we misinterpret them or we hear about them 10 reinterpretations down from the original. Nothing like going back to the source.

Edit:it->them