Teamcity Trigger starts on wrong comment

My trigger rule: +:comment=(merge\-to\-master){1}:**

The comment it triggers on: Merge branch 'master' into feature/unirx-zenject-signals-selections-freehand

That should not happen, and it is quite dangerous that the regex filter does not work properly. Did I really misunderstood something? I did test the regex and checked the teamcity help page and I am absolutely sure this rule should not trigger on "master" as I have properly escpaed the - and grouped the input.

0
15 comments

Which version are you using? I have just tried in 2017.1.3 setting a trigger with exactly that rule, and did a commit with exactly that message and it did not trigger (showed the changes, so it was actually pulled). Then did a "merge-to-master" comment and it triggered.

Do you also have any snapshot dependency tied to this build or any other kind of trigger configured?

0

I am using TeamCity 2017.1.2 (build 46812). It just happened again and if the build would not have failed I would have a dirty state on the master, which leaves me REALLY unhappy.

The trigger settings are the following:

The VCS branch settings are:

The advanced search for "merge-to-master" in comments shows 0 changes!

The advanced seach for "merge" in comments shows 39 changes!

The front page of the run says "Triggered by git"

I really need some way to prevent that, while still triggering builds from the commit message :(. I need it soon as this is dangerous and disabling the merge completely would also lead to a lot of workflow problem for our team.



0

Please provide a screenshot of the changes tab of the build triggered by VCS trigger.

0

Everything beginning at 14 Jul 17 12:19 is not even from the same repository anymore, but from a different vcs root which had been attached to this build step earlier as we changed the repository at that point of disconnect (visible in the graph)





0

Thanks, please also attach all teamcity-vcs.logs from TeamCity server machine, to analyze them I'll need an id of the build, it can be found in the build's page url.

0

The teamcity-vcs.logs is large and has 7MB and it looks like I cannot attach .zip files here so i uploaded it here:

url:http://www.sendfiles.net/?uid=0447-80f40a95
pw:GsYyfaui

The build id is 624

0

I think you are facing https://youtrack.jetbrains.com/issue/TW-46576 (https://youtrack.jetbrains.com/issue/TW-46576#comment=27-2388955 describes your setup).

To workaround the problem you can use an experimental parameter teamcity.vcsTrigger.mergedBranchesThreshold=2. It should be added to a build configuration, or a project (will affect all build configurations in this project and its subprojects), or you can add it as an internal property (https://confluence.jetbrains.com/display/TCD10/Configuring+TeamCity+Server+Startup+Properties#ConfiguringTeamCityServerStartupProperties-TeamCityinternalproperties).

1

Please let me know if the parameter helped.

0

Thank you very much for your help, I have set the system parameter and will watch the branches and teamcity closely. I will definetly report back, but I want a few work days(approx. mo-we) to be sure that this critical setting works.

 




I am super happy to have Jetbrains products, you are simply one of the best developers out there and the support has always been superb!

0

This branch still triggers a build on every commit. I assume System.properties had been the wrong place to set this parameter?

0

I added it as internal property (thank you for the link, this was very easy to find that way), merged master downstream, added some wide ranging changes, committed and it looks like this time the branch did not trigger, which looks great :) Let's consider it solved for now, if it really isn't, I will post again.

Have a great day!

0

Is there way to ensure, that it only triggers for commits containing that specific comment?

It still triggered on this branch and the last commit, altough I really did not want to merge this one. I am sure it is likely because the last commit in the immage which contained the merge-to-master text.

0

I think this is by design: VCS trigger detects that this at least one pending commit matched by trigger rules and runs a build. Please check if enabling per-check-in triggering helps. In this case VCS trigger should run a build on the exact commit matched by trigger rules.

0

I will try that :)

0

Please sign in to leave a comment.