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

The user email field as populated by jenkins/perforce plugin contains the incorrect email address..

      The user email address as fetched by Jenkins for a Perforce user is incorrect. It is of the form "<domain>_<username>@<p4_client_name>". Instead it should be directly fetched from the p4 user details.
      The same should be done for the name of the user. It should be fetched from the FullName p4 user field.

      – Posted from Bugbox for Android

          [JENKINS-8987] The user email field as populated by jenkins/perforce plugin contains the incorrect email address..

          Rob Petti added a comment -

          Can you please add a logger for "hudson.plugins.perforce.PerforceMailResolver" and try again? The output will help me debug what's going on. It looks odd because if the perforce plugin can't get the email address for whatever reason, Jenkins should be using <username>@<domain> by default. There's no way that it should be able to get the client name.

          Rob Petti added a comment - Can you please add a logger for "hudson.plugins.perforce.PerforceMailResolver" and try again? The output will help me debug what's going on. It looks odd because if the perforce plugin can't get the email address for whatever reason, Jenkins should be using <username>@<domain> by default. There's no way that it should be able to get the client name.

          Rob Petti added a comment -

          BTW, the Full Name of the user cannot be updated by the SCM, as Jenkins does not provide an appropriate interface.

          Rob Petti added a comment - BTW, the Full Name of the user cannot be updated by the SCM, as Jenkins does not provide an appropriate interface.

          Gagan Malik added a comment - - edited

          I've masked the actual domain, user, job and p4 client names..

          --------------------------------------------------------------------------------------------
          Mar 9, 2011 11:11:59 AM hudson.plugins.perforce.PerforceMailResolver findMailAddressFor
          FINE: Email address for anonymous requested.

          Mar 9, 2011 11:11:59 AM hudson.plugins.perforce.PerforceMailResolver findMailAddressFor
          FINE: Got email (DOMAIN_user1@p4Client1) from perforce for DOMAIN_user1

          Mar 9, 2011 11:11:59 AM hudson.plugins.perforce.PerforceMailResolver
          FINER: Trying to get email address from perforce for DOMAIN_user1

          Mar 9, 2011 11:11:59 AM hudson.plugins.perforce.PerforceMailResolver
          FINER: Checking job1's SCM for DOMAIN_user1's address.

          Mar 9, 2011 11:11:59 AM hudson.plugins.perforce.PerforceMailResolver findMailAddressFor
          FINE: Email address for DOMAIN_user1 requested.
          --------------------------------------------------------------------------------------------

          I don't know if this helps narrow down the problem but the email mentioned under people -> user1 -> configure is DOMAIN_user1@p4Client1
          is this filled in by the perforce plugin or the plugin reads it from here?

          Let me know if you need anymore details..

          Gagan Malik added a comment - - edited I've masked the actual domain, user, job and p4 client names.. -------------------------------------------------------------------------------------------- Mar 9, 2011 11:11:59 AM hudson.plugins.perforce.PerforceMailResolver findMailAddressFor FINE: Email address for anonymous requested. Mar 9, 2011 11:11:59 AM hudson.plugins.perforce.PerforceMailResolver findMailAddressFor FINE: Got email (DOMAIN_user1@p4Client1) from perforce for DOMAIN_user1 Mar 9, 2011 11:11:59 AM hudson.plugins.perforce.PerforceMailResolver FINER: Trying to get email address from perforce for DOMAIN_user1 Mar 9, 2011 11:11:59 AM hudson.plugins.perforce.PerforceMailResolver FINER: Checking job1's SCM for DOMAIN_user1's address. Mar 9, 2011 11:11:59 AM hudson.plugins.perforce.PerforceMailResolver findMailAddressFor FINE: Email address for DOMAIN_user1 requested. -------------------------------------------------------------------------------------------- I don't know if this helps narrow down the problem but the email mentioned under people -> user1 -> configure is DOMAIN_user1@p4Client1 is this filled in by the perforce plugin or the plugin reads it from here? Let me know if you need anymore details..

          Rob Petti added a comment -

          It's filled in by the plugin, and the log states that it's being fetched correctly. I'm guessing that DOMAIN_user1 isn't set up correctly in perforce.

          If you run "p4 user -o DOMAIN_user1", I'm willing to bet that the email address will be defined as "DOMAIN_user1@p4client" since that's the default for new users.

          Rob Petti added a comment - It's filled in by the plugin, and the log states that it's being fetched correctly. I'm guessing that DOMAIN_user1 isn't set up correctly in perforce. If you run "p4 user -o DOMAIN_user1", I'm willing to bet that the email address will be defined as "DOMAIN_user1@p4client" since that's the default for new users.

          Gagan Malik added a comment -

          you are right.. but why is it trying to get the email for DOMAIN_user1 instead of DOMAIN\user1?
          Even jenkins states the name with a backslash \ between domain and username.. not an underscore..

          or am I missing something here?

          Gagan Malik added a comment - you are right.. but why is it trying to get the email for DOMAIN_user1 instead of DOMAIN\user1? Even jenkins states the name with a backslash \ between domain and username.. not an underscore.. or am I missing something here?

          Rob Petti added a comment -

          Upon examining the Jenkins code, it looks like '\' isn't supported for the user id (among other things), so it's replaced with '_' upon creation. It doesn't look like there's anything I can do, since the original user id string is destroyed upon creation. What's being displayed is likely the Full Name of the user, which we can't always count on being the correct perforce user ID.

          Using 'domain\username' for all your perforce users is definitely not a use-case that any of the plugin devs have considered, so it would take quite a bit of refactoring in order to support such an odd convention.

          Rob Petti added a comment - Upon examining the Jenkins code, it looks like '\' isn't supported for the user id (among other things), so it's replaced with '_' upon creation. It doesn't look like there's anything I can do, since the original user id string is destroyed upon creation. What's being displayed is likely the Full Name of the user, which we can't always count on being the correct perforce user ID. Using 'domain\username' for all your perforce users is definitely not a use-case that any of the plugin devs have considered, so it would take quite a bit of refactoring in order to support such an odd convention.

          Gagan Malik added a comment - - edited

          Interesting! As per my understanding, the domain\username convention is pretty standard with Windows networks.
          Another thing that I would like to point out here is that the name field in Jenkins is also being set in an incorrect fashion, if it is supposed to contain the full name. This is because right now it is being populated with the username as opposed to the full name from the p4 user details.

          Ideally I believe it should be the full name but since it is not and 'if it is not supposed to be', I assume the \ and _ should be a easy fix then.

          Gagan Malik added a comment - - edited Interesting! As per my understanding, the domain\username convention is pretty standard with Windows networks. Another thing that I would like to point out here is that the name field in Jenkins is also being set in an incorrect fashion, if it is supposed to contain the full name. This is because right now it is being populated with the username as opposed to the full name from the p4 user details. Ideally I believe it should be the full name but since it is not and 'if it is not supposed to be', I assume the \ and _ should be a easy fix then.

          Rob Petti added a comment -

          domain\username is standard in windows networks, yes, but this is perforce, not windows networking. I've never seen anyone else use that convention for perforce, even those set up for domain authentication.

          As I mentioned, Jenkins does not provide an appropriate interface for retrieving the Full Name of a user from any SCM. By default, it's set to whatever user ID is being requested ("domain\username" in this case). This is what is displayed when you examine the Jenkins user in the web UI.

          I'm already working on a solution that involves adding a separate property to jenkins user objects that will store the correct perforce user id. It should make it into the next release.

          Rob Petti added a comment - domain\username is standard in windows networks, yes, but this is perforce, not windows networking. I've never seen anyone else use that convention for perforce, even those set up for domain authentication. As I mentioned, Jenkins does not provide an appropriate interface for retrieving the Full Name of a user from any SCM. By default, it's set to whatever user ID is being requested ("domain\username" in this case). This is what is displayed when you examine the Jenkins user in the web UI. I'm already working on a solution that involves adding a separate property to jenkins user objects that will store the correct perforce user id. It should make it into the next release.

          Gagan Malik added a comment - - edited

          sorry! I assumed perforce set up with active directory authentication uses domain\username by default in case of multiple domains.
          Thanks for the explanation

          looking forward to have this working..
          thanks!

          Gagan Malik added a comment - - edited sorry! I assumed perforce set up with active directory authentication uses domain\username by default in case of multiple domains. Thanks for the explanation looking forward to have this working.. thanks!

          Rob Petti added a comment -

          This should be fixed, but it might take several builds for the information to be correctly populated.

          Rob Petti added a comment - This should be fixed, but it might take several builds for the information to be correctly populated.

            rpetti Rob Petti
            gaganmalik Gagan Malik
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: