On Sunday, April 7, 2024 1:17 PM, David Karr wrote: >Personally, I always use trunk-based development. New changes go into feature >branches from master, and are merged to master after approval. >When we're ready to make a release, we create the release branch from master, >very few changes go into the release branch after we cut it. >Any changes that have to go into the release branch are first merged to master, and >then cherry-picked to the release branch. > >My team maintains the "platform" for a large number of similarly-constructed >microservices. That includes the build process, foundation libraries, and some >development guidance to the teams developing those services. We advise using >trunk-based development, but it's up to each team what they actually do. I recently >heard of some teams doing what I would roughly call "release-to-release" >development, which means at some point in the distant past they created a release >branch from master, and then the next release they cut from that release branch, >ad infinitum. > >What bothers me is that although I know this practice is wrong, I don't think I can >fully and completely describe why it is wrong, and why TBE is better. > >At a minimum, I know that with TBE, someone with no knowledge of the repository >can look at the master branch and know that represents the latest work on the >repository. > >I can't very argue that their practice results in "merge hell" when merging to master, >because they never actually do that. > >Can someone describe the flaws in this roughly named "release-to-release" >strategy, and why TBE is better? There are advantages and disadvantages to both. The key reason for release-to-release is to allow multiple releases to be simultaneously prepared with different features in each. TBE is fundamentally cumulative, with branches for new features and fixes. It supports development well but is not conducive to controlled production deployment. The TBE can be used at the same time as release-to-release. Developers work in TBE and should, IMO. But using merge-squash pull requests into release branches allows different ordering of features to be deployed in varying order (called sequencing). I would say, though, that continually basing release branches off of previous release branches is not a good practice as it does not allow any history cleanup - important when git is used as an release object repo. There should be a separate release main branch off which release branches are based. Fix release can be based off of their related base release branch, but main releases should not really be based off of other main releases. Periodic synchronizing of the TBE main with the release main can line things back up to reduce future conflicts. The key take-away, perhaps, is that the two concepts are not mutually exclusive. Just my thoughts. --Randall