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

Proposed by Nigel Babu
Status: Merged
Approved by: Abel Deuring
Approved revision: no longer in the source branch.
Merged at revision: 13908
Proposed branch: lp:~nigelbabu/launchpad/destroy-statusexplanation-88545
Merge into: lp:launchpad
Diff against target: 251 lines (+8/-62)
10 files modified
lib/lp/bugs/browser/bugtask.py (+2/-10)
lib/lp/bugs/configure.zcml (+0/-2)
lib/lp/bugs/doc/bugtask-expiration.txt (+0/-7)
lib/lp/bugs/interfaces/bugtask.py (+0/-5)
lib/lp/bugs/model/bugtask.py (+1/-4)
lib/lp/bugs/scripts/bugexpire.py (+1/-2)
lib/lp/bugs/templates/bugtask-view.pt (+0/-10)
lib/lp/coop/answersbugs/emailtemplates/question-linked-bug-status-updated.txt (+0/-1)
lib/lp/coop/answersbugs/notification.py (+3/-15)
lib/lp/coop/answersbugs/tests/notifications-linked-bug.txt (+1/-6)
To merge this branch: bzr merge lp:~nigelbabu/launchpad/destroy-statusexplanation-88545
Reviewer Review Type Date Requested Status
Abel Deuring (community) code Approve
Review via email: mp+74704@code.launchpad.net

Commit message

[r=adeuring][bug=88545][incr] Nuke statusexplanation

Description of the change

= 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

To post a comment you must log in.
Revision history for this message
Abel Deuring (adeuring) wrote :

thanks for picking this up, Nigel, r=me.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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-09 15:13:01 +0000
@@ -1214,7 +1214,7 @@
1214 # depending on the current context and the permissions of the user viewing1214 # depending on the current context and the permissions of the user viewing
1215 # the form.1215 # the form.
1216 default_field_names = ['assignee', 'bugwatch', 'importance', 'milestone',1216 default_field_names = ['assignee', 'bugwatch', 'importance', 'milestone',
1217 'status', 'statusexplanation']1217 'status']
1218 custom_widget('target', LaunchpadTargetWidget)1218 custom_widget('target', LaunchpadTargetWidget)
1219 custom_widget('sourcepackagename', BugTaskSourcePackageNameWidget)1219 custom_widget('sourcepackagename', BugTaskSourcePackageNameWidget)
1220 custom_widget('bugwatch', BugTaskBugWatchWidget)1220 custom_widget('bugwatch', BugTaskBugWatchWidget)
@@ -1646,14 +1646,6 @@
1646 bugtask.transitionToAssignee(None)1646 bugtask.transitionToAssignee(None)
16471647
1648 if changed:1648 if changed:
1649 # We only set the statusexplanation field to the value of the
1650 # change comment if the BugTask has actually been changed in some
1651 # way. Otherwise, we just leave it as a comment on the bug.
1652 if comment_on_change:
1653 bugtask.statusexplanation = comment_on_change
1654 else:
1655 bugtask.statusexplanation = ""
1656
1657 notify(1649 notify(
1658 ObjectModifiedEvent(1650 ObjectModifiedEvent(
1659 object=bugtask,1651 object=bugtask,
@@ -1703,7 +1695,7 @@
1703 task or not.1695 task or not.
1704 """1696 """
1705 field_names = [1697 field_names = [
1706 'status', 'importance', 'assignee', 'statusexplanation']1698 'status', 'importance', 'assignee']
1707 if not self.context.target_uses_malone:1699 if not self.context.target_uses_malone:
1708 field_names += ['bugwatch']1700 field_names += ['bugwatch']
1709 self.milestone_widget = None1701 self.milestone_widget = None
17101702
=== 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-09 15:13:01 +0000
@@ -223,7 +223,6 @@
223 distroseries223 distroseries
224 milestone224 milestone
225 status225 status
226 statusexplanation
227 importance226 importance
228 assignee227 assignee
229 bugwatch228 bugwatch
@@ -277,7 +276,6 @@
277 setStatusFromDebbugs276 setStatusFromDebbugs
278 statusdisplayhtml277 statusdisplayhtml
279 statuselsewhere278 statuselsewhere
280 statusexplanation
281 targetname279 targetname
282 title280 title
283 "/>281 "/>
284282
=== 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-09 15:13:01 +0000
@@ -511,13 +511,6 @@
511 recent False 31 Incomplete False False False False511 recent False 31 Incomplete False False False False
512 no_expire False 61 Incomplete False False False False512 no_expire False 61 Incomplete False False False False
513513
514The bugtasks statusexplanation was updated to explain the change in
515status.
516
517 >>> hoary_bugtask = BugTask.get(hoary_bugtask.id)
518 >>> print hoary_bugtask.statusexplanation
519 [Expired for Ubuntu Hoary because there has been no activity for 60 days.]
520
521The message explaining the reason for the expiration was posted by the514The message explaining the reason for the expiration was posted by the
522Launchpad Janitor celebrity. Only one message was created for when the515Launchpad Janitor celebrity. Only one message was created for when the
523master and slave bugtasks were expired.516master and slave bugtasks were expired.
524517
=== 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-09 15:13:01 +0000
@@ -487,8 +487,6 @@
487 importance = exported(487 importance = exported(
488 Choice(title=_('Importance'), vocabulary=BugTaskImportance,488 Choice(title=_('Importance'), vocabulary=BugTaskImportance,
489 default=BugTaskImportance.UNDECIDED, readonly=True))489 default=BugTaskImportance.UNDECIDED, readonly=True))
490 statusexplanation = Text(
491 title=_("Status notes (optional)"), required=False)
492 assignee = exported(490 assignee = exported(
493 PersonChoice(491 PersonChoice(
494 title=_('Assigned to'), required=False,492 title=_('Assigned to'), required=False,
@@ -920,8 +918,6 @@
920 omit_targeted = Bool(918 omit_targeted = Bool(
921 title=_('Omit bugs targeted to a series'), required=False,919 title=_('Omit bugs targeted to a series'), required=False,
922 default=True)920 default=True)
923 statusexplanation = TextLine(
924 title=_("Status notes"), required=False)
925 has_patch = Bool(921 has_patch = Bool(
926 title=_('Show only bugs with patches available.'), required=False,922 title=_('Show only bugs with patches available.'), required=False,
927 default=False)923 default=False)
@@ -1071,7 +1067,6 @@
1071 The value is a dict like {'old' : IPerson, 'new' : IPerson}, or None,1067 The value is a dict like {'old' : IPerson, 'new' : IPerson}, or None,
1072 if no change was made to the assignee.1068 if no change was made to the assignee.
1073 """)1069 """)
1074 statusexplanation = Attribute("The new value of the status notes.")
1075 bugwatch = Attribute("The bugwatch which governs this task.")1070 bugwatch = Attribute("The bugwatch which governs this task.")
1076 milestone = Attribute("The milestone for which this task is scheduled.")1071 milestone = Attribute("The milestone for which this task is scheduled.")
10771072
10781073
=== 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-09 15:13:01 +0000
@@ -312,8 +312,7 @@
312 implements(IBugTaskDelta)312 implements(IBugTaskDelta)
313313
314 def __init__(self, bugtask, status=None, importance=None,314 def __init__(self, bugtask, status=None, importance=None,
315 assignee=None, milestone=None, statusexplanation=None,315 assignee=None, milestone=None, bugwatch=None, target=None):
316 bugwatch=None, target=None):
317 self.bugtask = bugtask316 self.bugtask = bugtask
318317
319 self.assignee = assignee318 self.assignee = assignee
@@ -321,7 +320,6 @@
321 self.importance = importance320 self.importance = importance
322 self.milestone = milestone321 self.milestone = milestone
323 self.status = status322 self.status = status
324 self.statusexplanation = statusexplanation
325 self.target = target323 self.target = target
326324
327325
@@ -482,7 +480,6 @@
482 schema=BugTaskStatus,480 schema=BugTaskStatus,
483 default=BugTaskStatus.NEW,481 default=BugTaskStatus.NEW,
484 storm_validator=validate_status)482 storm_validator=validate_status)
485 statusexplanation = StringCol(dbName='statusexplanation', default=None)
486 importance = EnumCol(483 importance = EnumCol(
487 dbName='importance', notNull=True,484 dbName='importance', notNull=True,
488 schema=BugTaskImportance,485 schema=BugTaskImportance,
489486
=== 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-09 15:13:01 +0000
@@ -97,10 +97,9 @@
97 owner=self.janitor,97 owner=self.janitor,
98 subject=bugtask.bug.followup_subject(),98 subject=bugtask.bug.followup_subject(),
99 content=content)99 content=content)
100 bugtask.statusexplanation = content
101 notify(ObjectModifiedEvent(100 notify(ObjectModifiedEvent(
102 bugtask, bugtask_before_modification,101 bugtask, bugtask_before_modification,
103 ['status', 'statusexplanation'], user=self.janitor))102 ['status'], user=self.janitor))
104 # XXX sinzui 2007-08-02 bug=29744:103 # XXX sinzui 2007-08-02 bug=29744:
105 # We commit after each expiration because emails are sent104 # We commit after each expiration because emails are sent
106 # immediately in zopeless. This minimize the risk of105 # immediately in zopeless. This minimize the risk of
107106
=== 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-09 15:13:01 +0000
@@ -119,16 +119,6 @@
119 </table>119 </table>
120 </div>120 </div>
121121
122 <div class="field" tal:condition="context/statusexplanation">
123 <div>
124 <label tal:attributes="for view/statusexplanation_widget/name"
125 tal:content="view/statusexplanation_widget/label" />
126 </div>
127 <div>
128 <tal:block replace="structure view/statusexplanation_widget" />
129 </div>
130 </div>
131
132 <tal:user condition="view/user">122 <tal:user condition="view/user">
133 <tal:description123 <tal:description
134 define="global description context/bug/description/fmt:text-to-html" />124 define="global description context/bug/description/fmt:text-to-html" />
135125
=== 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-09 15:13:01 +0000
@@ -2,7 +2,6 @@
22
3 %(old_status)s => %(new_status)s3 %(old_status)s => %(new_status)s
44
5%(statusexplanation)s
6%(bugtask_url)s5%(bugtask_url)s
7"%(bugtask_title)s"6"%(bugtask_title)s"
87
98
=== 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-09 15:13:01 +0000
@@ -13,7 +13,6 @@
13from canonical.launchpad.webapp.publisher import canonical_url13from canonical.launchpad.webapp.publisher import canonical_url
14from lp.answers.notification import QuestionNotification14from lp.answers.notification import QuestionNotification
15from lp.bugs.interfaces.bugtask import IBugTask15from lp.bugs.interfaces.bugtask import IBugTask
16from lp.services.mail.mailwrapper import MailWrapper
1716
1817
19def get_email_template(filename):18def get_email_template(filename):
@@ -59,25 +58,14 @@
5958
60 def getBody(self):59 def getBody(self):
61 """See QuestionNotification."""60 """See QuestionNotification."""
62 if self.bugtask.statusexplanation:
63 wrapper = MailWrapper()
64 statusexplanation = (
65 'Status change explanation given by %s:\n\n%s\n' % (
66 self.user.displayname,
67 wrapper.format(self.bugtask.statusexplanation)))
68 else:
69 statusexplanation = ''
70
71 return get_email_template(61 return get_email_template(
72 'question-linked-bug-status-updated.txt') % {62 'question-linked-bug-status-updated.txt') % {
73 'bugtask_target_name': self.bugtask.target.displayname,63 'bugtask_target_name': self.bugtask.target.displayname,
74 'question_id': self.question.id,64 'question_id': self.question.id,
75 'question_title':self.question.title,65 'question_title': self.question.title,
76 'question_url': canonical_url(self.question),66 'question_url': canonical_url(self.question),
77 'bugtask_url':canonical_url(self.bugtask),67 'bugtask_url': canonical_url(self.bugtask),
78 'bug_id': self.bugtask.bug.id,68 'bug_id': self.bugtask.bug.id,
79 'bugtask_title': self.bugtask.bug.title,69 'bugtask_title': self.bugtask.bug.title,
80 'old_status': self.old_bugtask.status.title,70 'old_status': self.old_bugtask.status.title,
81 'new_status': self.bugtask.status.title,71 'new_status': self.bugtask.status.title}
82 'statusexplanation': statusexplanation}
83
8472
=== 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-09 15:13:01 +0000
@@ -17,10 +17,9 @@
17 >>> bugtask = get_bugtask_linked_to_question()17 >>> bugtask = get_bugtask_linked_to_question()
18 >>> original_bugtask = Snapshot(bugtask, providing=providedBy(bugtask))18 >>> original_bugtask = Snapshot(bugtask, providing=providedBy(bugtask))
19 >>> bugtask.transitionToStatus(BugTaskStatus.CONFIRMED, no_priv)19 >>> bugtask.transitionToStatus(BugTaskStatus.CONFIRMED, no_priv)
20 >>> bugtask.statusexplanation = 'This bug really happened to me.'
21 >>> ignore = pop_questionemailjobs()20 >>> ignore = pop_questionemailjobs()
22 >>> notify(ObjectModifiedEvent(21 >>> notify(ObjectModifiedEvent(
23 ... bugtask, original_bugtask, ['status', 'statusexplanation'],22 ... bugtask, original_bugtask, ['status'],
24 ... user=no_priv))23 ... user=no_priv))
2524
26 >>> notifications = pop_questionemailjobs()25 >>> notifications = pop_questionemailjobs()
@@ -38,10 +37,6 @@
38 <BLANKLINE>37 <BLANKLINE>
39 New => Confirmed38 New => Confirmed
40 <BLANKLINE>39 <BLANKLINE>
41 Status change explanation given by No Privileges Person:
42 <BLANKLINE>
43 This bug really happened to me.
44 <BLANKLINE>
45 http://.../ubuntu/+bug/...40 http://.../ubuntu/+bug/...
46 "Installer fails on a Mac PPC"41 "Installer fails on a Mac PPC"
47 <BLANKLINE>42 <BLANKLINE>