TeamCity Kotlin DSL Build Priorities

We are using the Kotlin DSL feature to create a variety of build projects and configurations for our several branches in version control. It's a luxurious setup, wherein creating new branches and migrating settings from one branch to another takes minimal human effort. Super.

The docs at https://www.jetbrains.com/help/teamcity/working-with-build-queue.html#Managing+Build+Priorities suggest that creating priority classes and assigning them to builds happens on the queue rather than on the builds, thru the UI.

Is it possible to create or assign priority classes with Kotlin DSL?

0
1 comment
Hi! Unfortunately, it isn't possible to configure Build Queue Pritories with Kotlin DSL because currently, Versioned Settings can only store project-specific settings, while the priorities are stored as a separate entity that does not "belong" to the DSL scope (projects and configurations definition).

We had similar questions in the past, so I filed a feature request for you to upvote and track the issue and get notified, should the feature get implemented:
https://youtrack.jetbrains.com/issue/TW-79306
You might also be interested in tracking these issues:
https://youtrack.jetbrains.com/issue/TW-23266 (set priorities via REST API)
https://youtrack.jetbrains.com/issue/TW-41645 (rule-based priority, e.g., assign this priority to all configurations under a specific project).

In the meantime, please be informed that custom priority classes are stored in /config/build-queue-priorities.xml file, so technically, you could also programmatically amend the file. Someone else at JetBrains tested it the changes came into effect immediately, although as this is not the intended way of using the feature, there could be downsides to this approach that we are not aware of yet.
1

Please sign in to leave a comment.