Adding Git information to the TeamCity builds based on what was discussed with TC engineers.
The main thing to consider is that TeamCity can report the git username in 4 different ways (😅) based on repository-specific settings (https://www.jetbrains.com/help/teamcity/git.html#General+Settings). So we need to get the current username style being used and then parse the username based on it. Two out of the 4 styles that users can choose do not have the user email, and for those we need to generate an email based on the information that we know:
We give to users the possibility to specify the "email domain" parameter so that we will use that in combination with the name to generate an email (e.g. if they specify "mynicecompany.com", we will generate something like johndoe@mynicecompany.com)
If they are using a style without email and they do not provide any email, we will use TeamCity as the email domain (johndoe@TeamCity)
Adding Git information to the TeamCity builds based on what was discussed with TC engineers.
The main thing to consider is that TeamCity can report the git username in 4 different ways (😅) based on repository-specific settings (https://www.jetbrains.com/help/teamcity/git.html#General+Settings). So we need to get the current username style being used and then parse the username based on it. Two out of the 4 styles that users can choose do not have the user email, and for those we need to generate an email based on the information that we know: