Supporting multiple versions - merge through multiple sustaining branches

My team are investigating how to migrate our products source code from perforce to git/bitbucket cloud.

Some of our products are delivered to 3rd parties as installable packages, for these products we support a number 'old' major versions depending on the product. The most number of major versions we support is 6.

In perforce our branching model was setup to have the main branch contain the code for the next upcoming major release (e.g. v7.0). There will be a 'stabilizing' branch for each prior major version (v1.x through v6.x), on these branches only bugfixes are being done.

A developer should start fixing a bug in the oldest version it applies to, which is N-6 (N being the next upcoming major release, or main branch) in a worst case scenario. So this fix would be implemented in the v1.x branch, then merged down to the v2.x branch, all the way through v6.x and finally into the main branch. This type of merging changes down ensures the developer has the least merge conflicts, as he can adapt his fix based on the relatively mild changes between the stabilizing branches, opposed to doing the merge directly from the v1.x branch into the main.

So far it should be possible to replicate this model in git/bitbucket.

Apart from this, we want to implement some checks & balances, for example a developer is not allowed to commit directly on master or stabilizing branches, he should fix his bug in a dedicated issue branch (created using JIRA), which is split of from whichever stabilizing branch is the oldest the bug applies to and should be fixed in, and then make a pull request to have the change merged back into the branch where it originated from. I've accomplished this by applying bitbucket branch permissions allowing only commits on the issue/* branches and only pull request commits to the stable/* and master branches.

So far so good. Now comes the part which is causing me headaches: The changes has been merged back into the oldest stabilizing branch it needs to be fixed in, now it still needs to be merged into the 5 other stabilizing branches, and into master. Since the developer is not allowed to commit to stable/* or master directly, the only way to get the changes into the other branches is by making a pull request for each of these merges. On top of that the pull request for the next branch can only be made after the one for the current branch has been approved and closed. So you get a back-and-forth game between a developer and a code reviewer across 6 different pull requests, which will be a nightmare to complete for each bug.

So I'm looking for suggestions, feedback, input from this community, perhaps there is a better way to accomplish what I need? Or there's a feature I'm not aware of?

thanks in advance!

 

 

0 answers

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

706 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot