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

Moves e-mail config into luigi.Config classes #1871

Merged
merged 4 commits into from
Oct 5, 2016

Conversation

daveFNbuck
Copy link
Contributor

Description

Moves all configuration access in notifications.py to use luigi.Config classes.

Also sets a default 10 second timeout for smtp.

Motivation and Context

Today when I was trying to figure out why my luigi server stopped responding at 5am, my only clue was that the last line in the log had it sending an e-mail. When I went to the notifications code to see if e-mail has a timeout, I found the config fetching code a bit outdated and hard to read. So I decided to move it to a luigi.Config class like we use in worker and scheduler. This ended up cascading until I had moved all the config accesses into Config classes. As part of this, the parameters are no longer under [core] but all current settings are still backward-compatible.

Since I had started this due to a nasty result of not having an smtp timeout, I gave timeout a 10-second default while I was at it.

Have you tested this? If so, how?

I left the unit tests mostly as-is and they remained passing (except for the ones that don't pass on my machine in master). I only adjusted for changed function signatures in the send_email functions.

I deployed my server with unchanged configuration and triggered a disable e-mail and got it.

I ran the docs test and opened the configuration docs to verify they look right.

@mention-bot
Copy link

@daveFNbuck, thanks for your PR! By analyzing the annotation information on this pull request, we identified @jslovan, @jackdwyer and @interskh to be potential reviewers

@Tarrasch
Copy link
Contributor

Tarrasch commented Oct 3, 2016

Yes, yes, yes! :)

There still seems to be some valid travis failures. Can you look into it?

@daveFNbuck
Copy link
Contributor Author

Yeah, it broke my pipeline over the weekend too, I'll be fixing it first
thing tomorrow. I guess I should have tested it with workers too before
deploying and leaving...

On Sun, Oct 2, 2016 at 7:23 PM, Arash Rouhani notifications@github.com
wrote:

Yes, yes, yes! :)

There still seems to be some valid travis failures. Can you look into it?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1871 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AB_rbQ4fN_B2xKpajm0JTJ81d8sCyk6sks5qwGc1gaJpZM4KLo14
.

Copy link
Contributor

@Tarrasch Tarrasch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for requesting a minor change this late. But can you update this section? https://github.com/Houzz/luigi/blob/e12093aac2924595185b038b737e0181e8cc9f56/luigi/notifications.py#L24-L29?

Basically the TODO is not fixed, and there's not error-email anymore. :)

kudos on the good name replacement "receiver"! 👍

@daveFNbuck
Copy link
Contributor Author

Updated. Glad you like the new name :)

config_path=dict(section='core', name='email-type'),
choices=('plain', 'html', 'none'),
description='Format type for sent e-mails')
method = luigi.parameter.ChoiceParameter(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A fantastic use of @brcopeland's ChoiceParameter from #1800!

@Tarrasch Tarrasch merged commit ec54601 into spotify:master Oct 5, 2016
@Tarrasch
Copy link
Contributor

Tarrasch commented Oct 5, 2016

This is the kind of patch that make a maintainers day! Great job! :)

@daveFNbuck
Copy link
Contributor Author

Glad you like it :)

On Tue, Oct 4, 2016 at 10:00 PM, Arash Rouhani notifications@github.com
wrote:

This is the kind of patch that make a maintainers day! Great job! :)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1871 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AB_rbeI1SK00gZ0TNe2SZYqyrm_KEvoDks5qwy7ygaJpZM4KLo14
.

@daveFNbuck daveFNbuck deleted the email_config branch June 2, 2017 00:01
This was referenced Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants