Merge lp:~stevenk/launchpad/reject-mail-ppa-name into lp:launchpad

Proposed by Steve Kowalik on 2010-10-22
Status: Merged
Approved by: Robert Collins on 2010-10-22
Approved revision: no longer in the source branch.
Merged at revision: 11778
Proposed branch: lp:~stevenk/launchpad/reject-mail-ppa-name
Merge into: lp:launchpad
Diff against target: 42 lines (+9/-4)
2 files modified
lib/lp/archiveuploader/tests/test_ppauploadprocessor.py (+2/-2)
lib/lp/soyuz/model/queue.py (+7/-2)
To merge this branch: bzr merge lp:~stevenk/launchpad/reject-mail-ppa-name
Reviewer Review Type Date Requested Status
Robert Collins (community) 2010-10-22 Approve on 2010-10-22
Review via email: mp+39119@code.launchpad.net

Commit Message

Add the PPA name to the Subject of the reject message sent.

Description of the Change

This branch changes the Subject for rejected uploads to PPAs to better tell the user which PPA rejected their upload. The information is currently presented to users, in the form of a X-Launchpad-PPA header, this leaves that intact for mail filters and the like, and adds the information to the subject.

To test: bin/test -vvt test_ppauploadprocessor

To post a comment you must log in.
Robert Collins (lifeless) wrote :

I have three thoughts here.

Firstly, accepted mails also do this formatting right? how about combining that code for easier maintenance.

Secondly, having the formatter as a helper e.g.
subject = self.upload_reply(status='rejected')

would allow it to be tested in isolation, for more permutations, corner cases etc.

Lastly [PPA cprov] is a bit ugly, perhaps use the full dput syntax:
[ppa:cproc/ppa]

-Rob

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/archiveuploader/tests/test_ppauploadprocessor.py'
2--- lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2010-10-07 16:51:23 +0000
3+++ lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2010-10-22 04:18:46 +0000
4@@ -886,7 +886,7 @@
5 rejection_message.splitlines())
6
7 contents = [
8- "Subject: bar_1.0-1_source.changes rejected",
9+ "Subject: [PPA cprov] bar_1.0-1_source.changes rejected",
10 "Could not find person or team named 'boing'",
11 "https://help.launchpad.net/Packaging/PPA#Uploading",
12 "If you don't understand why your files were rejected please "
13@@ -1253,7 +1253,7 @@
14 # An email communicating the rejection and the reason why it was
15 # rejected is sent to the uploaders.
16 contents = [
17- "Subject: bar_1.0-1_source.changes rejected",
18+ "Subject: [PPA name16] bar_1.0-1_source.changes rejected",
19 "Rejected:",
20 "PPA exceeded its size limit (2048.00 of 2048.00 MiB). "
21 "Ask a question in https://answers.launchpad.net/soyuz/ "
22
23=== modified file 'lib/lp/soyuz/model/queue.py'
24--- lib/lp/soyuz/model/queue.py 2010-10-06 11:46:51 +0000
25+++ lib/lp/soyuz/model/queue.py 2010-10-22 04:18:46 +0000
26@@ -883,9 +883,14 @@
27
28 body = message.template % message.__dict__
29
30+ subject = "%s rejected" % self.changesfile.filename
31+ if self.isPPA():
32+ subject = "[PPA %s] %s" % (
33+ get_ppa_reference(self.archive), subject)
34+
35 self._sendMail(
36- recipients, "%s rejected" % self.changesfile.filename,
37- body, dry_run, changesfile_content=changesfile_content,
38+ recipients, subject, body, dry_run,
39+ changesfile_content=changesfile_content,
40 attach_changes=attach_changes)
41
42 def _sendSuccessNotification(