← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/codeimport-mail-unique-name into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/codeimport-mail-unique-name into lp:launchpad with lp:~cjwatson/launchpad/remove-branchtarget-newcodeimport as a prerequisite.

Commit message:
Use branch unique names in code import mails rather than <target_name>/<branch_name>.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/codeimport-mail-unique-name/+merge/307423

Use branch unique names in code import mails rather than <target_name>/<branch_name>.  This is a bit more consistent with almost everything else, it's more informative in the not-uncommon case where somebody requests a spurious import, and it saves a bit of effort when adding support for git-targeting imports.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/codeimport-mail-unique-name into lp:launchpad.
=== modified file 'lib/lp/code/doc/codeimport.txt'
--- lib/lp/code/doc/codeimport.txt	2016-10-03 11:27:34 +0000
+++ lib/lp/code/doc/codeimport.txt	2016-10-03 11:27:38 +0000
@@ -96,7 +96,7 @@
     >>> import email
     >>> message = email.message_from_string(stub.test_emails[0][2])
     >>> print message['subject']
-    New code import: widget/trunk-cvs
+    New code import: ~import-person/widget/trunk-cvs
     >>> print message['X-Launchpad-Message-Rationale']
     Operator @vcs-imports
     >>> print message['X-Launchpad-Message-For']
@@ -223,7 +223,7 @@
     >>> print_emails(group_similar=True)
     From: Code Import Person <import@xxxxxxxxxxx>
     To: david.allouche@xxxxxxxxxxxxx, ...
-    Subject: Code import product.../name... status: Reviewed
+    Subject: Code import ~person-name-.../product.../name... status: Reviewed
     <BLANKLINE>
     ... is now being imported from:
         http://svn.example.com/project/trunk
@@ -239,7 +239,7 @@
     ----------------------------------------
     From: Code Import Person <import@xxxxxxxxxxx>
     To: import@xxxxxxxxxxx
-    Subject: Code import product.../name... status: Reviewed
+    Subject: Code import ~person-name-.../product.../name... status: Reviewed
     <BLANKLINE>
     ... is now being imported from:
         http://svn.example.com/project/trunk
@@ -270,11 +270,11 @@
     >>> print_emails(group_similar=True)
     From: noreply@xxxxxxxxxxxxx
     To: david.allouche@xxxxxxxxxxxxx, ...
-    Subject: Code import product.../name... status: Reviewed
+    Subject: Code import ~person-name-.../product.../name... status: Reviewed
     ...
     From: noreply@xxxxxxxxxxxxx
     To: import@xxxxxxxxxxx
-    Subject: Code import product.../name... status: Reviewed
+    Subject: Code import ~person-name-.../product.../name... status: Reviewed
     ...
 
 

=== modified file 'lib/lp/code/mail/codeimport.py'
--- lib/lp/code/mail/codeimport.py	2015-09-11 12:20:23 +0000
+++ lib/lp/code/mail/codeimport.py	2016-10-03 11:27:38 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2015 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2016 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Email notifications related to code imports."""
@@ -39,8 +39,7 @@
         # test.
         return
     user = IPerson(event.user)
-    subject = 'New code import: %s/%s' % (
-        code_import.branch.target.name, code_import.branch.name)
+    subject = 'New code import: %s' % code_import.branch.unique_name
     if code_import.rcs_type == RevisionControlSystems.CVS:
         location = '%s, %s' % (code_import.cvs_root, code_import.cvs_module)
     else:
@@ -154,9 +153,8 @@
 
     headers = {'X-Launchpad-Branch': branch.unique_name}
 
-    subject = 'Code import %s/%s status: %s' % (
-        code_import.branch.target.name, branch.name,
-        code_import.review_status.title)
+    subject = 'Code import %s status: %s' % (
+        code_import.branch.unique_name, code_import.review_status.title)
 
     email_template = get_email_template(
         'code-import-status-updated.txt', app='code')


Follow ups