toomasr edited a comment on Bug JENKINS-16332

Experiencing similar problem. Unable to send out the emails to the build failed culprits. I went checked out the relevant code in Jenkins, Mercurial plugin and the Mailer plugin. Here is my understanding based on the read source code:

Mercurial states that the author format is FirstName LastName <email@address_ ( see http://www.selenic.com/mercurial/hgrc.5.html )

Now the mercurial plugin sees the author part with that format and asks Jenkins to get a user or create one by indirectly invoking https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/User.java#L298

During the creation Jenkins will introduce some replacing ( https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/jenkins/model/DefaultUserCanonicalIdResolver.java#L44 ) and all < and > turn into underscores.

And now we've created a Jenkins user FirstName LastName _email@address_. Not sure why we want to do this but probably a good thing for later to pick up the culprits.

Now a build fails and Mailer plugin asks Jenkins to give him the culprits. Jenkins has recorded those users for the build and provides the list of FirstName Lastname _email@address_ users.

Now Mailer asks for the addresses of the users but as those are empty it will use a MailAddressResolver ( https://github.com/jenkinsci/mailer-plugin/blob/master/src/main/java/hudson/tasks/MailAddressResolver.java#L100 - there is a specific subclass for Subversion also but didn't sis Mercurial) and it will do some magic but probably fails because Mailer still tries to send to FirstName Lastname _email@address_.

I see couple of options here

  • Mailer plugin(s) to detect the emails better when none is defined
  • Mercurial plugin will do the email address extraction itself, as it knows the format and will then set explicitly the email addresses for the users it creates
  • Mercurial plugin will create the user with the email address instead of the FirstName LastName <email@address> format. In this case any dark magic that does email address extraction from user id might succeed.

Any holes in my logic? Anyone wants to take crack at it? I'm off to vacation without a laptop

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to