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.
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
1=== modified file 'lib/lp/bugs/browser/bugtask.py'
2--- lib/lp/bugs/browser/bugtask.py 2011-09-07 16:04:04 +0000
3+++ lib/lp/bugs/browser/bugtask.py 2011-09-09 15:13:01 +0000
4@@ -1214,7 +1214,7 @@
5 # depending on the current context and the permissions of the user viewing
6 # the form.
7 default_field_names = ['assignee', 'bugwatch', 'importance', 'milestone',
8- 'status', 'statusexplanation']
9+ 'status']
10 custom_widget('target', LaunchpadTargetWidget)
11 custom_widget('sourcepackagename', BugTaskSourcePackageNameWidget)
12 custom_widget('bugwatch', BugTaskBugWatchWidget)
13@@ -1646,14 +1646,6 @@
14 bugtask.transitionToAssignee(None)
15
16 if changed:
17- # We only set the statusexplanation field to the value of the
18- # change comment if the BugTask has actually been changed in some
19- # way. Otherwise, we just leave it as a comment on the bug.
20- if comment_on_change:
21- bugtask.statusexplanation = comment_on_change
22- else:
23- bugtask.statusexplanation = ""
24-
25 notify(
26 ObjectModifiedEvent(
27 object=bugtask,
28@@ -1703,7 +1695,7 @@
29 task or not.
30 """
31 field_names = [
32- 'status', 'importance', 'assignee', 'statusexplanation']
33+ 'status', 'importance', 'assignee']
34 if not self.context.target_uses_malone:
35 field_names += ['bugwatch']
36 self.milestone_widget = None
37
38=== modified file 'lib/lp/bugs/configure.zcml'
39--- lib/lp/bugs/configure.zcml 2011-08-22 01:24:57 +0000
40+++ lib/lp/bugs/configure.zcml 2011-09-09 15:13:01 +0000
41@@ -223,7 +223,6 @@
42 distroseries
43 milestone
44 status
45- statusexplanation
46 importance
47 assignee
48 bugwatch
49@@ -277,7 +276,6 @@
50 setStatusFromDebbugs
51 statusdisplayhtml
52 statuselsewhere
53- statusexplanation
54 targetname
55 title
56 "/>
57
58=== modified file 'lib/lp/bugs/doc/bugtask-expiration.txt'
59--- lib/lp/bugs/doc/bugtask-expiration.txt 2011-08-01 05:25:59 +0000
60+++ lib/lp/bugs/doc/bugtask-expiration.txt 2011-09-09 15:13:01 +0000
61@@ -511,13 +511,6 @@
62 recent False 31 Incomplete False False False False
63 no_expire False 61 Incomplete False False False False
64
65-The bugtasks statusexplanation was updated to explain the change in
66-status.
67-
68- >>> hoary_bugtask = BugTask.get(hoary_bugtask.id)
69- >>> print hoary_bugtask.statusexplanation
70- [Expired for Ubuntu Hoary because there has been no activity for 60 days.]
71-
72 The message explaining the reason for the expiration was posted by the
73 Launchpad Janitor celebrity. Only one message was created for when the
74 master and slave bugtasks were expired.
75
76=== modified file 'lib/lp/bugs/interfaces/bugtask.py'
77--- lib/lp/bugs/interfaces/bugtask.py 2011-08-24 05:26:45 +0000
78+++ lib/lp/bugs/interfaces/bugtask.py 2011-09-09 15:13:01 +0000
79@@ -487,8 +487,6 @@
80 importance = exported(
81 Choice(title=_('Importance'), vocabulary=BugTaskImportance,
82 default=BugTaskImportance.UNDECIDED, readonly=True))
83- statusexplanation = Text(
84- title=_("Status notes (optional)"), required=False)
85 assignee = exported(
86 PersonChoice(
87 title=_('Assigned to'), required=False,
88@@ -920,8 +918,6 @@
89 omit_targeted = Bool(
90 title=_('Omit bugs targeted to a series'), required=False,
91 default=True)
92- statusexplanation = TextLine(
93- title=_("Status notes"), required=False)
94 has_patch = Bool(
95 title=_('Show only bugs with patches available.'), required=False,
96 default=False)
97@@ -1071,7 +1067,6 @@
98 The value is a dict like {'old' : IPerson, 'new' : IPerson}, or None,
99 if no change was made to the assignee.
100 """)
101- statusexplanation = Attribute("The new value of the status notes.")
102 bugwatch = Attribute("The bugwatch which governs this task.")
103 milestone = Attribute("The milestone for which this task is scheduled.")
104
105
106=== modified file 'lib/lp/bugs/model/bugtask.py'
107--- lib/lp/bugs/model/bugtask.py 2011-09-07 15:40:13 +0000
108+++ lib/lp/bugs/model/bugtask.py 2011-09-09 15:13:01 +0000
109@@ -312,8 +312,7 @@
110 implements(IBugTaskDelta)
111
112 def __init__(self, bugtask, status=None, importance=None,
113- assignee=None, milestone=None, statusexplanation=None,
114- bugwatch=None, target=None):
115+ assignee=None, milestone=None, bugwatch=None, target=None):
116 self.bugtask = bugtask
117
118 self.assignee = assignee
119@@ -321,7 +320,6 @@
120 self.importance = importance
121 self.milestone = milestone
122 self.status = status
123- self.statusexplanation = statusexplanation
124 self.target = target
125
126
127@@ -482,7 +480,6 @@
128 schema=BugTaskStatus,
129 default=BugTaskStatus.NEW,
130 storm_validator=validate_status)
131- statusexplanation = StringCol(dbName='statusexplanation', default=None)
132 importance = EnumCol(
133 dbName='importance', notNull=True,
134 schema=BugTaskImportance,
135
136=== modified file 'lib/lp/bugs/scripts/bugexpire.py'
137--- lib/lp/bugs/scripts/bugexpire.py 2011-05-27 21:12:25 +0000
138+++ lib/lp/bugs/scripts/bugexpire.py 2011-09-09 15:13:01 +0000
139@@ -97,10 +97,9 @@
140 owner=self.janitor,
141 subject=bugtask.bug.followup_subject(),
142 content=content)
143- bugtask.statusexplanation = content
144 notify(ObjectModifiedEvent(
145 bugtask, bugtask_before_modification,
146- ['status', 'statusexplanation'], user=self.janitor))
147+ ['status'], user=self.janitor))
148 # XXX sinzui 2007-08-02 bug=29744:
149 # We commit after each expiration because emails are sent
150 # immediately in zopeless. This minimize the risk of
151
152=== modified file 'lib/lp/bugs/templates/bugtask-view.pt'
153--- lib/lp/bugs/templates/bugtask-view.pt 2009-12-19 19:54:41 +0000
154+++ lib/lp/bugs/templates/bugtask-view.pt 2011-09-09 15:13:01 +0000
155@@ -119,16 +119,6 @@
156 </table>
157 </div>
158
159- <div class="field" tal:condition="context/statusexplanation">
160- <div>
161- <label tal:attributes="for view/statusexplanation_widget/name"
162- tal:content="view/statusexplanation_widget/label" />
163- </div>
164- <div>
165- <tal:block replace="structure view/statusexplanation_widget" />
166- </div>
167- </div>
168-
169 <tal:user condition="view/user">
170 <tal:description
171 define="global description context/bug/description/fmt:text-to-html" />
172
173=== modified file 'lib/lp/coop/answersbugs/emailtemplates/question-linked-bug-status-updated.txt'
174--- lib/lp/coop/answersbugs/emailtemplates/question-linked-bug-status-updated.txt 2009-03-24 12:43:49 +0000
175+++ lib/lp/coop/answersbugs/emailtemplates/question-linked-bug-status-updated.txt 2011-09-09 15:13:01 +0000
176@@ -2,7 +2,6 @@
177
178 %(old_status)s => %(new_status)s
179
180-%(statusexplanation)s
181 %(bugtask_url)s
182 "%(bugtask_title)s"
183
184
185=== modified file 'lib/lp/coop/answersbugs/notification.py'
186--- lib/lp/coop/answersbugs/notification.py 2010-08-20 20:31:18 +0000
187+++ lib/lp/coop/answersbugs/notification.py 2011-09-09 15:13:01 +0000
188@@ -13,7 +13,6 @@
189 from canonical.launchpad.webapp.publisher import canonical_url
190 from lp.answers.notification import QuestionNotification
191 from lp.bugs.interfaces.bugtask import IBugTask
192-from lp.services.mail.mailwrapper import MailWrapper
193
194
195 def get_email_template(filename):
196@@ -59,25 +58,14 @@
197
198 def getBody(self):
199 """See QuestionNotification."""
200- if self.bugtask.statusexplanation:
201- wrapper = MailWrapper()
202- statusexplanation = (
203- 'Status change explanation given by %s:\n\n%s\n' % (
204- self.user.displayname,
205- wrapper.format(self.bugtask.statusexplanation)))
206- else:
207- statusexplanation = ''
208-
209 return get_email_template(
210 'question-linked-bug-status-updated.txt') % {
211 'bugtask_target_name': self.bugtask.target.displayname,
212 'question_id': self.question.id,
213- 'question_title':self.question.title,
214+ 'question_title': self.question.title,
215 'question_url': canonical_url(self.question),
216- 'bugtask_url':canonical_url(self.bugtask),
217+ 'bugtask_url': canonical_url(self.bugtask),
218 'bug_id': self.bugtask.bug.id,
219 'bugtask_title': self.bugtask.bug.title,
220 'old_status': self.old_bugtask.status.title,
221- 'new_status': self.bugtask.status.title,
222- 'statusexplanation': statusexplanation}
223-
224+ 'new_status': self.bugtask.status.title}
225
226=== modified file 'lib/lp/coop/answersbugs/tests/notifications-linked-bug.txt'
227--- lib/lp/coop/answersbugs/tests/notifications-linked-bug.txt 2011-04-30 01:34:57 +0000
228+++ lib/lp/coop/answersbugs/tests/notifications-linked-bug.txt 2011-09-09 15:13:01 +0000
229@@ -17,10 +17,9 @@
230 >>> bugtask = get_bugtask_linked_to_question()
231 >>> original_bugtask = Snapshot(bugtask, providing=providedBy(bugtask))
232 >>> bugtask.transitionToStatus(BugTaskStatus.CONFIRMED, no_priv)
233- >>> bugtask.statusexplanation = 'This bug really happened to me.'
234 >>> ignore = pop_questionemailjobs()
235 >>> notify(ObjectModifiedEvent(
236- ... bugtask, original_bugtask, ['status', 'statusexplanation'],
237+ ... bugtask, original_bugtask, ['status'],
238 ... user=no_priv))
239
240 >>> notifications = pop_questionemailjobs()
241@@ -38,10 +37,6 @@
242 <BLANKLINE>
243 New => Confirmed
244 <BLANKLINE>
245- Status change explanation given by No Privileges Person:
246- <BLANKLINE>
247- This bug really happened to me.
248- <BLANKLINE>
249 http://.../ubuntu/+bug/...
250 "Installer fails on a Mac PPC"
251 <BLANKLINE>