CC:What is Branching

From Remain Software
Jump to navigation Jump to search

Back.gif

What is Branching

With the Branching function, you are able to create a separate flow inside your application where you can do development that is completely isolated from the other development efforts in the same application.


  • Branches can be created on the fly.
  • Branches can be long- or short-lived.
  • Multiple developers can work on the same branch
  • You can have a branch per task or a branch for multiple tasks


This diagram shows an example application definition with three active branches with four environments.

The yellow branch in this picture is the database branch. It is a long-lived branch and it is used only to do database changes in isolation. If you want to change a file, you can attach all related objects to a task, quickly make the change and then promote the change back into production.

Then there are two feature branches (a new feature is a new function or bug fix, it's modern lingo).

The two branches are red and blue in this picture. In reality, branches don't have colors. What you notice is that each environment (*DEV, *CERTIFICATION and *PRE-PRODUCTION) have cryptic names. These are the actual library names which can only be 10 positions in the IBM i.


Branching diagram.png


The diagram below shows a different branching strategy with currently two active branches.

Then two feature branches have a separated development and test environment but merge together in the integration environment.

You can also see the template name that has been used to generate unique library names: BR%BD for the development libraries and BR%BT for the test libraries, resulting in the library names you see in the example.


Branching diagram 2.png


Library and Directory Name Template

In the environment maintenance function, you are able to create a TEMPLATE sub-environment with a compilation LIBL, directories and libraries to receive objects and sources. In addition to the normal library rules, you are also able to specify a template in case you are defining a template library list for branch creation.

The following special values may be used to compile a library name during the creation of a branch:

%B
The Branch code is used to compile the name of the library during the creation of the branch. Keep the Branch number to a reasonable width (e.g. 5 or 6) in order to be able to use additional decorations in the name.
%U
The first 3 positions of the current user name are used to compile the name of the library during the creation of the branch.
%S
A sequence number is used to compile the name of the library during creation of the branch. The sequence number is 6 long and will return to zero after 999999 branches have been created.

Examples for library generation

%S: 000016                                             
%U: PATRICIA                                           
%B: B01233                                             
                                                      
+---------------------------------+                    
¦ Base value      Generated value ¦                    
+---------------------------------+                    
¦  %U%SD          PAT000017D      ¦                    
¦  DM%BD          DMB01233D       ¦                    
¦  %B%S%U         B012336PAT      ¦                    
+---------------------------------+                    
%S: 312882                           
%U: PATRICIA                         
%B: B1233                            
                                     
+---------------------------------+  
¦ Base value      Generated value ¦  
+---------------------------------+  
¦  %U%SD          PAT312883D      ¦  
¦  DM%BD          DMT01233D       ¦  
¦  %B%S%U         B123382PAT      ¦  
+---------------------------------+