by fwlr · 3y ago · 0 comments
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.
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?
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.
- 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.
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.
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.
Edit:it->them
Google's trunk-based monorepo approach is a developer-centric approach seeming primarily driven by dependency management concerns.