VCS Trigger not working on all branches
Hi,
I'm having a the following VCS config:
Default branch: refs/heads/master
Branch specification:
+:refs/heads/(master)
+:refs/heads/(release-*)
+:refs/pull/(*/merge)
In the VCS trigger both Trigger rules and Branch filter is empty and Trigger build on each check-in is checked. This config trigger builds both on refs/pull/(*/merge) and refs/heads/(master) but not on refs/heads/(release-*). TeamCity do discover the latter one, but I need to manually run the build.
What's wrong?
Thanks in advance :)
Please sign in to leave a comment.
Hi Jorgen and sorry for the delay,
this issue is pretty weird indeed. You can check the server logs for VCS actions triggering builds (or in this case it might say that it found the changes but didn't trigger anything). Could you try to explicitly set the branches in the VCS Trigger? While having the field empty should trigger on all of them, maybe some change either in the root or the trigger happened that left it in an inconsistent state and modifying one (or both) might help.
Hi Denis
I have checked the logs as you said and it seems like the VCS Trigger do not find any changes to refs/heads/(release-*)-branches. The refs/heads/(release-*)-branches are new on GitHub on every release and from the logs it seems like TeamCity do not find any changes to them:
revisions={refs/heads/master: 5feba..., refs/heads/release-2017-04-06-1: null, and 12 more unchanged branches}} to state RepositoryState{defaultBranch='refs/heads/master', revisions={refs/heads/master: 5feba..., refs/heads/release-2017-04-06-1: 5feba..., and 13 more unchanged branches}}; 0 changes collected 0 changes persisted
How do I configure TeamCity to trigger these branches?
Hi Jorgen,
I think I'm starting to see why this is happening. Newly created branches do not have new commits, just branch off of master, I suppose. If this is the case, then the behavior is normal. If you then create a commit in the newly created branch, it should trigger properly. You can probably create any new branch with any name that would match the spec and the same behavior would reproduce. Until you have a new commit, it will not run a new build.
Could you confirm whether this is actually the case? If so, then creating a new commit in the release branch should be enough.
Hi again Denis,
Yes, that's it! When first pushing the new branch, then add a commit and push again the VCS Trigger picks up the commit and build the release-branch.
If this is not in the documentation I will suggest you to add this behavior as this was not to intuitive :)
Thank you!
Is there any way to trigger build just on new branch (that matches the spec) appear?