Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-27262]: email is not sent #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[JENKINS-27262]: email is not sent #20

wants to merge 1 commit into from

Conversation

fhuberts
Copy link

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
@jenkinsadmin
Copy link
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@fhuberts
Copy link
Author

ping!

@olivergondza
Copy link
Member

It lacks test for sure, I am not sure bout the surrounding code coverage...

@fhuberts
Copy link
Author

So now what?

In my defense: there were also no tests for the commit that broke this...

@daniel-beck
Copy link
Member

@fhuberts It would be great if you could cover this part of the code with some tests. This will also prevent a future change from just breaking your use case if it's covered by a test.

@oleg-nenashev
Copy link
Member

It worth to print a warning that e-mail resolution is falling back to the user ID. In such case it worths to try the "MailAddressResolver" extension point in Jenkins core.

@fhuberts
Copy link
Author

There was no warning before so why should there be one now?

@oleg-nenashev
Copy link
Member

@fhuberts
Before the change you would get Messages.MailSender_NoAddress warning for this case

@fhuberts
Copy link
Author

Might be. But before the change that broke it there was no warning.

And in fact I think that falling back is actually wrong.
In fact I want NO resolving of the email address.
I have a mail server setup that does that for me.
So should everyone else. Mail with a wrong address will get bounced and delivered to the postmaster.

Resolving against jenkins users is wrong. Might be convenient for some people, but wrong anyway.

@oleg-nenashev
Copy link
Member

But before the change that broke it there was no warning.

Now we have an opportunity to improve the code. Just use a convenient logging level (INFO or FINE)

Resolving against jenkins users is wrong. Might be convenient for some people, but wrong anyway.

This is a right way in Jenkins, because there are many ways to determine it in Jenkins including e-mails explicitly set by users on their profile pages. BTW the code above your check already calls Mail address resolvers, so it should work for registered users.

For non-registered users the common approach is to add e-mail suffixes if they're specified. If you don't specify the e-mail suffix from the global config, you will get the behaviour you want => it's a convenience way.

@fhuberts
Copy link
Author

Well, my Jenkins servers are tightly coupled to my git server and the jenkins server has a local MTA that has the MTA of the git server as a relayhost.
This is not an uncommon setup.

I specify simple (git server) mail aliases in jenkins jobs.
Again, not uncommon.

I can understand that resolving against jenkins users is needed for some fields, but for email? Come on. Job reports are not normally emailed to individual users are they? They go to groups and lists.

Anyway, we can argue all we want but it doesn't seem useful.

Can I expect progress on merging this patch?
It only adds a fallback and should therefore not break anything out there.

@oleg-nenashev
Copy link
Member

I can understand that resolving against jenkins users is needed for some fields, but for email? Come on.

This is a main functionality of the Mailer plugin. If you disagree with it, you can consider creating a plugin for your use-cases. Adding extra behavior configs to Mailer can be considered as well.

Can I expect progress on merging this patch?

You've been asked to provide unit tests and a logging of the case. If you address this comments, you will get a +1 at least from me

@fhuberts
Copy link
Author

So why the higher standard for me?
There are no tests now

@fhuberts
Copy link
Author

Someone more familiar with the code can write these tests way faster than me and I have no interest in becoming a contributor.
This is a drive-by fix

@oleg-nenashev
Copy link
Member

It's a problem with the original code, but it's not a standard. It's just an issue to be fixed. BTW some tests are available in Jenkins harness and acceptance test suites.

Someone more familiar with the code can write these tests

If somebody agrees with this approach, then the PR gets merged. Since there's no active maintainer of the plugin, we need a joint agreement. I suppose somebody from Jenkins contributors will consider finalizing this PR when he needs a new release, but open-source contributors don't provide any SLAs.

For the current PR state I'd abstain. Probably @daniel-beck or @olivergondza are ready to accept the PR.

@daniel-beck
Copy link
Member

try the "MailAddressResolver" extension point in Jenkins core.

@oleg-nenashev FYI It's now in this plugin.

@daniel-beck
Copy link
Member

@fhuberts Wouldn't a default email suffix of @localhost or similar in Configure Jenkins work here? Have you tried that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants