TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Trunk-Based Development

36 pointsby GarethX3 months ago

15 comments

jdlshore3 months ago
This is content marketing for a feature flagging tool called “Bucket.” I’m a big fan of trunk-based development, although I prefer its original name: continuous integration. (Sadly, that name has been coopted by tool vendors.)<p>A better alternative to feature flags is keystone interfaces. It’s very simple: build your new feature without wiring it up to the UI (or API). Test it using automated tests that bypass the UI. When it’s ready, wire it up, manually confirm that the automated tests didn’t miss anything, and release.
评论 #43032205 未加载
评论 #43032849 未加载
hatthew3 months ago
I am strongly opposed to feature flags and conditionals in the code, unless absolutely necessary. If you don&#x27;t remove deprecated features&#x2F;branches, your code will end up unmaintainable. If you do remove them, the removal is (in my experience) worse than dealing with merge conflicts. Version control is designed for the exact problem of having multiple implementations exist and merging them as needed. Why roll your own obtuse version control by having all branches in the same file simultaneously when you can just use git to have them exist in parallel universes?<p>There&#x27;s value in putting a newly completed feature behind a feature flag so you can turn it off instantly in prod. There is much less value in putting dozens of not-yet-functional features behind feature flags that shouldn&#x27;t be turned on for the next several weeks&#x2F;months (or maybe never).
评论 #43032017 未加载
评论 #43032280 未加载
评论 #43032388 未加载
评论 #43033489 未加载
jtreminio3 months ago
&gt; On top of that, once you finally get a feature merged and deployed, it can often happen that there’s a bug causing users to have a poor experience. Since your new feature lives directly in the code, deactivating it requires rolling back the code you merged, building it, waiting for the tests to run, and redeploying the application<p>Why aren’t you using feature flags to gate new behavior&#x2F;functionality?
评论 #43031948 未加载
js23 months ago
Everything old is new again:<p>&gt; Flickr is somewhat unique in that it uses a code repository with no branches; everything is checked into head, and head is pushed to production several times a day. This works well for bug fixes that we want to go out immediately, but presents a problem when we’re working on a new feature that takes several months to complete. How do we solve that problem? With flags and flippers!<p><a href="https:&#x2F;&#x2F;code.flickr.net&#x2F;2009&#x2F;12&#x2F;02&#x2F;flipping-out&#x2F;" rel="nofollow">https:&#x2F;&#x2F;code.flickr.net&#x2F;2009&#x2F;12&#x2F;02&#x2F;flipping-out&#x2F;</a>
评论 #43033305 未加载
furyofantares3 months ago
&gt; Trunk-based development is the seemingly radical idea of a team working together on the same code base at the same time.<p>Seemingly radical, hm. I&#x27;ve never worked any other way in 20+ years.
zeendo3 months ago
Every time this comes up it feels like two groups of people meet where one group either thought the other didn&#x27;t exist or was much smaller than it really is. It&#x27;s bizarre.
评论 #43033603 未加载
weakfish3 months ago
I’m gonna be honest, this sounds horrible. If you do adopt this though, why even use Git? Why not use Perforce or something?
评论 #43032613 未加载
smithcoin3 months ago
Here is an article of how my team had accomplished this with GitHub actions I posted earlier: <a href="https:&#x2F;&#x2F;blog.gregweber.info&#x2F;blog&#x2F;github-actions-trunk-based-development&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.gregweber.info&#x2F;blog&#x2F;github-actions-trunk-based-...</a>
twic3 months ago
I&#x27;d be interested to hear from anyone with substantial experience of trunk-based development who prefers a merge workflow, and can articulate why. Comments on TBD posts are usually either TBD enthusiasts, or people who have never used TBD and think it sounds stupid.
评论 #43032109 未加载
评论 #43032885 未加载
sebazzz3 months ago
It is really sad that almost no modern code review tools support trunk-based development. Nearly all tools assume some kind of branching&#x2F;pull request.<p>One tool that was great for _both_ use cases was Jetbrains Upsource, where you could just string a bunch of related commits together in one review. Better yet, it could recognize based on the commit message (like workitem or CR number) that a commit belongs to the same code review and add it.<p>We actually still use it, even though Jetbrains canned it, because we have found no good alternative. Some of the tools that do code review mandate to also host the code within it, which is not an option because we already host the code in a system we’re happy with.
评论 #43038567 未加载
darthrupert3 months ago
After thinking about this for some time and weighing in with my 30 years of developer experience: don&#x27;t do this. You will suffer.<p>Branches are there for a reason, and they are light-weight enough that you can use them even in a solo project. Everything will be easier if you flow with the tool instead of trying to fight it like this.
jacknews3 months ago
This looks horrible IMHO.<p>I agree changes to main should be kept small. But not too small. They should be coherent &#x27;chunks&#x27; of functionality, even if they are not yet a fully working feature.<p>Committing to a dedicated separate branch, quite apart from protecting against fat-finger commits etc, keeps everything together, allows for easy code review of a complete, coherent change, etc.
nativeit3 months ago
It&#x27;s things like this that make me fear we may have reached peak dev.
stevage3 months ago
I wonder how you code review a half implement feature.
darthrupert3 months ago
How do you do code reviews with this model?
评论 #43033584 未加载