VCS Trigger's branch filter seems not working in template.

I have a template which I base build configurations on.
Obviously, there are no VCS Roots attached at this level, though in this template I have a VCS Trigger. But if I specify a branch filter there (+:refs/pull/*/merge), it does not work: the trigger does not activate the build.

However, when I apply same branch filter (+:refs/pull/*/merge) in a build configuration with attached VCS root, effectively overriding branch filter of inherited  VCS Trigger from the template, builds are triggered as expected.

 

But I would like to set branch filter value in the template instead of setting it for every build configuration individually.

 

0
5 comments

Hi Pavel! 

Could you please provide more details about your setup because I'm unable to reproduce the described problem. What TeamCity version do you use? You've mentioned that you specified `+:refs/pull/*/merge` filter, but for VCS trigger you need to specify a logical branch name (https://www.jetbrains.com/help/teamcity/2019.1/branch-filter.html). Are you sure that the same settings work if you specify them in a build configuration? 

0

Here is the simple example that works in my case: 

Branch filter in a VCS trigger in a template is `+:*/merge`. 

Branch filter in a VCS root in a build configuration is `+:refs/pull/(*/merge)`.

0

for VCS root I usually add all branches +:*,

and in VCS Trigger branch filter I override template's value (nothing) with +:refs/pull/*/merge

An it works fine. Only Pull Requests trigger builds. That's what I need.

However, if I set VCS Trigger branch filter in template, builds are not triggered.

TC Proffesional 2019.1.1 (build 66192)

 
 
 
 
0

Hi Pavel. 

I'm unable to reproduce the problem so far. With described settings builds are triggered on my test server (as they should be). 

For further investigation, we need more data from you. Could you please turn on debug-vcs logging, reproduce the problem and share with us teamcity-server.log and teamcity-vcs.log files? You can create a bug report in our YouTrack and make all files visible only to the teamcity-developers group. 

0

Also, do not forget to attach screenshots for settings page (VCS root and VCS trigger) for both build configuration and template. Just to make sure I understood everything correctly. 

0

Please sign in to leave a comment.