Build numbers for release_xxx branches?

Many companies use main/master as production quality and when QA or customers need a hotfix, they branch of 1.4.568 and call it release_1.4.568branch

This is so common, I suspect circleCI ‘might’ already have a solution such that CI keeps building release_xxx branches but also resets the build number for each of those branches so that build number would start at 1 so you get

1.4.568.1
1.4.568.2
1.4.568.3

Is there something for this? Part of me thinks no as they would have to run a cache per branch and have an involved coding on their end to achieve this. It is however very very useful.

Another side question is simply “How to reset circle CI build number to 0 as we increment 1.4 to 1.5 as well?”

thanks,
Dean

Hello

Build numbers are assigned per build in the whole project; it doesn’t take into account the branch.

If your first ever build on a project is on the main branch, the build number will be 1.

If the subsequent build is on a branch called develop , the build number will be 2.

Also because of this, it is not possible to reduce the number back down to 0.

Would it be possible to tell us your use case for this and I would be happy to look into making a feature request for you.

Kind Regards
Owen Oliver

1 Like

Hi @owenjoliver , our use case just got shot actually. It was desired that release branches start from 0 was all.

That is no longer possible as android has a versionCode and sometimes we need to rollback a release and to do so, we use this constantly increasing number now as a rollback mechanism by cutting a new release on an OLD release branch to increase the number to rollback as the android devices don’t let us rollback so we simulate a roll forward even though it’s a rollback (ie. versionCode number is higher while the app release version name is lower moving from 4.17 to 4.16 backwards on rollback).

This is closed now on our end but thanks for the help!!!

1 Like