← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/reject-mail-ppa-name into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)


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
-- 
https://code.launchpad.net/~stevenk/launchpad/reject-mail-ppa-name/+merge/39119
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/reject-mail-ppa-name into lp:launchpad/devel.
=== modified file 'lib/lp/archiveuploader/tests/test_ppauploadprocessor.py'
--- lib/lp/archiveuploader/tests/test_ppauploadprocessor.py	2010-10-07 16:51:23 +0000
+++ lib/lp/archiveuploader/tests/test_ppauploadprocessor.py	2010-10-22 04:18:46 +0000
@@ -886,7 +886,7 @@
             rejection_message.splitlines())
 
         contents = [
-            "Subject: bar_1.0-1_source.changes rejected",
+            "Subject: [PPA cprov] bar_1.0-1_source.changes rejected",
             "Could not find person or team named 'boing'",
             "https://help.launchpad.net/Packaging/PPA#Uploading";,
             "If you don't understand why your files were rejected please "
@@ -1253,7 +1253,7 @@
         # An email communicating the rejection and the reason why it was
         # rejected is sent to the uploaders.
         contents = [
-            "Subject: bar_1.0-1_source.changes rejected",
+            "Subject: [PPA name16] bar_1.0-1_source.changes rejected",
             "Rejected:",
             "PPA exceeded its size limit (2048.00 of 2048.00 MiB). "
             "Ask a question in https://answers.launchpad.net/soyuz/ "

=== modified file 'lib/lp/soyuz/model/queue.py'
--- lib/lp/soyuz/model/queue.py	2010-10-06 11:46:51 +0000
+++ lib/lp/soyuz/model/queue.py	2010-10-22 04:18:46 +0000
@@ -883,9 +883,14 @@
 
         body = message.template % message.__dict__
 
+        subject = "%s rejected" % self.changesfile.filename
+        if self.isPPA():
+            subject = "[PPA %s] %s" % (
+                get_ppa_reference(self.archive), subject)
+
         self._sendMail(
-            recipients, "%s rejected" % self.changesfile.filename,
-            body, dry_run, changesfile_content=changesfile_content,
+            recipients, subject, body, dry_run,
+            changesfile_content=changesfile_content,
             attach_changes=attach_changes)
 
     def _sendSuccessNotification(