TrimbleSolutionsCorporation/TeamcityTriggerHook

regression 4.0.0 - configurations with <default> no longer triggered

jmecosta opened this issue · 8 comments

@auriusbendikas it seems if a build contains no branch definitions (the default when you create a vcs root) then the hook is no longer able to trigger the default branch. instead it triggers the captured build.

this is a regression from previous version, do you have a solution for this? or do we need to add another advanced option?

Hi @jmecosta,

Not sure if I understand you correctly.

If you create vcs root. The default branch will be "refs/heads/master", you can trigger it by writing regex:

"(refs/heads/master)"

However I agree this is probably not straight forward. I have checked the code. And if I would change the validation to allow regexp with no parentheses then regex:

"refs/heads/master" would also work.

I could change validation logic to say "no more than one capturing group is allowed" instead of "Must have exactly one capturing group."

@jmecosta,

Sorry got really busy two days. Will take a deeper look at it tomorrow.

Hello @jmecosta,

I have done some testing with TC version 9.1.7 and 2017.1.3. And yes I agree there is some weirdness with 9.1.7. But I could not find any "showstoper" issues or something that I could call regression. Before I go there and describe my findings here goes my testing method:

Method

  1. I have created VCS root with all defaults, just added git URL and authentication data. (the default branch is "refs/heads/master" by default).
  2. Checked to "Clean all files in the checkout directory before the build"
  3. Created a build job with some shell script that outputs file contents from the file in GIT repository.
  4. Attached the VCS root to newly created build.
  5. Next I have created two build triggers triggering the same build job with regex:
    • "(refs/heads/master)" - to test success
    • "refs/heads/(master)" - to test failure
  6. And I made some commits to master branch on bitbucket
  7. And I have manually triggered a build from Team City by clicking "Run..." just to compare a results.

Result Teamcity 9.1.7

All "Run..", build, "(refs/heads/master)" and "refs/heads/(master)" have triggered and have built successfully. However only "Run.." has been recognized as <default> branch other builds were identified as refs/heads/master and master respectfully,

Result Teamcity 2017.1.3

All "Run..", build, "(refs/heads/master)" and "refs/heads/(master)" have triggered and have built successfully. Both "Run.." and "(refs/heads/master)" have been recognized as <default> and as expected "refs/heads/(master)" was recognized as "master"

Summary

As you can see I have trouble seeing regression in this behavior, since builds are working in all versions. And looks like since 2017.1.X it even gets properly recognized.

ok, confirmed that in 2017 versions the behaviour is indeed correct. So we should make a not in the documentation about this default branch and how to achive the same with (refs/heads/master)

thanks for the testing....

if its ok from your side i will prooceed wiht the release

@jmecosta

Go ahead 😉

@auriusbendikas release done. thanks for all the help.