I am trying to configure a project in TeamCity DSL and I want to be able to specify versionedSettings for that project, else I have to manually edit the Version Settings in the UI after the project has been imported/created.
Here is a sample configuration I try to use:
version = "2021.2"
project {
vcsRoot(TheVCS)
features {
versionedSettings {
mode = VersionedSettings.Mode.ENABLED
allowEditingOfProjectSettings = false
settingsFormat = VersionedSettings.Format.KOTLIN
buildSettingsMode = VersionedSettings.BuildSettingsMode.PREFER_SETTINGS_FROM_VCS
}
}
}
object TheVCS : GitVcsRoot({
name = "TheVcs"
url = "https://git.repo/1234"
userNameStyle = UserNameStyle.NAME
branch = "refs/heads/main"
branchSpec = "+:refs/heads/(*)"
checkoutPolicy = AgentCheckoutPolicy.NO_MIRRORS
})
Generating the XML (mvn teamcity-configs:generate) for this configuration will result in:
[ERROR] Error while generating TeamCity configs:
[ERROR] Validation error: Project 'RootProjectId', project feature [1/1]: Versioned settings project feature cannot be used in relative project hierarchy
Do I need to specify the versionedSettings in some other way or is this correct and the behavior a bug? Googling the error message resulted in only two matches without any answers: