Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-9016

Git creates usernames based on 'name' not the email.

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin
    • git plugin 1.1.6
      git plugin 2.0, jenkins 1.540, ubuntu 13.10

      I realize mapping git author/commit users back to Jenkin's users is pain, but perhaps it could be done a little better.

      Some ideas:

      • Try looking up a user's email and comparing that.
      • Using the user portion from the email (e.g. someuser@example.com becomes someuser).
      • Looking up the user's email in LDAP, if LDAP is being used.

      The last would be ideal for us.

      Ciao!

          [JENKINS-9016] Git creates usernames based on 'name' not the email.

          Christian Höltje created issue -

          Code changed in jenkins
          User: Andrew Bayer
          Path:
          src/main/java/hudson/plugins/git/GitChangeSet.java
          http://jenkins-ci.org/commit/git-plugin/3607d2ec90f69edcf8cedfcb358ce19a980b8f1a
          Log:
          [FIXED JENKINS-9016] If no Jenkins user is found for the commit's user.name value, use the username section of the email address instead.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/main/java/hudson/plugins/git/GitChangeSet.java http://jenkins-ci.org/commit/git-plugin/3607d2ec90f69edcf8cedfcb358ce19a980b8f1a Log: [FIXED JENKINS-9016] If no Jenkins user is found for the commit's user.name value, use the username section of the email address instead.
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          dogfood added a comment -

          Integrated in plugins_git-plugin #119
          [FIXED JENKINS-9016] If no Jenkins user is found for the commit's user.name value, use the username section of the email address instead.

          Andrew Bayer : 3607d2ec90f69edcf8cedfcb358ce19a980b8f1a
          Files :

          • src/main/java/hudson/plugins/git/GitChangeSet.java

          dogfood added a comment - Integrated in plugins_git-plugin #119 [FIXED JENKINS-9016] If no Jenkins user is found for the commit's user.name value, use the username section of the email address instead. Andrew Bayer : 3607d2ec90f69edcf8cedfcb358ce19a980b8f1a Files : src/main/java/hudson/plugins/git/GitChangeSet.java

          Code changed in jenkins
          User: Andrew Bayer
          Path:
          src/test/java/hudson/plugins/git/AbstractGitTestCase.java
          http://jenkins-ci.org/commit/git-plugin/12515a33b7ae0e8030fbc61575e6cd445850ceb2
          Log:
          Fixing test failures due to JENKINS-9016 fix.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/test/java/hudson/plugins/git/AbstractGitTestCase.java http://jenkins-ci.org/commit/git-plugin/12515a33b7ae0e8030fbc61575e6cd445850ceb2 Log: Fixing test failures due to JENKINS-9016 fix.

          Joel Hough added a comment -

          I'm still having issues with this.
          In my setup, we use ldap for authentication. The ldap username has almost no similarity to the author name or email in our git commits (we use full and proper "Firstname Lastname <Firstname.Lastname@Companyname.com>" for that).
          What would work is searching for existing users by email address rather than using the email segment as a username, since the ldap plugin does properly set the email field to the same address as is listed in the git commit (assuming case insensitivity).

          Joel Hough added a comment - I'm still having issues with this. In my setup, we use ldap for authentication. The ldap username has almost no similarity to the author name or email in our git commits (we use full and proper "Firstname Lastname <Firstname.Lastname@Companyname.com>" for that). What would work is searching for existing users by email address rather than using the email segment as a username, since the ldap plugin does properly set the email field to the same address as is listed in the git commit (assuming case insensitivity).

          Jean-Sébastien Pédron added a comment - - edited

          I agree with Joel's comment.

          In our setup, only users changing their full name in Jenkins to match the one in Git have their commits associated. Other people have two "accounts": the one they use to authenticate (LDAP) and the one automatically created with Git commits.

          Using the e-mail address to do the mapping seems to be a better solution.

          Jean-Sébastien Pédron added a comment - - edited I agree with Joel's comment. In our setup, only users changing their full name in Jenkins to match the one in Git have their commits associated. Other people have two "accounts": the one they use to authenticate (LDAP) and the one automatically created with Git commits. Using the e-mail address to do the mapping seems to be a better solution.
          Jean-Sébastien Pédron made changes -
          Assignee Original: Andrew Bayer [ abayer ] New: abierbaum [ abierbaum ]
          Resolution Original: Fixed [ 1 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

          Jan Vansteenkiste added a comment - - edited

          I have created some initial code on this subject. The only question that remains is whether the plugin is the right place for my UserEmailResolver.
          I also had some troubles getting the tests going and had to add a newer jenkins-core, ui-samples-plugin, jenkins-test-harness and javadoc to the dependencies.

          https://github.com/vStone/git-plugin/commit/63612268d832edc7a77d0be55e650e31fc5442a9

          Jan Vansteenkiste added a comment - - edited I have created some initial code on this subject. The only question that remains is whether the plugin is the right place for my UserEmailResolver. I also had some troubles getting the tests going and had to add a newer jenkins-core, ui-samples-plugin, jenkins-test-harness and javadoc to the dependencies. https://github.com/vStone/git-plugin/commit/63612268d832edc7a77d0be55e650e31fc5442a9

          In my setup I have users authenticated against corporate Active Directory, which works nice along with LDAP email plugin (email addresses get resolved correctly). User ids look something like 123456, and as such are defined in Global Security. Real user names do get resolved correctly from those numeric ids.
          Unfortunatelly, when it comes to build changes list of the git based projects, the real user names do not get resolved correctly as they do not contain those numeric ids any more. For the commiter/author "Dominik Drzewiecki <dominik.drzewiecki@acme.com>" which is a concatenation of git user.name and user.email configuration parameters I get the changelog entry commited by dominik.drzewiecki which cannot be futher resolved either against AD (id) or LDAP (email). It seems that Jan's patch that adds one extra resolution step would do the trick.

          Dominik Drzewiecki added a comment - In my setup I have users authenticated against corporate Active Directory, which works nice along with LDAP email plugin (email addresses get resolved correctly). User ids look something like 123456, and as such are defined in Global Security. Real user names do get resolved correctly from those numeric ids. Unfortunatelly, when it comes to build changes list of the git based projects, the real user names do not get resolved correctly as they do not contain those numeric ids any more. For the commiter/author "Dominik Drzewiecki <dominik.drzewiecki@acme.com>" which is a concatenation of git user.name and user.email configuration parameters I get the changelog entry commited by dominik.drzewiecki which cannot be futher resolved either against AD (id) or LDAP (email). It seems that Jan's patch that adds one extra resolution step would do the trick.

            Unassigned Unassigned
            docwhat Christian Höltje
            Votes:
            51 Vote for this issue
            Watchers:
            61 Start watching this issue

              Created:
              Updated: