0
votes

I'm trying to implement Storing Project Settings in Version Control approach on a new project in TeamCity 2020.1.4 (build 78906).

As a VCS Subversion is used. Also there is a pre-commit hook which rejects all the commits when their commit message does not start from a ISSUE-ID or ??.

TeamCity successfully authenticated in a Subversion VCS root but failed to make an initial commit of the settings.

By default TeamCity makes following commit message (pre-commit hook reports the inital message):

USERNAME: TeamCity change in '<Root project>' project: commit current project settings

Next in the docs Committing Current Project Settings to VCS there is a note:

When TeamCity commits settings into a VCS, it uses the standard commit message noting the TeamCity user as the committer and the project whose settings have changed. It is possible to add a fixed custom prefix to each settings' change committed by TeamCity via the teamcity.versionedSettings.commitMessagePrefix internal property, for example, teamcity.versionedSettings.commitMessagePrefix=TC Change\n\n.

Brilliant! I set up an internal property like this:

teamcity.versionedSettings.commitMessagePrefix=?? TeamCity settings autocommit. 

Trying again, but the prefix is placed after the username:

USERNAME: ?? TeamCity settings autocommit. TeamCity change in '<Root project>' project: commit current project settings

Why? I set up a PREFIX!

Of course, here there is a note

Q. Who are the changes authored by?

A. If the settings are changed via the user interface, in Git and Mercurial a commit in the VCS will be performed on behalf of the user who actually made the change via the UI. For Perforce as well as Azure DevOps Server (formerly TFS), the name of the user specified in the VCS root is used, and in Subversion the commit message will also contain the username of the TeamCity user who actually made the change via the UI.

but how to disable or rearrange the message? The pre-commit hook customization is not a good way.

I've also tried to find more Internal Properties, a complete list may be, but just found a ticket Add centralized list of internal properties and their purpose to the wiki/documentation referencing to still opened task Create a reference page in documentation with a list of all internal properties already mentioned on other pages.

How could I make the TeamCity's Subversion commit message started from ???

1

1 Answers

0
votes

I've avoided the problem using a hack with username: TeamCity allows to use dashes and spaces in a username and I created the a user with the username set to ISSUE-ID bla-bla.

But I still hope there is a way to change the prefix properly.