Merge lp:~james-w/udd/drop_email_failures into lp:udd

Proposed by James Westby
Status: Rejected
Rejected by: Vincent Ladeuil
Proposed branch: lp:~james-w/udd/drop_email_failures
Merge into: lp:udd
Prerequisite: lp:~james-w/udd/drop-cricket
Diff against target: 97 lines (+0/-74)
4 files modified
bin/email-failures (+0/-7)
importer.crontab (+0/-1)
udd/scripts/email_failures.py (+0/-55)
udd/tests/test_email_failures.py (+0/-11)
To merge this branch: bzr merge lp:~james-w/udd/drop_email_failures
Reviewer Review Type Date Requested Status
Vincent Ladeuil Disapprove
Martin Pool Approve
Review via email: mp+85722@code.launchpad.net

Description of the change

Hi,

The email-failures script output isn't going to anywhere that is being
read that I am aware of, so we should drop it.

Thanks,

James

To post a comment you must log in.
lp:~james-w/udd/drop_email_failures updated
559. By James Westby

Merged drop-cricket into drop_email_failures.

Revision history for this message
Martin Pool (mbp) wrote :

I do get and scan the email, but I won't miss them if they stop.

  vote approve

review: Approve
Revision history for this message
Vincent Ladeuil (vila) wrote :

I don't get the email but would love to. Never found where I should add my email for that though.

Now, if I understand it correctly, this will send a single email for all failure where I'd prefer a single mail by failure.

My use case is that I sometimes postpone requeuing a failed import that looks spurious until I can capture the traceback somewhere. Receiving an email for such failures and being able to 'just hit delete' for the uninteresting ones would be ideal.

Revision history for this message
Martin Pool (mbp) wrote :

On 17 December 2011 00:43, Vincent Ladeuil <email address hidden> wrote:
> I don't get the email but would love to. Never found where I should add my email for that though.
>
> Now, if I understand it correctly, this will send a single email for all failure where I'd prefer a single mail by failure.
>
> My use case is that I sometimes postpone requeuing a failed import that looks spurious until I can capture the traceback somewhere. Receiving an email for such failures and being able to 'just hit delete' for the uninteresting ones would be ideal.

I think this is controlled by ~pkg_import/.forward. I've added you.
If it's useful and James doesn't find it too bad to have it in the
tree, let's leave it.

--
Martin

Revision history for this message
James Westby (james-w) wrote :

On Mon, 19 Dec 2011 18:03:24 +1100, Martin Pool <email address hidden> wrote:
> I think this is controlled by ~pkg_import/.forward. I've added you.
> If it's useful and James doesn't find it too bad to have it in the
> tree, let's leave it.

Yeah, if it's being used it won't be much work to keep it around.

Thanks,

James

Revision history for this message
Vincent Ladeuil (vila) wrote :

This has been used and useful so rejecting the proposal.

review: Disapprove

Unmerged revisions

559. By James Westby

Merged drop-cricket into drop_email_failures.

558. By James Westby

Merge trunk.

557. By James Westby

Drop it from the crontab too.

556. By James Westby

Drop email_failures as it isn't used.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file 'bin/email-failures'
--- bin/email-failures 2011-10-21 10:17:16 +0000
+++ bin/email-failures 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
1#!/usr/bin/python
2
3from udd.scripts.email_failures import main
4
5
6if __name__ == '__main__':
7 main()
80
=== modified file 'importer.crontab'
--- importer.crontab 2011-11-08 13:06:03 +0000
+++ importer.crontab 2011-12-14 18:45:28 +0000
@@ -8,5 +8,4 @@
8*/5 * * * * /usr/bin/python ${SCRIPTS_DIR}/categorise-failures8*/5 * * * * /usr/bin/python ${SCRIPTS_DIR}/categorise-failures
9*/5 * * * * /usr/bin/python ${SCRIPTS_DIR}/add-import-jobs9*/5 * * * * /usr/bin/python ${SCRIPTS_DIR}/add-import-jobs
1017 07 * * * /usr/bin/python ${SCRIPTS_DIR}/list-packages1017 07 * * * /usr/bin/python ${SCRIPTS_DIR}/list-packages
1130 03 * * * /usr/bin/python ${SCRIPTS_DIR}/email-failures
1221 * * * * /usr/bin/python ${SCRIPTS_DIR}/graph-failures1121 * * * * /usr/bin/python ${SCRIPTS_DIR}/graph-failures
1312
=== removed file 'udd/scripts/email_failures.py'
--- udd/scripts/email_failures.py 2011-12-08 18:01:01 +0000
+++ udd/scripts/email_failures.py 1970-01-01 00:00:00 +0000
@@ -1,55 +0,0 @@
1import sys
2
3from udd import (
4 icommon,
5 iconfig,
6 )
7
8
9# Not ideal to declare this here but this is used by several local functions
10# below. Refactoring the whole script may help -- vila 2011-12-07
11conf = None # Will be set by main()
12
13
14def write_email(failures):
15 text = ""
16 for package, reason, when_failed in failures:
17 if reason == icommon.running_sentinel:
18 continue
19 text += "\n\n%s failed at %s due to:\n%s\n" % (
20 package, when_failed, reason.encode("ascii", "replace"))
21 return text
22
23
24def only_main(failures):
25 db = icommon.PackageDatabase(conf.get('pi.sqlite_package_file'))
26 main_packages = db.list_packages_in_main()
27 filtered = []
28 for failure in failures:
29 package = failure[0]
30 if package in main_packages:
31 filtered.append(failure)
32 return filtered
33
34
35def email_failures():
36 db = icommon.StatusDatabase(conf.get('pi.sqlite_file'))
37 failures = db.unemailed_failures()
38 failures = only_main(failures)
39 if failures:
40 content = write_email(failures)
41 print content
42 db.set_failures_emailed(failures)
43
44
45def main():
46 global conf
47 conf = iconfig.ImporterStack()
48 lock = icommon.lock_path(conf.get('pi.script_locks_dir'), 'email_failures')
49 if lock is None:
50 print "Another instance of email_failures is already running."
51 sys.exit(0)
52 try:
53 email_failures()
54 finally:
55 lock.close()
560
=== removed file 'udd/tests/test_email_failures.py'
--- udd/tests/test_email_failures.py 2011-12-08 18:01:01 +0000
+++ udd/tests/test_email_failures.py 1970-01-01 00:00:00 +0000
@@ -1,11 +0,0 @@
1from udd import tests
2
3from udd.scripts import email_failures
4
5
6class TestEmailFailures(tests.TestCaseWithConfig):
7
8 def test_empty(self):
9 email_failures.main()
10 # A lock has been created under the test hierarchy
11 self.assertTestPathExists('locks/scripts/email_failures')

Subscribers

People subscribed via source and target branches