When does Bamboo do fetches in plan branches?
Asked by Scott Molinari:

I was told by a great Atlassian staff member (not saying that sarcastically either. I mean it! He has helped me a lot!) in another of my questions, that Bamboo notices changes to a branch through polling, but considers a change only if there was any commit done, after the last fetch that had occured in Bamboo for that branch.

My question is, when does Bamboo do fetches? The only fetch I've seen is the default fetch given, when you try to create a new job. Is that a necessary fetch? Because, I've been deleting them.

Scott


Answers:
author: Przemek Bruski
body: I don't really understand what you want to achieve, but the process (for Git) is roughly like this:

there are several ways in which a build can be triggered. One of them is through polling the repo. Bamboo periodically contacts the repo to see what are the latest changesets for refs (i.e. where to the heads point to). If there's a plan (be it a branch or main plan) using that repo and the previous build for that plan was based on a different changeset, a build is kicked off. This means that we fetch that ref to the server cache and examine the list of changes between the previous build and the current state. When the agent gets that build, he will fetch again - either from the repository server or from an agent-local cache.

comments: author: Scott Molinari
body: So a fetch is, in effect, the trigger?

Read this post. [](/questions/252683/hooking-stash-into-bamboo-with-some-fidelity)<https://answers.atlassian.com/questions/252683/hooking-stash-into-bamboo-with-some-fidelity>

It is what led me to ask the question.

Scott


author: Przemek Bruski
body: A trigger for what?


author: Scott Molinari
body: To create a plan branch and to know when to carry out certain plans in the project.

The repo is polled by doing a fetch and

a. if there is a new branch, a plan branch is triggered to be created.

and/or

b. if there are changes to the repo, the respective plan is triggered.

So the fetching and noticing of changes in the repo is actually the trigger to carry out any certain plan.

(Or, the/a plan triggers through a hook in Stash or there are scheduled triggers.)

Is this the correct concept of triggering branch plans and plans?

Scott


author: Przemek Bruski
body: It's more or less correct except for the fact that the repo is not polled using a fetch, but ls-remote. Fetches happen only when we know we need the changesets.


author: Scott Molinari
body: Can you write that as a solution, so I can check it as an answer?:)

Thanks!

That is what I wanted to know or rather, it helps me understand what is happening in the background.

I still think the play between Stash and Bamboo needs a lot better explanation conceptually and then down to more nuts and bolts levels. And the interface between the two needs more work. I understand this is being done. It would be nice to also know, what direction that work is heading in.

At any rate. Thanks again.

Scott


author: Scott Molinari
body: A polite bump.

Or is there some documentation that clearly explains the concepts behind the connections between Stash and Bamboo (ie. plan branches and updating/ triggering for running plans) and how I, as a customer, should be working with these connections/ triggers? I think the overall clear explanations of the concepts are missing and if they were available the biggest amount of confusion between the two products could be aleviated. Well, that is certainly the case for me.

Scott


author: Scott Molinari
body: Sorry, it isn't a fetch set up as default in a job, it is a checkout. Now I am even more confused.

Scott


Tags: bamboo-administration