Development and making sure you release only fully tested code is always a topic of concern in every company.

Here at Zamro, we recently switch from Git Flow to our own convenient branching strategy.

In the past few months, we have worked with Git Flow and found out that this doesn’t suit our way of working. Also having the risk of introducing major bugs in your develop branch was a big concern, especially when you release often. And you actually want to avoid 5 hotfixes per release.

Considering the downsides of Git Flow in combination with our way of working, we’ve chosen to use our own Git branching strategy:

  • Master branch: Stable version of the code, same as last release.
  • Feature branches: Branched from master and only contains code to develop the required changes.
  • Develop branch: Sandbox for developers to deploy on our test environment.
  • Release branch: Branched from master and includes all feature branches which we want to release.

 

The benefits from having this strategy:

  • Never broken releases
    You find out which feature contains the broken code and ‘remove’ it from the release.
  • Releasing patches/hotfixes are very easy
    Just pick the feature branch which contains your fix and release it independently from other features.
  • Cleaner code
    If (in the Git Flow way) would accidently push broken code to develop, everyone branching afterwards would have the same issue. With our setup, you always have a stable base to start develop from.
  • Great start for feature-independent-testing
    As we are going towards a CI/CD way of releasing, having the possibility to isolate the feature code from others gives us a great benefit to tackle problems in an early stage (by running automated tests over each branch).

 

Further on, we also experience one downside of the new branching strategy:

  • It’s labor intensive.

But by automating this procedure, this got reduced a lot.

The automation is done by talking to the API of JIRA Atlassian (which can be found here: https://docs.atlassian.com/jira/REST/cloud/), to get all the tickets which are needed.
Note: This requires you to use the same branchname as your ticket.

After fetching the list of tickets necessary, we merge them one by one, and the final result is to push the result to our GIT repository as a new release branch.

Leave a Reply

Your email address will not be published. Required fields are marked *