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

Proposed by James Westby on 2011-12-14
Status: Rejected
Rejected by: Vincent Ladeuil on 2012-07-02
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 on 2012-07-02
Martin Pool 2011-12-14 Approve on 2011-12-15
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 on 2011-12-14
559. By James Westby on 2011-12-14

Merged drop-cricket into drop_email_failures.

Martin Pool (mbp) wrote :

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

  vote approve

review: Approve
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.

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

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

Vincent Ladeuil (vila) wrote :

This has been used and useful so rejecting the proposal.

review: Disapprove

Unmerged revisions

559. By James Westby on 2011-12-14

Merged drop-cricket into drop_email_failures.

558. By James Westby on 2011-12-13

Merge trunk.

557. By James Westby on 2011-12-10

Drop it from the crontab too.

556. By James Westby on 2011-12-10

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
1=== removed file 'bin/email-failures'
2--- bin/email-failures 2011-10-21 10:17:16 +0000
3+++ bin/email-failures 1970-01-01 00:00:00 +0000
4@@ -1,7 +0,0 @@
5-#!/usr/bin/python
6-
7-from udd.scripts.email_failures import main
8-
9-
10-if __name__ == '__main__':
11- main()
12
13=== modified file 'importer.crontab'
14--- importer.crontab 2011-11-08 13:06:03 +0000
15+++ importer.crontab 2011-12-14 18:45:28 +0000
16@@ -8,5 +8,4 @@
17 */5 * * * * /usr/bin/python ${SCRIPTS_DIR}/categorise-failures
18 */5 * * * * /usr/bin/python ${SCRIPTS_DIR}/add-import-jobs
19 17 07 * * * /usr/bin/python ${SCRIPTS_DIR}/list-packages
20-30 03 * * * /usr/bin/python ${SCRIPTS_DIR}/email-failures
21 21 * * * * /usr/bin/python ${SCRIPTS_DIR}/graph-failures
22
23=== removed file 'udd/scripts/email_failures.py'
24--- udd/scripts/email_failures.py 2011-12-08 18:01:01 +0000
25+++ udd/scripts/email_failures.py 1970-01-01 00:00:00 +0000
26@@ -1,55 +0,0 @@
27-import sys
28-
29-from udd import (
30- icommon,
31- iconfig,
32- )
33-
34-
35-# Not ideal to declare this here but this is used by several local functions
36-# below. Refactoring the whole script may help -- vila 2011-12-07
37-conf = None # Will be set by main()
38-
39-
40-def write_email(failures):
41- text = ""
42- for package, reason, when_failed in failures:
43- if reason == icommon.running_sentinel:
44- continue
45- text += "\n\n%s failed at %s due to:\n%s\n" % (
46- package, when_failed, reason.encode("ascii", "replace"))
47- return text
48-
49-
50-def only_main(failures):
51- db = icommon.PackageDatabase(conf.get('pi.sqlite_package_file'))
52- main_packages = db.list_packages_in_main()
53- filtered = []
54- for failure in failures:
55- package = failure[0]
56- if package in main_packages:
57- filtered.append(failure)
58- return filtered
59-
60-
61-def email_failures():
62- db = icommon.StatusDatabase(conf.get('pi.sqlite_file'))
63- failures = db.unemailed_failures()
64- failures = only_main(failures)
65- if failures:
66- content = write_email(failures)
67- print content
68- db.set_failures_emailed(failures)
69-
70-
71-def main():
72- global conf
73- conf = iconfig.ImporterStack()
74- lock = icommon.lock_path(conf.get('pi.script_locks_dir'), 'email_failures')
75- if lock is None:
76- print "Another instance of email_failures is already running."
77- sys.exit(0)
78- try:
79- email_failures()
80- finally:
81- lock.close()
82
83=== removed file 'udd/tests/test_email_failures.py'
84--- udd/tests/test_email_failures.py 2011-12-08 18:01:01 +0000
85+++ udd/tests/test_email_failures.py 1970-01-01 00:00:00 +0000
86@@ -1,11 +0,0 @@
87-from udd import tests
88-
89-from udd.scripts import email_failures
90-
91-
92-class TestEmailFailures(tests.TestCaseWithConfig):
93-
94- def test_empty(self):
95- email_failures.main()
96- # A lock has been created under the test hierarchy
97- self.assertTestPathExists('locks/scripts/email_failures')

Subscribers

People subscribed via source and target branches