Triggering a feature build in TeamCity
I am on TeamCity version 2017.1.2. I am trying to trigger feature builds via your HTTP/REST API using POST messages. I am using your documentation here: https://confluence.jetbrains.com/display/TCD10/REST+API#RESTAPI-TriggeringaBuild
I tried triggering a feature build with an invalid branch name. Instead of giving me an error, TeamCity ran a build on the default branch (master).
Is there any reason why you don't display an error in this case?
Please sign in to leave a comment.
There are 2 reasons for that:
- build configuration can have several VCS roots and not all of them can have all branches. E.g. one git root tracks only master branch, another tracks all branches. When build starts in a feature branch we use the default branch in the first root
- builds in chain can have different set of branches. E.g. build configuration B has a snapshot dependency on build configuration A. The configuration B tracks all branches, the configuration A has only one branch. One can start build in a B on feature branch and TeamCity will use the default branch in build configuration A.
There is an experimental ability to disable fallback to default branch and fail build instead. To enable it add the following as a first line in the branch specification:
#! fallbackToDefault: false
TeamCity will still start a build, but build will fail to compute revisions.