Is it possible to use plan branches to override the branch on multiple repositories in a plan?

I just started experimenting with Bamboo 4's plan branches feature. It appears that when you enable plan branches and create one (either manually or via auto detection), it only ends up overriding the branch for the default repository. I have multiple repositories in my plan, and they all have the same branching scheme. I would like to have the plan branch be able to override the branch name for all repositories, but this does not appear possible.

Am I missing anything, or is the plan branch feature limited to only overriding the branch for the default repository?

2 answers

1 accepted

Hi Brian,

Plan branching is limited only to the overriding of the default repositories branch.

There is an improvement request open to make branching apply to all repositories, not just the default - please vote for it :)

Let me know if you have any more feedback regarding Plan Branches :)

Thanks
James

Thanks James for the reference to the improvement request. I just voted for it. Unfortunately I don't think I'll be able to use plan branches until that's implemented, but it does look like a potentially useful feature.

Hmm, you might be able to cheat it a little by making your branch name a Plan level variable, use it in your repositories configuration to specify the branch name, create your plan branches manually then override the branch name variable in the Plan Branch itself.

That way, if the default repositories branch name matches your branch name variable, all plan branches should be able to checkout the same branch for each repo.

Let me know how you go!

Thanks for that idea James. That does work for me. It's an extra 2 steps (override the branch name variable in the plan branch and define the variable), but that's not that big of a deal. I'll update the JIRA issue with your suggestion as well, in case it is useful for others.

I tried using a plan variable in the "branch" text field of the Repository definition for non-default repositories, but Bamboo doesn't seem to resolve it. It gives me the following error:

PolySpot Community - Full Master › PSCOM-FM-111 : Errors getting changes for PSCOM-FM-111
(java.lang.RuntimeException : com.atlassian.bamboo.repository.InvalidRepositoryException: Cannot determine head revision of 'ssh://9a161dbd-6f8b-4af6-ba39-8d4a883bffea@127.0.0.1:56487/pscom.git' on branch '${bamboo.repository.branch.name}'. Branch has probably been removed.)

I'm on Bamboo 4.2, and I'm using Git as you can see.

Did you successfully use a variable in the "branch" field?

@David,

Not sure if it still applies, since it's a couple of months old, but I did what you tried to do and got it to work. I defined a variable at the plan level, used the name of the variable in the branch fields, and override that variable in one of my plan branches, and got it to fetch/checkout the proper branch (from Git).

I'll leave a reservation since I'm just a week or so into evaluating this product, but I'm rather sure I remember correctly. If you still have problems, I can try again and maybe give some hints or w/e. Let me know.

I'm currently testing Bamboo 4.3.3 and am running into the same issue @David ran into. It seems that using any plan variable (whether one I configured myself or the ${bamboo.repository.branch.name} one that is auto generated) results in the "Cannot determine head revision" error. My custom variable was working just fine with Bamboo 4.0.1. Did something change that does not allow variable substitution within the branch field for a source repository?

I seem to be having the same issue with Bamboo 5.1.1.

Any additional ideas and/or a detailed how-too would really be helpful..

I'm currently testing Bamboo 4.3.3 and am running into the same issue @David ran into. It seems that using any plan variable (whether one I configured myself or the ${bamboo.repository.branch.name} one that is auto generated) results in the "Cannot determine head revision" error. My custom variable was working just fine with Bamboo 4.0.1. Did something change that does not allow variable substitution within the branch field for a source repository?

Suggest an answer

Log in or Join to answer
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,070 views 0 5
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