Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

bbuesker May 30, 2012

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

2 votes
Answer accepted
James Dumay
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 30, 2012

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

bbuesker May 30, 2012

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.

James Dumay
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 30, 2012

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!

bbuesker May 30, 2012

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.

David _old account_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 17, 2012

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?

Per Samuelsson December 11, 2012

@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.

bbuesker January 13, 2013

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?

Larry Presswood December 15, 2013

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..

0 votes
bbuesker January 13, 2013

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 Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events