REST API: No branch name if default branch isn't present in vcs root

Answered

Hello,

I use REST API for build management and I found some strange thing about the system.

If I have any value in field "Default branch: *", I receive JSON object like this:

  "properties": {
  "count": 10,
  "property": [
    {
      "name": "branch",
      "value": "refs/heads/001.00/develop"
    },
    {
      "name": "teamcity:branchSpec",
      "value": "+:refs/heads/(*/feature)\n+:refs/heads/(*/bugfix)"
    },
    ]
   }

This object has field "branch" that contains actual build branch name.

But if the field "Default branch: *"  is empty - I get object without "branch" field. Other parameters of vcs-root and builds are absolutely identical.

And second thing - the field Default branch is marked as mandatory, but there is no reaction if this field is empty.

 

Is this a bug or a feature?

2 comments
Official comment

Hi Denis,

The snippet you included lists properties of a build configuration, which do not have influence on the actual settings until used via a reference like "%branch%".

"Default branch" setting of a VCS root does not support patterns, it should contain a fixed branch name. Patterns in "Branch specification" field.

If you have questions about the setup, please detail all the related settings and note your original task you are trying to solve, using REST API.

Oh, I forgot! The Teamcity version is 9.1.6 (build 37459)

0

Please sign in to leave a comment.