Symptoms
Confirmed affected versions: 2024.12, 2023.05.2
When using Versioned Settings with the When build starts: use settings from VCS option enabled, TeamCity carries out the build steps despite encountering the Failed to load build settings from VCS build problem due to invalid settings stored in the VCS.
Cause
This behaviour stems from TeamCity's current fallback mechanism. When the VCS settings fail to load, the build system defaults to the existing server settings. This can lead to undesirable results, as these older settings may yield unhelpful or even counterproductive outcomes.
Resolution
As a workaround, consider one of the following options.
- [via DSL] Set the build execution mode
executionMode = BuildStep.ExecutionMode.RUN_ON_SUCCESS, for example:
steps {
script {
id = "simpleRunner"
executionMode = BuildStep.ExecutionMode.RUN_ON_SUCCESS
scriptContent = "echo 'Hello, Wordl!'"
}
}
- [via web UI] Modify the step settings in the Execute step section, choosing the Only if build status is successful condition.
Additional information
If you are interested in a dedicated option to immediately stop the build if TeamCity cannot apply the settings from VCS, upvote this feature request: TW-93326.
Comments
0 comments
Please sign in to leave a comment.