Proper software configuration management (SCM) is often treated like an unloved child in software projects. I am talking not just committing code into a repository, but about creating reproducible releases, merging code between code-lines and all those things that are sometimes boring but necessary to provide proper control over your team’s coding efforts.
Let me tell you what we did in our current project; I learned a lot during it, mainly since I had to manage the releases most of the time. In the end, the whole process is less scary than I thought; I’ve become even quite relaxed about it, and merging code is no longer scary (but a bit boring).
I must stress that you must adopt your own release process and fit it to your circumstances.
A few words on our software and its installation as it has some bearing on our choice of branching model. The code is a Java webstart application, written using Swing, connecting to enterprise beans on a server. This implies that whenever a user starts the application he will be forced to worked with the most recently installed version; i.e., there is ever only one release in production.
Here is our process to release (assuming we are currently at production version 2.2.1 and use the Linux convention for numbering):
- A set of features is defined for the next release.
- When the features are implemented a release branch is created and named (e.g., release-2.4).
- Part of the team, the release team, completes the new release code, incl. final configuration, acceptance testing, release notes, etc.
- The release team releases a candicate for acceptance testing on a test server (tagged 2.4.0rc1).
- Bugs in acceptance testing are fixed and a new candidate (tagged 2.4.0rc2) is released. This continues until the code is accepted.
- The code is released (tagged 2.4.0).
- Any upcoming bugs of the released code will be fixed on the branch line, repeating steps 4-6, and releasing the fixed version (tagged 2.4.1, 2.4.2, …)
- After each release (candidate), the code changes are merged back into the development line (merges are tagged appropriately).
- The development team starts to work on the next set of features on the development line, repeating steps 1-9 for the next release (2.6 or 3.0).
(If I have time I may add a picture of this process.)
What are the advantages that we obtained from this process?
- We have a clear, easily understandable and reproducible release process.
- There is no significant code freeze period when preparing a release.
- The process allows the team to allocate time efficiently and in parallel.
- The process is quite agile and flexible; there is minimal burden on developers as many can continue working as if unaware of the release process.
- The code can be placed under coninuous integration at all stages.
- We can reproduce production releases at any time quickly.
- Even during the testing process for a new release (e.g., 2.4.0rc2), we can release an emergency fix for the current production version (e.g., 2.2.1 to 2.2.2) without major upheaval.
It is also obvious that our installation allows us to choose this branching model since we never have more than three versions out there: the current production (e.g., 2.2.1), the current release candidate (e.g., 2.4.0rc2) and the development line (named 2.5).
If your circumstances are different (e.g, customers paid for different feature sets), you will have to come up with a different branching model to make it fit for your needs.
- Think early about the branching model and release process suitable for your project; at least no later than when the first feature set is complete
- Learn and use some of the branching patterns (see references)
- Merge early and often (before the deltas become too large and are hard too merge)
Don’t be afraid of branching and merging; once you understand the process, its limitations and benefits, everything beomes much easier.
- M Shuttleworth: Merging is the key to software developer collaboration
- B Appleton, S Berczuk, R Cabrera, R Orenstein:Streamed Lines: Branching Patterns for Parallel Software Development
- C Walrad, D Strom: The Importance of Branching Models in SCM, IEEE Software 2002, September, p31-38. See also comments in Letter to Editor, IEEE Software 2003, January, p11.
Eric Raymonds has started a page on version control systems. Worth keeping an eye on it.