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

Warn users about invalid FAS email / bugzilla account mapping #169

Merged
merged 11 commits into from Mar 6, 2015

Conversation

@pypingou
Copy link
Member

commented Mar 3, 2015

Currently admins are getting an email every 10 minutes informing them about invalid mappings. Then, we email the users so that they can act on it.

With this change, users will be automatically notified.

Sometime, it takes a really long time for users to react, recently we have seen more than a week. So while we do not want to spam users as much as we do for admins (every 10 minutes), we still want to pressure them into fixing it by sending them a hourly reminder.

pypingou added 8 commits Mar 3, 2015
The error's arguments are a tuple of information whose last item is the
human readable description of the error.
So instead of storing the tuple, store its human readable description
This change retrieves from the error message the email of the user
affected.
It then sends an email to that user about the situation and the steps
that can be taken to resolve it.
The email is then stored in a JSON object on disc, together with the
current date (UTC) as unix timestamp.
For every run, the script will check the date of the last update (ie last
time we notified the user about the issue) and if the delta is more than
3600 seconds (60*60 = 1 hour), a new email will be sent.

So users will receive a hourly reminder to change their synchronize their
bugzilla/FAS emails/account while admins will keep getting the information
every 10 minutes (as currently).
''' Browse the list of errors and when we can retrieve the email
address, use it to notify the user about the issue.
'''
tmpl_email = """Greetings.

This comment has been minimized.

Copy link
@ralphbean

ralphbean Mar 4, 2015

Contributor

Make the template configurable so we can change it without a new release?

This comment has been minimized.

Copy link
@pypingou

pypingou Mar 4, 2015

Author Member

👍

The Fedora admins.
"""
data = None

This comment has been minimized.

Copy link
@ralphbean

ralphbean Mar 4, 2015

Contributor

Why not default data to {}, that way you wouldn't have to check if data all the time further down in the code.

This comment has been minimized.

Copy link
@pypingou

pypingou Mar 4, 2015

Author Member

Sure can do

with open(DATA_CACHE) as stream:
data = json.load(stream)
except Exception as err:
print 'Could not read the json file', err

This comment has been minimized.

Copy link
@ralphbean

ralphbean Mar 4, 2015

Contributor

Perhaps include the value of DATA_CACHE in this error message to help debugging years down the road?

This comment has been minimized.

Copy link
@pypingou

pypingou Mar 4, 2015

Author Member

Good idea yes :)

@ralphbean

This comment has been minimized.

Copy link
Contributor

commented Mar 4, 2015

I take it this gets kicked off by a cronjob every 10 minutes (and that we're going to adjust that 10 minute interval to something longer in our ansible setup?)

@pypingou

This comment has been minimized.

Copy link
Member Author

commented Mar 4, 2015

I take it this gets kicked off by a cronjob every 10 minutes (and that we're going to adjust that 10
minute interval to something longer in our ansible setup?)

No the cron will keep running every 10 minutes, so Kevin and I will still be spammed (at least for now), but users will only the notification once per hour.

pypingou added 3 commits Mar 5, 2015
This way we can adjust the email without changing the code.
Also, do not send any notification if there is no email configured in
the configuration file.
@ralphbean

This comment has been minimized.

Copy link
Contributor

commented Mar 5, 2015

👍 here

pypingou added a commit that referenced this pull request Mar 6, 2015
Warn users about invalid FAS email / bugzilla account mapping
@pypingou pypingou merged commit 3bcc259 into master Mar 6, 2015
@pypingou pypingou deleted the pkgdb_sync_bz branch Mar 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.