5

I have a TeamCity continuous build process setup for a personal GitHub project which works well. However, in TeamCity I want to see a list of commits under "My Changes" (http://teamcity/changes.html).

Under "VCS Username Settings" (http://teamcity/vcsSettings.html) I have set the username as "benpowell" to match my Github account and as you can see all commits are logged under that name. However, none of the commits are logged under "My Changes".

Any ideas why?

Dave Schweisguth
  • 36,475
  • 10
  • 98
  • 121
Rebecca
  • 13,914
  • 10
  • 95
  • 136

4 Answers4

10

One note that might help is that TeamCity has a "Username style" setting under the VCS root itself. For a new installation of TeamCity 9.0.1, it defaulted to just "Userid". I had to go in and change it to "Author Email". Note - this setting is hidden under "advanced options".

Per the screen, it will only affect newly collected changes from source.

Once this is done, you should be able to use email addresses under VCS Username successfully.

See the screenshot for more details on this setting:

enter image description here

David Mohundro
  • 11,922
  • 5
  • 40
  • 44
3

I had a similar problem and found this post helpful. There are three things that determine the user bindings between your commits to git and build information in TeamCity:

  1. Setting the correct git identity in your local clone (i.e. git config user.name, and also user.email). This is how git stamps your commits.
  2. Establishing the mapping between your git identity and your TeamCity identity. This is done by setting the UserName Style in the advanced settings of your VCS roots.
  3. Setting the default username in the Version Control Username Settings in your TeamCity user profile. This is the value that will be used as the lookup key by the mapping you specified in #2.

So, for example, assume a user has a local clone git identity of user.name JCoder and user.email joe.coder@foo.com (#1 above), and UserName Style of UserId (#2) above, and a TeamCity account with the Name Joseph Coder and Version Control Username Setting of joe.coder (#3) above.

TeamCity will correctly attribute this user's changes (in build history, for example) to the TeamCity user Joseph Coder. This is because the UserName Style of UserId maps between git and TeamCity users by using the email prefix of user.email, joe.coder in this case. Note that there are several Username Styles (mapping styles). I stick with UserId because it uses the email address which is typically the most stable identifier.

BitMask777
  • 2,543
  • 26
  • 36
3

To find the correct VCS username open up TeamCity and view your build. Under Recent History you'll see a column that is called Changes, which links to the commit/push that triggered the build (if you have continuous integration setup).

The username is shown there as seen below in the screenshot:

Notably, the username does appear to be linked to my email address. It is the username part of my Gmail address. I'm assuming Github extracted that, because I wouldn't have chosen that username personally.

Rebecca
  • 13,914
  • 10
  • 95
  • 136
1

With GitHub you need to add the email address used in the commits to your GitHub account for it to see them as your commits.

Arrowmaster
  • 9,143
  • 2
  • 28
  • 25
  • 1
    This was helpful in that it gave me an idea of where to look, but it was not correct. – Rebecca Feb 16 '12 at 12:47
  • This worked for me. In TC, per Junto's answer, it showed "fname lname " When I went into TC's "Version Control Username Settings" and changed my "Default for all of the Git roots" to "myemail@domain.com" I was able to see all of "My Changes" Note: this was on TC Enterprise 8.0.4 (build 27616). – Al Dass Mar 02 '14 at 23:07