Is it possible to force a run of the Bamboo automatic branch detection?
Asked by Russell Howe:

I'm setting up automatic branch detection and want to fine-tune the regular expression which selects branches.

Is there a way to force a scan of the repositories? Making a regex change, then having to wait 5 minutes for another scan is not exactly a productive way to work!


Answers:
author: Przemek Bruski
body: That should be:

http://host:8085/bamboo/chain/admin/detectBranches.action?planKey=PLAN-KEY

(Where the PLAN-KEY should be the plan key, not a job key., eg. PROJECT-PLAN , not PROJECT-PLAN-JOB)

comments: author: Russell Howe
body: Thanks, that appears to do the trick. You just saved me about an hour!


author: Per Samuelsson
body: We'd like to use this as welll, but I can get it to work. Maybe I don't fully understand how to do this, since I'm rather new to the product (evaluating).

I'm trying to trigger the branch detection by sumbitting URLs like:

<http://host:8085/bamboo/chain/admin/detectBranches.action?planKey=FOO1-FOO2>

http://host:8085/bamboo/chain/admin/detectBranches.action?planKey=${FOO1-FOO2}

where FOO1 is our product name, and FOO2 is the name of the plan (and host being replaced by our host of course), but both results in errors from the server saying the page does not exist and a link that gets me back home.

Any help would be appreciated!


author: Przemek Bruski
body: Per, does the beginning of the URL look like the one you use to access Bamboo in the browser (so, does the protocol, port, host and context match)?


author: Przemek Bruski
body: This definitely works, we use it in several of our automated tests, which would otherwise fail.


author: Per Samuelsson
body: @Przemek,

Thanks for taking the time.

I'm glad to hear it really should work, b/c I'd really like to use it eventually. But I'm also sad to say I can't get it to work still. :)

Anyway, after your post I set up the environment again, and I tried a combination of both URL-formats above and tested both with the protocol prefix (i.e. http:) and without - none worked though.

Here's my setup:

I run my Bamboo server locally, exposed via localhost (default port, i.e. 8085). I run the server in the console and as an administrator. It's on Windows 7 and I run Bamboo 4.3.2 (I think - the latest version anyway, downloaded some week ago).

I'm the single user defined in Bamboo, and logged in when trying. I have administrative rights.

My plan works against a test repository, hosted in Git. The name of the my project is GoodTimes and the plan name is IntegratedBranches. You'll see it in the URL's below. I've set up the plan to detect branches automatically, and it does so fine after the said 5 minutes.

I'm using Chrome when accessing Bamboo and I've tried the URLs both in seperate tabs and from the same tab as I'm using when browsing/administering the server.

The URL's I've tried:

localhost:8085/bamboo/chain/admin/detectBranches.action?planKey=GOODTIMES-INTEGRATEDBRANCHES

<http://localhost:8085/bamboo/chain/admin/detectBranches.action?planKey=GOODTIMES-INTEGRATEDBRANCHES>

localhost:8085/bamboo/chain/admin/detectBranches.action?planKey=${GOODTIMES-INTEGRATEDBRANCHES}

http://localhost:8085/bamboo/chain/admin/detectBranches.action?planKey=${GOODTIMES-INTEGRATEDBRANCHES}

Really hope this one doesn't come down to as some kind of typo on my part. :)


author: PiotrA
body: @Per

It's the context path! Remove the context path:

<http://localhost:8085/chain/admin/detectBranches.action?planKey=GOODTIMES-INTEGRATEDBRANCHES>


author: Per Samuelsson
body: OK, update:

It suddenly stroke me that I could possibly see something in the server console, when the request was sent, and indeed I did find an error there. So at least my request reaches the server.

Here a snippet of the relevant error info:

![](../../upfiles/Untitled2_2.png)


author: Per Samuelsson
body: @Piotr,

That did it - tested and confirmed it works. Thanks!

Maybe the original comment by Przemek should be updated, if the context used there will cause failures for others too? Or maybe I'm such a Bamboo newbie that everyone that reads it instantly knows this, in case I guess you can leave it as is. :)

Best regards,


author: PiotrA
body: Ah, I'd leave this as is. The thing is that - AFAIK - if Bamboo is deployed into application container (like Tomcat), then usually it will be configured to have the context path non empty, i.e "http://host:8085/bamboo/{rest}". However if you use the so-called "standalone" version of Bamboo (bundled with Jetty application container), then it is configured by default to have an empty path, like "http://host:8085/{rest}".

cheers,


author: Per Samuelsson
body: OK, seems fair enough to me.

Thanks for the support with this issue!

Best regards,


author: markus_korbel
body: Does this workaround still work for Bamboo 5.6.2?


author: benson margulies
body: It rejects with a security error, even if I tell wget to provider username and password.


author: Przemek Bruski
body: Use POST method


author: Przemek Bruski
body: The same thing should work.


author: benson margulies
body: What is the recipe for this for 5.3?


author: PiotrA
body: Please try something like this:

[http://host:8085/bamboo/chain/admin/config/detectBranches.action?planKey=${planKey}](http://host:8085/bamboo/chain/admin/config/detectBranches.action?planKey=%24%7BplanKey%7D)

comments: author: Russell Howe
body: Thanks for the suggestion, but that results in a 404 page for me on Bamboo verson 4.1.2