Saturday, March 17, 2012

Feature Branches and Release Management

In a few previous posts (here, here and here) I described how feature branches can be used to reduce project risk. As you move along there are further ways to simplify the use of feature branches.

For example I mentioned release management branches. Release management branches can be used for the final Quality Assurance (QA) work when preparing a release. Having a separate branch for this has the benefit that trunk (or master or main) doesn’t have to be locked down until the release day. The release management branch is controlled in that all changes that are accept to it, are carefully reviewed and specific to the preparation of the release. The rest of the team – that is everybody not involved immediately in the release management – can continue to commit new work into trunk.

That comes at a price, though. While working on the release management branch, trunk still requires work, e.g. merging new features. Alternatively you can neglect trunk while working on the release management branch. Even better is reducing or even eliminating the need for a release management branch altogether.

As a first step you could reduce the length of release management branches, e.g. from a week to a couple of days. Or you go all the way and just remove the release management branch altogether. This is feasible if you release out of trunk and have tight controls over what goes into trunk (“no junk in the trunk”). For example you could give your QA person the authority to decide when a branch is merged back into trunk. The equivalent in Git could be a pull request and the QA person decides which and when to accept a pull request into master. A review on the branch could be a prerequisite, for example QA could verify whether enough automated tests where written by trying to break the system.

By giving responsibility for trunk to QA and by minimizing the required release management tasks releases can easily be delivered out of trunk (or master). With tight controls trunk/master is no longer a “moving target”. Once you have eliminated the release management branch, the overall branch management and the release management has been simplified. A new release can be made from every single successful build out of trunk/master.

No comments:

Hostgator promo code