Versioned Settings in Kotlin format throws NullPointerException

Our TC version: TeamCity Enterprise 2018.1 (build 58245)

We turned on Versioned Settings with the following parameters:
Settings format: Kotlin
Generate portable DSL scripts: yes

TC creates an initial commit in the repository (we use git) successfully, but then when it tries to load it back, it throws NullPointerException.
It doesn't like the following line in our Kotlin configuration:

text("project.build.requested_windows_machine", "${Start.depParamRefs["project.build.requested_windows_machine"]}", display = ParameterDisplay.HIDDEN, allowEmpty = true)

More specifically it doesn't like: "${Start.depParamRefs["project.build.requested_windows_machine"]}"

The line is inside:

object SuperProjectLinux : Template({
name = "SuperProject_Linux"

params {
text("project.build.requested_windows_machine", "${Start.depParamRefs["project.build.requested_windows_machine"]}", display = ParameterDisplay.HIDDEN, allowEmpty = true)

Start is defined in the separate file as:

object Start : BuildType({
templates(SuperProjectLinux)
name = "start"
description = "Generate build identifiers"

params {
  param("project.build.requested_windows_machine", "")

 

Is this some limitation or bug in TeamCity?  Just to mention: we don't modify a generated configuration, i.e. TC can't load a configuration that is generated by it. 

 

0
3 comments

Hi,

 

I've been trying your setup in 2018.2.4 but it seems to work for me just fine. Could you give it a shot in a 2018.2.4 installation? This might have been a past issue fixed in the many bugfixes that were introduced for the Kotlin DSL since, or it might be something else from your environment that I might be missing.

 

Please try it in a newer version. If you still have issues with it, report back and we'll try to figure out what's differing between your environment and my tests.

0
Avatar
Permanently deleted user

Hi Denis,

Thanks for the investigation! 

We use TeamCity server supported by our IT department. I'm not sure it will be easy to convince them to try a new version, but will see.

Thanks for the advice. 

0

If it's not too much of a burden, you could probably set up your own test server on a local installation, TeamCity professional is free of charge. We'd still recommend upgrading to the last release due to bugfixes, security fixes and so on, but at least it'd give an idea of whether I'm missing something on my tests or it's an issue already fixed.

0

Please sign in to leave a comment.