← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~nigelbabu/launchpad/destroy-statusexplanation-88545 into lp:launchpad

 

Nigel Babu has proposed merging lp:~nigelbabu/launchpad/destroy-statusexplanation-88545 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #88545 in Launchpad itself: "Abolish the "statusexplanation" database field"
  https://bugs.launchpad.net/launchpad/+bug/88545

For more details, see:
https://code.launchpad.net/~nigelbabu/launchpad/destroy-statusexplanation-88545/+merge/74704

= Description = 
The term "status explanation" is now hidden, except in the activity log, where it causes confusion. Since it doesn't and will never serve any useful purpose, the database field should be destroyed.  I've removed almost all references to it in tests as well as code.

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/bugs/configure.zcml
  lib/lp/bugs/browser/bugtask.py
  lib/lp/bugs/doc/bugtask-expiration.txt
  lib/lp/bugs/interfaces/bugtask.py
  lib/lp/bugs/model/bugtask.py
  lib/lp/bugs/scripts/bugexpire.py
  lib/lp/bugs/stories/bugs/xx-bug-activity.txt
  lib/lp/bugs/templates/bugtask-view.pt
  lib/lp/coop/answersbugs/notification.py
  lib/lp/coop/answersbugs/emailtemplates/question-linked-bug-status-updated.txt
  lib/lp/coop/answersbugs/tests/notifications-linked-bug.txt

./lib/lp/bugs/doc/bugtask-expiration.txt
       1: narrative uses a moin header.
      24: narrative uses a moin header.
      54: narrative uses a moin header.
     232: narrative uses a moin header.
     248: want exceeds 78 characters.
     258: narrative uses a moin header.
     367: narrative uses a moin header.
     433: narrative uses a moin header.
     447: narrative uses a moin header.
     491: narrative uses a moin header.
     538: narrative uses a moin header.
make: *** [lint] Error 11
-- 
https://code.launchpad.net/~nigelbabu/launchpad/destroy-statusexplanation-88545/+merge/74704
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~nigelbabu/launchpad/destroy-statusexplanation-88545 into lp:launchpad.
=== modified file 'lib/lp/bugs/browser/bugtask.py'
--- lib/lp/bugs/browser/bugtask.py	2011-09-07 16:04:04 +0000
+++ lib/lp/bugs/browser/bugtask.py	2011-09-08 23:07:27 +0000
@@ -1214,7 +1214,7 @@
     # depending on the current context and the permissions of the user viewing
     # the form.
     default_field_names = ['assignee', 'bugwatch', 'importance', 'milestone',
-                           'status', 'statusexplanation']
+                           'status']
     custom_widget('target', LaunchpadTargetWidget)
     custom_widget('sourcepackagename', BugTaskSourcePackageNameWidget)
     custom_widget('bugwatch', BugTaskBugWatchWidget)
@@ -1646,14 +1646,6 @@
                 bugtask.transitionToAssignee(None)
 
         if changed:
-            # We only set the statusexplanation field to the value of the
-            # change comment if the BugTask has actually been changed in some
-            # way. Otherwise, we just leave it as a comment on the bug.
-            if comment_on_change:
-                bugtask.statusexplanation = comment_on_change
-            else:
-                bugtask.statusexplanation = ""
-
             notify(
                 ObjectModifiedEvent(
                     object=bugtask,
@@ -1703,7 +1695,7 @@
         task or not.
         """
         field_names = [
-            'status', 'importance', 'assignee', 'statusexplanation']
+            'status', 'importance', 'assignee']
         if not self.context.target_uses_malone:
             field_names += ['bugwatch']
             self.milestone_widget = None

=== modified file 'lib/lp/bugs/configure.zcml'
--- lib/lp/bugs/configure.zcml	2011-08-22 01:24:57 +0000
+++ lib/lp/bugs/configure.zcml	2011-09-08 23:07:27 +0000
@@ -223,7 +223,6 @@
                     distroseries
                     milestone
                     status
-                    statusexplanation
                     importance
                     assignee
                     bugwatch
@@ -277,7 +276,6 @@
                     setStatusFromDebbugs
                     statusdisplayhtml
                     statuselsewhere
-                    statusexplanation
                     targetname
                     title
                     "/>

=== modified file 'lib/lp/bugs/doc/bugtask-expiration.txt'
--- lib/lp/bugs/doc/bugtask-expiration.txt	2011-08-01 05:25:59 +0000
+++ lib/lp/bugs/doc/bugtask-expiration.txt	2011-09-08 23:07:27 +0000
@@ -511,13 +511,6 @@
     recent           False    31  Incomplete  False     False  False  False
     no_expire        False    61  Incomplete  False     False  False  False
 
-The bugtasks statusexplanation was updated to explain the change in
-status.
-
-    >>> hoary_bugtask = BugTask.get(hoary_bugtask.id)
-    >>> print hoary_bugtask.statusexplanation
-    [Expired for Ubuntu Hoary because there has been no activity for 60 days.]
-
 The message explaining the reason for the expiration was posted by the
 Launchpad Janitor celebrity. Only one message was created for when the
 master and slave bugtasks were expired.

=== modified file 'lib/lp/bugs/interfaces/bugtask.py'
--- lib/lp/bugs/interfaces/bugtask.py	2011-08-24 05:26:45 +0000
+++ lib/lp/bugs/interfaces/bugtask.py	2011-09-08 23:07:27 +0000
@@ -487,8 +487,6 @@
     importance = exported(
         Choice(title=_('Importance'), vocabulary=BugTaskImportance,
                default=BugTaskImportance.UNDECIDED, readonly=True))
-    statusexplanation = Text(
-        title=_("Status notes (optional)"), required=False)
     assignee = exported(
         PersonChoice(
             title=_('Assigned to'), required=False,
@@ -920,8 +918,6 @@
     omit_targeted = Bool(
         title=_('Omit bugs targeted to a series'), required=False,
         default=True)
-    statusexplanation = TextLine(
-        title=_("Status notes"), required=False)
     has_patch = Bool(
         title=_('Show only bugs with patches available.'), required=False,
         default=False)
@@ -1071,7 +1067,6 @@
         The value is a dict like {'old' : IPerson, 'new' : IPerson}, or None,
         if no change was made to the assignee.
         """)
-    statusexplanation = Attribute("The new value of the status notes.")
     bugwatch = Attribute("The bugwatch which governs this task.")
     milestone = Attribute("The milestone for which this task is scheduled.")
 

=== modified file 'lib/lp/bugs/model/bugtask.py'
--- lib/lp/bugs/model/bugtask.py	2011-09-07 15:40:13 +0000
+++ lib/lp/bugs/model/bugtask.py	2011-09-08 23:07:27 +0000
@@ -312,8 +312,7 @@
     implements(IBugTaskDelta)
 
     def __init__(self, bugtask, status=None, importance=None,
-                 assignee=None, milestone=None, statusexplanation=None,
-                 bugwatch=None, target=None):
+                 assignee=None, milestone=None, bugwatch=None, target=None):
         self.bugtask = bugtask
 
         self.assignee = assignee
@@ -321,7 +320,6 @@
         self.importance = importance
         self.milestone = milestone
         self.status = status
-        self.statusexplanation = statusexplanation
         self.target = target
 
 
@@ -482,7 +480,6 @@
         schema=BugTaskStatus,
         default=BugTaskStatus.NEW,
         storm_validator=validate_status)
-    statusexplanation = StringCol(dbName='statusexplanation', default=None)
     importance = EnumCol(
         dbName='importance', notNull=True,
         schema=BugTaskImportance,

=== modified file 'lib/lp/bugs/scripts/bugexpire.py'
--- lib/lp/bugs/scripts/bugexpire.py	2011-05-27 21:12:25 +0000
+++ lib/lp/bugs/scripts/bugexpire.py	2011-09-08 23:07:27 +0000
@@ -97,10 +97,9 @@
                     owner=self.janitor,
                     subject=bugtask.bug.followup_subject(),
                     content=content)
-                bugtask.statusexplanation = content
                 notify(ObjectModifiedEvent(
                     bugtask, bugtask_before_modification,
-                    ['status', 'statusexplanation'], user=self.janitor))
+                    ['status'], user=self.janitor))
                 # XXX sinzui 2007-08-02 bug=29744:
                 # We commit after each expiration because emails are sent
                 # immediately in zopeless. This minimize the risk of

=== modified file 'lib/lp/bugs/templates/bugtask-view.pt'
--- lib/lp/bugs/templates/bugtask-view.pt	2009-12-19 19:54:41 +0000
+++ lib/lp/bugs/templates/bugtask-view.pt	2011-09-08 23:07:27 +0000
@@ -119,16 +119,6 @@
             </table>
           </div>
 
-          <div class="field" tal:condition="context/statusexplanation">
-            <div>
-              <label tal:attributes="for view/statusexplanation_widget/name"
-                     tal:content="view/statusexplanation_widget/label" />
-            </div>
-            <div>
-              <tal:block replace="structure view/statusexplanation_widget" />
-            </div>
-          </div>
-
           <tal:user condition="view/user">
             <tal:description
               define="global description context/bug/description/fmt:text-to-html" />

=== modified file 'lib/lp/coop/answersbugs/emailtemplates/question-linked-bug-status-updated.txt'
--- lib/lp/coop/answersbugs/emailtemplates/question-linked-bug-status-updated.txt	2009-03-24 12:43:49 +0000
+++ lib/lp/coop/answersbugs/emailtemplates/question-linked-bug-status-updated.txt	2011-09-08 23:07:27 +0000
@@ -2,7 +2,6 @@
 
     %(old_status)s => %(new_status)s
 
-%(statusexplanation)s
 %(bugtask_url)s
 "%(bugtask_title)s"
 

=== modified file 'lib/lp/coop/answersbugs/notification.py'
--- lib/lp/coop/answersbugs/notification.py	2010-08-20 20:31:18 +0000
+++ lib/lp/coop/answersbugs/notification.py	2011-09-08 23:07:27 +0000
@@ -13,7 +13,6 @@
 from canonical.launchpad.webapp.publisher import canonical_url
 from lp.answers.notification import QuestionNotification
 from lp.bugs.interfaces.bugtask import IBugTask
-from lp.services.mail.mailwrapper import MailWrapper
 
 
 def get_email_template(filename):
@@ -59,25 +58,14 @@
 
     def getBody(self):
         """See QuestionNotification."""
-        if self.bugtask.statusexplanation:
-            wrapper = MailWrapper()
-            statusexplanation = (
-                'Status change explanation given by %s:\n\n%s\n' % (
-                    self.user.displayname,
-                    wrapper.format(self.bugtask.statusexplanation)))
-        else:
-            statusexplanation = ''
-
         return get_email_template(
             'question-linked-bug-status-updated.txt') % {
                 'bugtask_target_name': self.bugtask.target.displayname,
                 'question_id': self.question.id,
-                'question_title':self.question.title,
+                'question_title': self.question.title,
                 'question_url': canonical_url(self.question),
-                'bugtask_url':canonical_url(self.bugtask),
+                'bugtask_url': canonical_url(self.bugtask),
                 'bug_id': self.bugtask.bug.id,
                 'bugtask_title': self.bugtask.bug.title,
                 'old_status': self.old_bugtask.status.title,
-                'new_status': self.bugtask.status.title,
-                'statusexplanation': statusexplanation}
-
+                'new_status': self.bugtask.status.title}

=== modified file 'lib/lp/coop/answersbugs/tests/notifications-linked-bug.txt'
--- lib/lp/coop/answersbugs/tests/notifications-linked-bug.txt	2011-04-30 01:34:57 +0000
+++ lib/lp/coop/answersbugs/tests/notifications-linked-bug.txt	2011-09-08 23:07:27 +0000
@@ -17,10 +17,9 @@
     >>> bugtask = get_bugtask_linked_to_question()
     >>> original_bugtask = Snapshot(bugtask, providing=providedBy(bugtask))
     >>> bugtask.transitionToStatus(BugTaskStatus.CONFIRMED, no_priv)
-    >>> bugtask.statusexplanation = 'This bug really happened to me.'
     >>> ignore = pop_questionemailjobs()
     >>> notify(ObjectModifiedEvent(
-    ...     bugtask, original_bugtask, ['status', 'statusexplanation'],
+    ...     bugtask, original_bugtask, ['status'],
     ...     user=no_priv))
 
     >>> notifications = pop_questionemailjobs()