How to manage features or pull requests in Train Model of Software Development?
Asked Answered
M

1

1

Our team is now moving to release train deployment model (http://thinking-in-code.blogspot.com/2010/07/train-model-of-software-development.html) and we need tools or method to manage how we merge Pull Requests and build new release.

Note: I will be using Git terminologies to explain the problem

With release train deployment model, the releases occur at fixed schedules and the features are pinned to a specific release. But the core idea with this model is that if a feature is not complete or specifically not bug free, that feature is not taken up in the coming release but scheduled for a later release.

With this in mind, we need some approach to manage Pull Requests and release builds with respect to following:

  1. A build can be made with all the feature branches so that this build can be given for testing (QA). We do not want to actually merge this in our development or release branch. (why? The next point deals with it)

  2. So if a feature is not zero bug (bug free), we would want to drop that feature. Hence we would actually merge only features with zero bugs and create new release build. In this way, a feature can easily be dropped. In terms of release train terminology, the feature would not board the release train.

What we have thought:

Assuming master contains the released code. Now the feature branches F1, F2, F3 are created on top of it.

  1. Our automation setup, would merge these feature branches (from pull requests having "Approved" state) in chronological order in a temporary branch cut out from master and the setup will create a build from this temporary branch for QA Testing. (The merging in temporary branch would not close the PR)

  2. Now, if only feature F1 and F3 are bug free on zero bug date, then PRs for F1 and F3 would be manually merged into master and a final release build would be created from master.

(Note: For point 1, if merge conflict arises, developers of individual branches would resolve it.)

Is there any Jenkins plugin or any other tool which can help us achieve the above. Please share some thoughts about this and suggest any better way of handling this problem.

Moya answered 24/7, 2019 at 3:3 Comment(0)
S
7

Hence we would actually merge only features with zero bugs and create new release build

Well... the problem is that the result of the merge (meaning the "0 bugs feature branches" merged) can result in some bug!
A 0-bug feature branch (when develop in isolation) can have bug when considered in integration.

The general git workflow which does follow a release train model would be the gitworkflow (one word)

gitworkflow

The idea is to merge the branches you want for the next release to an intermediate transient integration branch (that you can call "integration" or "dev" or "next"...).
That branch is re-created for each new release and allow for testing those feature branches in integration (together).

Then you merge only to master the ones you actually want for the next release.
You do not merge the integration branch to master. Only feature branches.

See more here and here.
I answered questions about that workflow here.

Speech answered 24/7, 2019 at 4:32 Comment(2)
Thanks @VonC, the gitworkflow seems to be a good solution. But, I think I was unable to my point clear as you mentioned: "A 0-bug feature branch (when develop in isolation) can have bug when considered in integration." We don't plan to test feature branches individually. We plan to merge the feature branches in a virtual branch for creating the build for QA without closing the original PR.Moya
@FerozAhmad That sounds good. gitworkflow is compatible with your approach. The only thing is: once this build for QA is done and tested, you will need to merge again those feature branch to master in order to finalize the next release: this is what allows you to drop the feature branches you don't want, and keep only the ones that works together.Speech

© 2022 - 2024 — McMap. All rights reserved.