Merge lp:~wallyworld/launchpad/delete-bugtask-show-in-comments-889195 into lp:launchpad

Proposed by Ian Booth
Status: Merged
Approved by: Ian Booth
Approved revision: no longer in the source branch.
Merged at revision: 14340
Proposed branch: lp:~wallyworld/launchpad/delete-bugtask-show-in-comments-889195
Merge into: lp:launchpad
Diff against target: 45 lines (+19/-1)
2 files modified
lib/lp/bugs/browser/bugtask.py (+4/-1)
lib/lp/bugs/stories/bugs/xx-bug-activity.txt (+15/-0)
To merge this branch: bzr merge lp:~wallyworld/launchpad/delete-bugtask-show-in-comments-889195
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+82489@code.launchpad.net

Commit message

[r=wgrant][bug=889195] Include delete bug task activities in the bug comments listing.

Description of the change

== Implementation ==

Simple change to regex used in BugTaskView._getInterestingActivity() to include delete bug task activities in the bug comments listing. Also update BugActivityItem to render the delete bug task activity text.

== Tests ==

Add extra doc test to xx-bug-activity.txt

== Lint ==

Linting changed files:
  lib/lp/bugs/browser/bugtask.py
  lib/lp/bugs/stories/bugs/xx-bug-activity.txt

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) wrote :

We don't use capitals in any of the other text around there, so I'd suggest s/No/no/.

bugtask_deleted_re should probably also be merged into bugtask_change_re, along with 'affects' which it is quite similar to.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/bugs/browser/bugtask.py'
2--- lib/lp/bugs/browser/bugtask.py 2011-11-16 00:09:49 +0000
3+++ lib/lp/bugs/browser/bugtask.py 2011-11-17 05:55:28 +0000
4@@ -776,7 +776,7 @@
5 activity = self.context.bug.activity
6 bug_change_re = (
7 'affects|description|security vulnerability|'
8- 'summary|tags|visibility')
9+ 'summary|tags|visibility|bug task deleted')
10 bugtask_change_re = (
11 '[a-z0-9][a-z0-9\+\.\-]+( \([A-Za-z0-9\s]+\))?: '
12 '(assignee|importance|milestone|status)')
13@@ -4361,6 +4361,9 @@
14 else:
15 return_dict[key] = cgi.escape(return_dict[key])
16
17+ elif attribute == 'bug task deleted':
18+ return 'no longer affects %s' % self.oldvalue
19+
20 else:
21 # Our default state is to just return oldvalue and newvalue.
22 # Since we don't necessarily know what they are, we escape
23
24=== modified file 'lib/lp/bugs/stories/bugs/xx-bug-activity.txt'
25--- lib/lp/bugs/stories/bugs/xx-bug-activity.txt 2011-10-20 00:53:01 +0000
26+++ lib/lp/bugs/stories/bugs/xx-bug-activity.txt 2011-11-17 05:55:28 +0000
27@@ -297,3 +297,18 @@
28 affects:
29 mozilla-firefox (Ubuntu) => linux-source-2.6.15 (Ubuntu)
30 --------
31+
32+If a bug task is deleted the pillar no longer affected will be shown.
33+
34+ >>> admin_browser.open("http://bugs.launchpad.dev/firefox/+bug/6")
35+ >>> admin_browser.getLink(url='+distrotask').click()
36+ >>> admin_browser.getControl('Distribution').value = ['ubuntu']
37+ >>> admin_browser.getControl('Continue').click()
38+ >>> admin_browser.open("https://bugs.launchpad.dev/ubuntu/+bug/6/+delete")
39+ >>> admin_browser.getControl('Delete').click()
40+ >>> print_comments(admin_browser.contents)
41+ Foo Bar (name16)
42+ ... ago
43+ bug task deleted:
44+ no longer affects ubuntu
45+ --------