Merge lp:~brian-murray/launchpad/bug-130902 into lp:launchpad

Proposed by Brian Murray
Status: Merged
Approved by: Edwin Grubbs
Approved revision: no longer in the source branch.
Merged at revision: 11047
Proposed branch: lp:~brian-murray/launchpad/bug-130902
Merge into: lp:launchpad
Diff against target: 49 lines (+17/-0)
3 files modified
lib/canonical/launchpad/mailnotification.py (+6/-0)
lib/lp/bugs/doc/bugnotification-email.txt (+1/-0)
lib/lp/bugs/doc/bugnotification-sending.txt (+10/-0)
To merge this branch: bzr merge lp:~brian-murray/launchpad/bug-130902
Reviewer Review Type Date Requested Status
Edwin Grubbs (community) Approve
Review via email: mp+28246@code.launchpad.net

Commit message

Add in a X-Launchpad-Bug-Reporter header to bug mail that identifies the original reporter of a bug report to aid email filtering.

Description of the change

This branch adds in a X-Launchpad-Bug-Reporter header to bug mail that identifies the original reporter of a bug report to aid email filtering.

Tests modified:

bin/test -cvvt bugnotification-email -t bugnotification-sending

To post a comment you must log in.
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/mailnotification.py'
2--- lib/canonical/launchpad/mailnotification.py 2010-06-23 01:15:11 +0000
3+++ lib/canonical/launchpad/mailnotification.py 2010-06-23 18:39:24 +0000
4@@ -116,6 +116,12 @@
5 self.common_headers.append(
6 ('X-Launchpad-Bug-Commenters', ' '.join(sorted(commenters))))
7
8+ # Add the -Bug-Reporter header to identify the owner of the bug
9+ # and the original bug task for filtering
10+ self.common_headers.append(
11+ ('X-Launchpad-Bug-Reporter',
12+ '%s (%s)' % ( bug.owner.displayname, bug.owner.name )))
13+
14 def build(self, from_address, to_address, body, subject, email_date,
15 rationale=None, references=None, message_id=None):
16 """Construct the notification.
17
18=== modified file 'lib/lp/bugs/doc/bugnotification-email.txt'
19--- lib/lp/bugs/doc/bugnotification-email.txt 2010-06-22 17:08:23 +0000
20+++ lib/lp/bugs/doc/bugnotification-email.txt 2010-06-23 18:39:24 +0000
21@@ -505,6 +505,7 @@
22 X-Launchpad-Bug-Private: yes
23 X-Launchpad-Bug-Security-Vulnerability: yes
24 X-Launchpad-Bug-Commenters: name12
25+ X-Launchpad-Bug-Reporter: Sample Person (name12)
26
27 The build() method of a builder accepts a number of parameters and
28 returns an instance of email.MIMEText. The most basic invocation of
29
30=== modified file 'lib/lp/bugs/doc/bugnotification-sending.txt'
31--- lib/lp/bugs/doc/bugnotification-sending.txt 2010-06-22 17:08:23 +0000
32+++ lib/lp/bugs/doc/bugnotification-sending.txt 2010-06-23 18:39:24 +0000
33@@ -1187,6 +1187,16 @@
34 name12 name16
35
36
37+== The X-Launchpad-Bug-Reporter header ==
38+
39+The X-Launchpad-Bug-Reporter header contains information about the Launchpad
40+user who originally reported the bug and opened the bug's first bug task.
41+
42+ >>> for message in trigger_and_get_email_messages(bug_three):
43+ ... print message.get('X-Launchpad-Bug-Reporter')
44+ Foo Bar (name16)
45+
46+
47 == Verbose bug notifications ==
48
49 It is possible for users to have all the bug notifications which they