-
Notifications
You must be signed in to change notification settings - Fork 28
Manually Migrating WebHooks
This page details the process of manually migrating webhooks. Typically, this is from the v2 format (plugin-settings.xml) to the v3 format (ProjectFeatures).
For most users, the webhooks will be migrated automatically the first time the v3 plugin starts. However, there are scenarios when this does not work.
- Project Settings are stored in VCS as Kotlin. Allow editing project settings via UI is disabled.
- Project Settings are stored in VCS as Kotlin. Allow editing project settings via UI is enabled.
- Project Settings are stored in VCS as Kotlin. Allow editing project settings via UI is enabled. I have a patch file.
- Project Settings are stored in VCS as XML. Allow editing project settings via UI is disabled.
- Project Settings are stored in VCS as XML. Allow editing project settings via UI is enabled.
- Project Settings are not stored in VCS. Some or all webhooks have vanished from the UI.
- Project Settings are not stored in VCS. There are unexpected (ghost) webhooks showing in the UI.
Each webhook is declared using the webHookConfiguration function inside a features block in the project's settings.kts file.
For details see:
WebHooks are stored as Project Features in the project-config.xml. This is an XML representation of a Map (dictionary) of name/value pairs that define the attributes of a webhook.
See other items on this page for instructions on how to generate these XML elements. Writing them by hand is not easy.
Within the repository, there will be plugin-settings.xml files for each project. There may be sub-projects within the same repository.
Each webhook found in each of these files will need to be migrated to the settings.kts.

Once migrated, the <webhooks> element can be removed from these files. If there is no other plugin configurations in these plugin-settings.xml files, the file can be completely removed.
It is not possible for tcWebHooks to migrate webhooks into VCS automatically. The settings.kts file must be manually updated in the kotlin DSL format. Fortunately tcWebHooks can generate the KotlinDSL for these webhooks to ease the process of generating valid Kotlin configurations.
- The migration report generated on first run should contain example KotlinDSL configurations for existing webhooks. They are grouped together in the file for each project.
- Visiting
/webhooks/migration.html?project=MyProjectIdin TeamCity will display KotLin configurations for all webhooks found inplugin-settings.xml. Note: ReplaceMyProjectIdwith the project Id of the relevant TeamCity project.
The follow the directions on:
Although it is possible to migrate settings, the changes are created as "patch" files in the repository as a set of Name/Value pairs in a strange kotlin object.
The settings.kts file must then be manually updated in the kotlin DSL format based on the input from the diff files. This is not very user friendly, and it's better to just generate the webhook configuration in Kotlin from the plugin settings. For this reason migrations are not attempted automatically for KotlinDSL projects.
Fortunately tcWebHooks can generate the KotlinDSL for these webhooks to ease the process of generating valid Kotlin configurations.
- The migration report generated on first run should contain example KotlinDSL configurations for existing webhooks. They are grouped together in the file for each project.
- Visiting
/webhooks/migration.html?project=MyProjectIdin TeamCity will display KotLin configurations for all webhooks found inplugin-settings.xml. Note: ReplaceMyProjectIdwith the project Id of the relevant TeamCity project.
The follow the directions on:
Project Settings are stored in VCS as Kotlin. Allow editing project settings via UI is enabled. I have a patch file.
This means that webhook changes have been made in the UI and TeamCity has peristed those changes into a patch file because it doesn't know how to convert Project Features into the tcWebHooks KotlinDSL. This is a known shortcoming of the KotlinDSL format.
For full details on migrating patch contents, please see Migrating webhooks from Kotlin Patch Files
It is not possible for tcWebHooks to migrate webhooks into VCS automatically. The project-config.xml file must be manually updated in in XML format. Fortunately tcWebHooks can generate the project features as XML for these webhooks to ease the process of generating valid XML configurations.
- The migration report generated on first run should contain example XML configurations for existing webhooks. They are grouped together in the file for each project.
- Visiting
/webhooks/migration.html?project=MyProjectIdin TeamCity will display XML configurations for all webhooks found inplugin-settings.xml. Note: ReplaceMyProjectIdwith the project Id of the relevant TeamCity project.
The follow the directions on:
- Home
- Installing
- Configuration
- Templates
- Parameters (aka Variables)
- Example Webhook output
- WebHooks REST API