Version handling with Flow

Version numbers play a crucial role in branching models. Flow is a command-line developer tool to maintain software projects compliant with a branching model. Additionally, Flow offers robust version handling and ensures that version numbers are always in compliance with the model.

The diagrams presented only display relevant information related to the topic at hand. Additional details, including tags, branches, and commits that occur in the process, are omitted.

Validation and compliance

Flow ensures all version files are present and valid. For example, the development major or minor version must be greater than the staging version. Flow not only verifies versions but also reports irregularities and offers to correct them.

Before
1
2
3
A prod [0.0.0]
\
B develop [0.0.0] (invalid)
After
1
2
3
A prod [0.0.0]
\
B---C develop [0.1.0] (fixed)

Similarly, the (unreleased) staging version must be greater than the production version and lower than the development version. Flow can fix this as well, including missing version files and invalid version formats.

The release process

During the general release process, from development to staging to production, Flow preserves the source version value. After the first release candidate is created, Flow automatically increments the minor version on the development branch for future releases.

Initial
1
2
3
A prod [0.0.0]
\
B---C develop [0.1.0]
Release develop
1
2
3
4
5
A prod [0.0.0]
\
\ E staging [0.1.0]
\ /
B---C---D develop [0.2.0]
Release staging
1
2
3
4
5
A-----------F prod, staging [0.1.0]
\ /
\ E
\ /
B---C---D develop [0.2.0]

When the development branch is released multiple times without releasing the staging branch, versions on the development and staging branches are preserved. However, the release candidate number increments. Read more about handling changelog with Flow.

Hotfixing

Hotfixes are released into the production branch using a non-fast-forward merge. Flow automatically increments the patch version number, removes the hotfix branch, and prompts for a changelog entry.

Before
1
2
3
      C---D---E hotfix [0.1.0]
/
A---B prod [0.1.0]
During
1
2
3
      C---D---E---F hotfix [0.1.1]
/ ^ prod++
A---B prod [0.1.0]
After
1
2
3
      C---D---E---F hotfix [0.1.1]
/ \
A---B---------------G prod [0.1.1]

The hotfix version is not incremented until it is merged. This supports multiple parallel hotfixes. Hotfixes are also released into separate production branches corresponding to their major version. Read more about merging branches with Flow.

Try Flow today

Flow’s version handling capabilities make it easy to track your project’s progress and ensure that your version numbers are always in compliance.

If you’re interested, feel free to download Flow from GitHub. Check out the tutorial for an easy way to get started. Your feedback is welcome as well as suggestions and contribution.