Predefined parameter in a template is accidentally hided by a generated one (%system.build.vcs.number%)

Suppose I want to create a configuration template. I know in advance that there will be a VCS root attached to a configuration created from this template. Imagine that I want to use e.g. `system.build.vcs.number` in this template. Now as there is no a VCS root in this template teamcity will create a build parameter called `build.vcs.number` HIDING the predefined one with an empty default (and it will persist in a configuration even though it does have a VCS root) What is the point of this behavior? If a user wants to create a new build parameter it can just choose a different name that won't clash with the predifined ones.

Could you suggest a workaround for this? I decided that for now I will need to explicitly remove the generated parameter in every inheriting configuration.

0
2 comments

The point of this behavior is that it's possible to override default parameters in configurations just fine. As a workaround, you can use a different name instead, and assign that parameter as %build.vcs.number% on the configurations themselves (if you do it on the template you will face the same issue). While this initially might be similar to removing the parameter, it gives you more flexibility if in the future you need to change it to some different value.

0
Avatar
Permanently deleted user

I was able to work around this exact problem by creating a parameterized VCS root, and attaching that to the template.  Now I can use %build.vcs.number% in the template, and it won't be shadowed in the parameters section.  With some intelligent defaulting (All the repos I will use for this template have the same basic URI structure), it's pretty easy to use.

0

Please sign in to leave a comment.