Closed Bug 827856 Opened 13 years ago Closed 13 years ago

Suppress the weekly War on Orange summary email to dev.tree-management if the OF is 0.0

Categories

(Tree Management Graveyard :: OrangeFactor, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: emorley)

References

Details

Attachments

(1 file, 2 obsolete files)

...since something must have broken. Bonus points if we email someone about the failure too :-)
(It happened again this week)
Attached patch Patch v1 (obsolete) — Splinter Review
Assignee: nobody → emorley
Status: NEW → ASSIGNED
Attachment #699258 - Flags: review?(mcote)
Comment on attachment 699258 [details] [diff] [review] Patch v1 This looks good, but can you move the check above the previous_stats assignment? No point in getting last week's stats if this week's don't make any sense. Didn't feel like adding in an email alert? :) Should be simple; I would just add a new (optional) entry to the conf file, maybe [email] admin, which contains a list of emails to be alerted when this problem occurs.
Attachment #699258 - Flags: review?(mcote) → review+
Attached patch Patch v2 (obsolete) — Splinter Review
How about this? Also makes test mode return early, since we previously would have still sent the newsgroup post etc.
Attachment #699258 - Attachment is obsolete: true
Attachment #702350 - Flags: review?(mcote)
Comment on attachment 702350 [details] [diff] [review] Patch v2 Review of attachment 702350 [details] [diff] [review]: ----------------------------------------------------------------- ::: woo_mailer.py @@ +232,5 @@ > + print 'To: %s' % ', '.join(mail_dest) > + print 'Subject: %s' % subject > + print > + print text > + return The newsgroup message was *not* being sent in test mode; it was just being displayed so we could see headers and such and verify that it would have been sent. I think I'd like to keep that behaviour. @@ +239,5 @@ > + sys.stderr.write('This week\'s orange count is zero! Something must have broken :-( Sending email to admin only...\n') > + sendemail(from_addr=from_address, to_addrs=admin_email, > + subject=subject, username=mail_username, > + password=mail_password, text_data=text, > + server=mail_server, port=mail_port, use_ssl=mail_ssl) I think we need an additional message in here, preferably in the subject line, alerting us that something bad happened. Since this just looks like the regular email report, it would be too easy to ignore or miss.
Attachment #702350 - Flags: review?(mcote) → review-
(In reply to Mark Côté ( :mcote ) from comment #5) > The newsgroup message was *not* being sent in test mode; it was just being > displayed so we could see headers and such and verify that it would have > been sent. I think I'd like to keep that behaviour. Oh I totally missed the second options.test_mode conditional inside the newsgroup block. I thought it had been omitted. Yeah in that case, patch v2 doesn't make sense.
Attached patch Patch v3Splinter Review
* If we're using test_mode continues as normal, since we'll want to have the results printed as is * Otherwise if not, and OF <= 0 we email the admin(s) with a more noticeable subject & we exit(1) + print the error message (thanks to the trick at http://docs.python.org/2/library/sys.html#sys.exit) * Also removes unused import 'os' (now zero pyflakes warnings)
Attachment #702350 - Attachment is obsolete: true
Attachment #702553 - Flags: review?(mcote)
Comment on attachment 702350 [details] [diff] [review] Patch v2 Perfect, thanks. :) I'll deploy it as soon as you check it in.
Attachment #702350 - Flags: review- → review+
Comment on attachment 702350 [details] [diff] [review] Patch v2 r+ed the wrong patch here....
Attachment #702350 - Flags: review+ → review-
Comment on attachment 702553 [details] [diff] [review] Patch v3 Carry over this r+ with the removed unused import.
Attachment #702553 - Flags: review?(mcote) → review+
In production.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Depends on: 854907
Product: Testing → Tree Management
Product: Tree Management → Tree Management Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: