Wednesday, April 13, 2011

Merging

When we work on various versions of the code, replication of what was delivered on the previous release on to the current release and future releases becomes a matter of critical importance.



Suppose there are 3 releases going on parallel - V1.3, V1.2.1, and V2.0 An issue was found while testing V1.2.1 which is an emergency release. The fix is delivered on V1.2.1 immediately. Now, the same fix has to be replicated on V1.3 which is a future point release in progress. The fix should also be replicated on V2.0 which is a major release which too is in progress by another team. Following things are worth considering while doing this.



1) It is possible that the files in V1.2.1 would have changed in V1.3 and would have significantly changed further in V2.0. So when the fix delivered on V1.2.1 is copied to that on V1.3 and V2.0 care should be taken not to break the newly developed functionality.



2) It is always advisable to go for manual merge instead of automatic(through tools or through the version controller). Because even a very small change can impact a lot and may become difficult to debug in future, resulting in wastage of time.



3) Unit tests should be written in such cases for the scenario fixed on emergency release. Inclusion of these unit tests would ensure that the same scenario would work fine on all other future versions.



4) Customers who have already taken a previous version when they want to upgrade to newer version, should not face problems with compilation if there are any changes done on method signature or such things causing the existing code to break. In such cases, the old code (methods) should continue to be supported (can be deprecated if needed) and new methods should be provided to get this additional feature. Details regarding why the changes were done and what would happen if the new code is not taken etc should be clearly documented for customers.



This may not be of major significance where there is only one client using the entire code(as in software services companies). But if there are multiple clients (e.g in software product companies) handling simultaneous releases could be challenging. Strong processes should be in place and should be strictly followed in such cases.

0 comments: