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

User email address lookup in Perforce stopped working

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Critical Critical
    • p4-plugin
    • None
    • Platform: All, OS: All

      We used to have users' email addresses looked up in Perforce, but it has stopped
      working. I think this happened in the 1.0.15 release of the plugin.
      I found issue 1374 which was a request to implement this lookup in the first
      place, and stumbled upon issue 1022 where the submitter mentions a change to
      PerforceMailResolver in October (fits with 1.0.15).
      Symptom: Mail is sent to "username" instead of "email address" (for users not
      already registered in Hudson's list of people).

          [JENKINS-4933] User email address lookup in Perforce stopped working

          torbent created issue -

          emmulator added a comment -

          Were you using Matrix builds, or did you have any slave nodes? I'm the one who
          made the change to the PerforceMailResolver. It was relying on an instance
          variable that was volitile in a distributed build environment. I suspect that
          it only worked when there was only one node, or perhaps it worked so long as it
          was called before any distributed builds had run. I didn't see any way to fix
          it while also supporting distributed matrix builds.

          Isn't there a simple workaround in that you can just edit the user's information
          to set the email address manually? I realize that's not ideal, but there's no
          equivalent workaround for broken distributed builds, so unless someone can
          figure out how to support both, I think the distributed builds are more
          important than getting email addresses from perforce. I'm sure it is possible
          to do both, I just didn't see how when I looked at it.

          emmulator added a comment - Were you using Matrix builds, or did you have any slave nodes? I'm the one who made the change to the PerforceMailResolver. It was relying on an instance variable that was volitile in a distributed build environment. I suspect that it only worked when there was only one node, or perhaps it worked so long as it was called before any distributed builds had run. I didn't see any way to fix it while also supporting distributed matrix builds. Isn't there a simple workaround in that you can just edit the user's information to set the email address manually? I realize that's not ideal, but there's no equivalent workaround for broken distributed builds, so unless someone can figure out how to support both, I think the distributed builds are more important than getting email addresses from perforce. I'm sure it is possible to do both, I just didn't see how when I looked at it.

          emmulator added a comment -

          emmulator added a comment - http://n4.nabble.com/PerforceMailResolver-is-broken-td395080.html

          torbent added a comment -

          No, not using Matrix builds (yet - am considering it, but hesitant).
          Yes, have some slaves. I haven't verified whether email lookup only fails on
          slaves or also on Master.
          As far as I recall, the email lookup used to take place at the end of the build,
          when/if it was necessary in order to blame someone. But I could be wrong.

          Yes, I can (and have) edit the users when this happens, which it fortunately
          rarely does these days, but a fix would definitely be nice. I agree that matrix
          builds are more important, though

          torbent added a comment - No, not using Matrix builds (yet - am considering it, but hesitant). Yes, have some slaves. I haven't verified whether email lookup only fails on slaves or also on Master. As far as I recall, the email lookup used to take place at the end of the build, when/if it was necessary in order to blame someone. But I could be wrong. Yes, I can (and have) edit the users when this happens, which it fortunately rarely does these days, but a fix would definitely be nice. I agree that matrix builds are more important, though

          Rob Petti added a comment -

          The work-around of adding users' emails manually doesn't really work for installations with 270+ users, unfortunately.

          As near as I can tell, the mail resolver was working fine before this change, though you are completely right in fixing the instance variable at the expense of this functionality.

          I'll take a look at it to see if I can't get it working again, but it looks like it will be pretty complicated.

          Rob Petti added a comment - The work-around of adding users' emails manually doesn't really work for installations with 270+ users, unfortunately. As near as I can tell, the mail resolver was working fine before this change, though you are completely right in fixing the instance variable at the expense of this functionality. I'll take a look at it to see if I can't get it working again, but it looks like it will be pretty complicated.

          torbent added a comment -

          If performing a (simple) user lookup is so difficult to add in the code, then I'd be afraid to even look at it

          On a serious note, there's no requirement that the user lookup is the last thing to be done, so if it's possible to perform it during checkout/polling/whenever, before any distribution takes place, then perhaps that's a working solution? The user(s) in question obviously have touched the code, so their email addresses are interesting - we might not need it on /this/ build, but we're almost certain to need it /sometime/.

          torbent added a comment - If performing a (simple) user lookup is so difficult to add in the code, then I'd be afraid to even look at it On a serious note, there's no requirement that the user lookup is the last thing to be done, so if it's possible to perform it during checkout/polling/whenever, before any distribution takes place, then perhaps that's a working solution? The user(s) in question obviously have touched the code, so their email addresses are interesting - we might not need it on /this/ build, but we're almost certain to need it /sometime/.

          Code changed in hudson
          User: : rpetti
          Path:
          trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/PerforceMailResolver.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=24485
          Log:
          [FIXED JENKINS-4933] fixed perforce email resolution. It should now work normally again.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : rpetti Path: trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/PerforceMailResolver.java http://fisheye4.cenqua.com/changelog/hudson/?cs=24485 Log: [FIXED JENKINS-4933] fixed perforce email resolution. It should now work normally again.
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Rob Petti added a comment -

          I've submitted a fix to the trunk. It appears to work fine in my tests using both a master build and a slave build, but more testing is certainly welcome.

          Rob Petti added a comment - I've submitted a fix to the trunk. It appears to work fine in my tests using both a master build and a slave build, but more testing is certainly welcome.

          torbent added a comment -

          Nice. I can only test released stuff, so I'll wait ...

          torbent added a comment - Nice. I can only test released stuff, so I'll wait ...

            rpetti Rob Petti
            torbent torbent
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: