← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Ian Booth has proposed merging lp:~wallyworld/launchpad/delete-bugtask-show-in-comments-889195 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #889195 in Launchpad itself: "Deletion of a bugtask is not shown in comments"
  https://bugs.launchpad.net/launchpad/+bug/889195

For more details, see:
https://code.launchpad.net/~wallyworld/launchpad/delete-bugtask-show-in-comments-889195/+merge/82489

== 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

-- 
https://code.launchpad.net/~wallyworld/launchpad/delete-bugtask-show-in-comments-889195/+merge/82489
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wallyworld/launchpad/delete-bugtask-show-in-comments-889195 into lp:launchpad.
=== modified file 'lib/lp/bugs/browser/bugtask.py'
--- lib/lp/bugs/browser/bugtask.py	2011-11-14 17:57:46 +0000
+++ lib/lp/bugs/browser/bugtask.py	2011-11-17 04:38:25 +0000
@@ -776,9 +776,11 @@
             'summary|tags|visibility')
         bugtask_change_re = (
             '[a-z0-9][a-z0-9\+\.\-]+( \([A-Za-z0-9\s]+\))?: '
-            '(assignee|importance|milestone|status)')
+            '(assignee|importance|milestone|status|deleted)')
+        bugtask_deleted_re = 'bug task deleted'
         interesting_match = re.compile(
-            "^(%s|%s)$" % (bug_change_re, bugtask_change_re)).match
+            "^(%s|%s|%s)$"
+            % (bug_change_re, bugtask_change_re, bugtask_deleted_re)).match
         interesting_activity = tuple(
             BugActivityItem(activity)
             for activity in activity
@@ -4351,6 +4353,9 @@
                 else:
                     return_dict[key] = cgi.escape(return_dict[key])
 
+        elif attribute == 'bug task deleted':
+            return 'No longer affects %s' % self.oldvalue
+
         else:
             # Our default state is to just return oldvalue and newvalue.
             # Since we don't necessarily know what they are, we escape

=== modified file 'lib/lp/bugs/stories/bugs/xx-bug-activity.txt'
--- lib/lp/bugs/stories/bugs/xx-bug-activity.txt	2011-10-20 00:53:01 +0000
+++ lib/lp/bugs/stories/bugs/xx-bug-activity.txt	2011-11-17 04:38:25 +0000
@@ -297,3 +297,18 @@
     affects:
     mozilla-firefox (Ubuntu) => linux-source-2.6.15 (Ubuntu)
     --------
+
+If a bug task is deleted the pillar no longer affected will be shown.
+
+    >>> admin_browser.open("http://bugs.launchpad.dev/firefox/+bug/6";)
+    >>> admin_browser.getLink(url='+distrotask').click()
+    >>> admin_browser.getControl('Distribution').value = ['ubuntu']
+    >>> admin_browser.getControl('Continue').click()
+    >>> admin_browser.open("https://bugs.launchpad.dev/ubuntu/+bug/6/+delete";)
+    >>> admin_browser.getControl('Delete').click()
+    >>> print_comments(admin_browser.contents)
+    Foo Bar (name16)
+    ... ago
+    bug task deleted:
+    No longer affects ubuntu
+    --------