Any way to prevent build steps inherited from a template from being overriden?

Completed

Today while reviewing some build configurations, I saw that a build step had been changed compared to the template it was inheriting from.  We have both a TC9 and a TC2020 setup, and I know this isn't possible in TC9, as overriding template-inherited build steps was added in TC 2018.1.

My question is: is it possible to prevent this behavior?  I.e., do not allow a build step to be changed if it is inherited from a template in TC2020?

0
8 comments

You are correct that this capability was added in TeamCity 2018.1 as a feature request here: TW-53250. TeamCity doesn't currently offer any way to revert this behavior to pre-2018.1 logic. It seems that this has never been inquired about before, would you mind describing your use case for us? 

0

We have a team who manages the creation and maintenance of our build templates, which may then be instantiated or consumed by other teams.  We do not want users who inherit from these templates to be able to disable or override any of the build steps from the template.  However, an enforced settings template is not appropriate because we group our build configurations and projects by application domain, not by what type of build they are, so there may not be common settings between different build configurations in a single project.  One might be a node server build, while another might be a java microservice build.  They may come from different source control repositories and thus have different mechanisms for tagging their builds in a build step. 

Instead, we'd prefer that if a build config is inheriting from a template, the users who might still need to update build PARAMETERS (meaning they require a role that would also allow them to update build STEPS) cannot override the functionality we have declared as mandatory.

0

Do you want these same users to be able to create build configurations and create new steps in them or is it just about being able to change parameters?

0

They should be able to change build parameters, and potentially create new build configurations that inherit from the templates.  They may even be able to ADD build steps to the template.  We just don't want them to be able to disable an inherited step in the build configuration or to change the behavior of an inherited step.

0

After looking into this further, it seems we do have an option for you to try. There is a parameter that can be added to your internal properties or an individual build configuration to prevent modification to the inherited settings from the Web UI. Try adding the parameter `teamcity.ui.overrideInherited.buildSteps.enabled=false` to a build configuration that has some inherited build steps to see if it would be a good fit for you. If you wish to add it to all of your TeamCity projects, you can add the parameter to your internal properties.

We also have a feature request to break up the "edit project" permission to be more customizable, which may also apply to your case. If we were to allow for a new permission such as, "modify inherited build steps" or "override inherited build steps", I think it may provide much more flexibility for you. If you like this idea, please consider voting and/or commenting on this feature request, TW-46234

0

Hi Eric, if I'm understanding right, you're saying I should create a configuration parameter at some level of the project hierarchy called "teamcity.ui.overrideInherited.buildSteps.enabled" with value "false?"  And if I want to set it globally, instead of setting it as a param on the root project, I could set it as an internal property?

0

That's correct, yes.

0

I verified that this works at the project level.  Very handy find, thank you so much!

0

Please sign in to leave a comment.