Triggering builds by subfolders

Hi,

I’ve been trying to create a build configuration that’s triggered only on changes within a subfolder in a TFS repository.

I started out with a repository trigger, referencing the entire TFS repository (covered by a single Continua repository, monitoring all branches) and specifying a branch pattern like “**Subdirectory**” (in Configuration -> 6 Triggers -> Edit -> Trigger Branch [tab] -> Branch Pattern). That resulted in an unexpected behavior; all other configurations that shared my repository were no longer triggered. This feels like a bug but we want to make sure we're not doing something wrong. Could you check/confirm this?

After that I created a configuration specific (Continua) repository where I changed the Relative folder under branch setting to “/Sources/Subdirectory”. I specified a default branch “/Main” and set the Branches to Monitor to All branches. I assumed that a build configuration that uses this repository would only trigger on changes within the limited scope of the repository, but that is not the case:
- If I set the build trigger to “All branches”, the build is triggered on any change made in the repository (even when that change does not relate to any branch, which I think is also a bug).
- If I set the build trigger to “Default branch”, the build is never triggered. (Expecting only /Main to trigger)
- If I set the build trigger to “Pattern matched branches” and specify /Main, the build is triggered on any change made in the main branch.

Is there any way I can configure the trigger, repository or combination of both in order to respond to changes in a subset of my repository?

Final Remark:

Invalid build triggers of changes outside the branch are marked as '(No Branch)'. We also noted that for this specific repository, when starting a build, this '(No Branch)' is also presented in the branch dropdown in the Queue Options. Other projects/configurations do not have this special 'branch', so it feels like that this is related to our TFS repository layout. What I can tell is that we have the following folders:

$/TFSProject
 + /Main [TFS branch]
 + /Branches
   + /Branch1 [TFS branch]
   + /Branch2 [TFS folder, not converted to branch]
 + /POC [TFS folder, not converted to branch]

Could it be that Continua is considering all root folders as branches? I was expecting, at least for TFS, that Continua will honor the TFS mechanism of explicitly marking folders as branch and this ignore all (root)folders that were not converted to branch.

Apologies for the large amount of information. We're a bit confused and we just want to give you as much information as possible.

Kind regards,
Remko Seelig

Hi Remko,

Thank you for reporting this. There does seem to be an issue with if you choose “All Branches” and then enter a “Relative folder under branch”. This should only list changes under the relative folder as part of the branch - any changes in any branch which are outside this relative folder should not be included. It looks like the “relative folder under branch” setting is being ignored in this case - we are looking into this at the moment and will get a fix out as soon as possible. 

Note that the branch pattern needs to be a regular expression - “Subdirectory” is not valid. This is for matching against a branch not a folder so in your case a branch pattern of “/Branches/Branch\d+” would match /Branches/Branch1 but not /Branches/Branch2 because this is not a TFS branch.

Continua does get a list of explicity marked branches from TFS and allocates changeset to those branches. Any changesets which are not associated with a branch are allocated under “(no branch)”. This is necessary as many people do not use explicitly mark branches in TFS. We could possibly have a option to exclude changesets with no branch although a correct branch pattern should fix this.

> “If I set the build trigger to “Default branch”, the build is never triggered. (Expecting only /Main to trigger)” 

We couldn’t reproduce this scenario - a change on any folder within the default branch “/Main” would trigger a build with “Default branch” set on the trigger and “All branches” set on the repository (although again the “relative folder under branch” setting was ignored). We will however do some further testing on this once we have implement the above fix.


Hi Remko,

The following build contains fixes for the issues you have reported with TFS repositories:


Please let us know if you still encounter problems after installing this version.

Dave, thanks for the update. I’m not sure if this fixes our problem, I’ll send you an email through support, this way I can send you some more information, including some screenshots.