Bamboo tag trigger delay
Asked by Mariusz Dullak:

Hi all,

I have a plan that is triggered by tag.

When I push the tag to the repo is takes quite some amount of time (in minutes like 3 to 5 I would say) before the plan is actually started.

Is that normal or I am missing something in my configuration.

My assumption was that it should be just like with the commit, almost imminent once the tag is pushed and visible in BitBucket.

What I am experiencing looks more like bamboo pooling for tags.

If so, can I increase the frequency (my users are complaining)?

best

Mariusz


Answers:
author: Eduardo Alvarenga
body: Hello [@Mariusz Dullak](/t5/user/viewprofilepage/user-id/4697927),

Bamboo tag detection follows the branch detection interval which is 5 minutes by default and adds a time 50% delay to that time so it won't compete with the branch check activities, meaning that tag detection will be running every 300 seconds with a delay of 150 seconds.

E.g.

```
09:05:00 -> Branch detection
09:07:30 -> Tag detection
09:10:00 -> Branch detection
09:12:30 -> Tag detection
(...)
```

To adjust the branch detection period, go to:

* Bamboo Administration -\> General Configuration -\> Branch and tag detection interval

Regards,

Eduardo Alvarenga  
Atlassian Support APAC

comments: author: Mariusz Dullak
body: Thanks Eduardo. That is exactly the option I was looking for.


author: Mariusz Dullak
body: Hi again,

Seems that on some branches my tag triggers work and on some (of the same repo and plan) they do not (plan branch configuration is identical and does not contain anything plan branch and git branch specific).

In application-data folder/logs/atlassian-bamboo.log I can see execution of plan when tag was found. Where can I see that the detection was run and that no new tags were found?

Last but not least, are tagged that have been already build stored somewhere? How does bamboo knows which tags should trigger builds - which ones are new?

thanks in advance


author: Eduardo Alvarenga
body: Hello [@Mariusz Dullak](/t5/user/viewprofilepage/user-id/4697927), Good to work with you again!

Bamboo will keep track of all tags from a VCS repository and store them on the VCS_TAG table in the database. When Bamboo scans for tags it compares with the data already present on that table and if there is a match, no triggers are actioned as it understands the tag is already present and was "already triggered" in the past.

If the tag entry is removed from the database, Bamboo will treat it as it was a new tag.

You can configure regular expressions that will be matched and trigger a Plan, so Bamboo will only consider those matched strings as a trigger:

* [Tag triggering](https://confluence.atlassian.com/bamboo/tag-triggering-1031180298.html)
* [How to perform a Bamboo build based on a Git tag](https://confluence.atlassian.com/bamkb/how-to-perform-a-bamboo-build-based-on-a-git-tag-1082269229.html)

You can add some extra DEBUG flags to Bamboo to follow the Tag detection process:

* [Configuring the level of logging on the Bamboo server](https://confluence.atlassian.com/bamboo/logging-in-bamboo-289277239.html#LogginginBamboo-ConfiguringthelevelofloggingontheBambooserver)

You might be interested on adding the following log levels:

* com.atlassian.bamboo.plugins.git=ALL
* com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager=DEBUG
* com.atlassian.bamboo.plan.branch.BranchDetectionServiceImpl=DEBUG

**WARNING**: DEBUG logs may be very verbose!

Regards,

Eduardo Alvarenga  
Atlassian Support APAC


author: Mariusz Dullak
body: Awesome thanks.

I cleaned some garbage (people having typos in tagging script) and looks like it is working as expected now.


author: Eduardo Alvarenga
body: Hey [@Mariusz Dullak](/t5/user/viewprofilepage/user-id/4697927) Good news!

Happy to help!

Kind regards,

Eduardo Alvarenga  
Atlassian Support APAC


author: Mariusz Dullak
body: Welcome again.

Looks like upgrade to 9.4.1 + Java 17 broke our regex again.

[@Eduardo Alvarenga](/t5/user/viewprofilepage/user-id/4365410) any info/news on the changes that might be afecting us here ?

comments: author: Mariusz Dullak
body: Looks like Java 17 does not like $ at the end of the regex.

Removing it seems to do the trick


author: Mariusz Dullak
body: Another few months and I am getting the complains again.

I can see new tags are in the VCS_TAG table, but they never trigger new builds.

So our release process is: create branch release/XX.YY or release/XX.YY-something (where XX is fixed and, Y and Z are numbers).

I have bamboo set to create new branch plan on new branch in VCS on:

\^release\\/XX.\\d\*(-.\*)?

and it works OK.

Our tag - aka release name - policy is XX.YY.ZZ or XX.YY.ZZ-something

The trigger on main branch is commit trigger and in the configuration of branching I have:

Custom trigger, Tag trigger, Tag filter: \^XX\\.\\d\*\\.\\d\*(-.\*)?

and "Only run build if the branch contains the matched tag" since I only want to run one branch (we are working and releasing several releases at the same time, so without this I would expect EVERY active branch to be triggered which is NOT what I want).

This regex should be passing (I tested it several times) on stuff like XX.99.2, XX.98.7, XX.86.5-test etc.

So I can see in the VCS_TAG tags like "XX.99.4" It was pushes to release/XX.99 branch on May 24th 5PM. Nothing happened and someone manually started in on May 25th 11AM.

What is going on here? Is it that there are 3 (three) repos assigned to that build? Is bamboo expecting the tag on each and everyone of them? Branching and tagging is on the "main" repo and since branching is working fine I though everything is OK.

Apparently I am wrong.

Any help would be appreciated.

comments: author: Eduardo Alvarenga
body: Hello [@Mariusz Dullak](/t5/user/viewprofilepage/user-id/4697927)

Thank you for getting back to us.

Your regex is adding a capture group, which may interfere with the matching.

Try the regex below instead. It makes the capture group optional and will match any characters after "-".

```
^XX\.\d+\.\d+(?:-.*)?$
```

As git tags can't have spaces, we don't have to be concerned about termination here.

Kind regards,

Eduardo Alvarenga  
Atlassian Support APAC

**--please don't forget to Accept the answer if the reply is helpful--**


author: Mariusz Dullak
body: Hi [@Eduardo Alvarenga](/t5/user/viewprofilepage/user-id/4365410)

thank you very much for coming back to me.

As usual extremely fast and straight to the point.

I will convert the group and we will see if it will start to work.


author: Mariusz Dullak
body: Hi [@Eduardo Alvarenga](/t5/user/viewprofilepage/user-id/4365410)

coming back after months.

I got a complain today about builds not starting again.

I can see they are OK for some branches and tags and not for other.

Looks like they are OK for regex you provided

```
^XX\.\d+\.\d+(?:-.*)?$
```

but I also had slightly different one which does not work

```
^XX\.\d*\.\d*(?:-.*)?$
```

So for anyone who wondered here with such a problem, please make sure you have + (one or more) and not \* (zero or more). The first one (+) works for me but not the other (\*).