Merge lp:~adeuring/launchpad/bug-586808 into lp:launchpad/db-devel

Proposed by Abel Deuring
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: 9428
Proposed branch: lp:~adeuring/launchpad/bug-586808
Merge into: lp:launchpad/db-devel
Diff against target: 162 lines (+35/-13)
6 files modified
lib/lp/bugs/browser/bugtask.py (+1/-1)
lib/lp/bugs/browser/tests/test_bugtask.py (+9/-8)
lib/lp/bugs/doc/bugtask-status-workflow.txt (+11/-1)
lib/lp/bugs/interfaces/bugtask.py (+11/-2)
lib/lp/bugs/tests/bugs-emailinterface.txt (+1/-1)
lib/lp/bugs/tests/bugtarget-bugcount.txt (+2/-0)
To merge this branch: bzr merge lp:~adeuring/launchpad/bug-586808
Reviewer Review Type Date Requested Status
Graham Binns (community) code Approve
Review via email: mp+26480@code.launchpad.net

Description of the change

This branch adds a new bug task status "OPINION" as described in
https://dev.launchpad.net/LEP/CloseBugsLeaveDiscussionsOpen .

The changes are quit striaghtforward, I think. The enumeration
BugTaskStatus got a new element. I used the remaining integer value
between INCOMPLETE and INVALID: The method BugTask.transitionToStatus()
makes some assumptions about the ordering of the values, in order to
determine if some timestamps like date_in_progess should be set.

As discussed in the LEP, we consider the new status as a "closed"
status, so I added it to RESOLVED_BUGTASK_STATUSES.

The method BugTaskSearchListingView.getWidgetValues() returns a
shortlist, whose maximum length increased by the addition of the
new status.

I added a short explicit test of the new new status in
bugtask-status-workflow.txt.

The other changes simply ensure that existing test do not fail.

Tests:

./bin/test -t bugtask-status-workflow.txt \
-t test_bugtask \
-t bugtask-status-workflow.txt \
-t bugs-emailinterface.txt \
-t bugtarget-bugcount.txt \
-t test_bugtask_status.txt

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/bugs/browser/bugtask.py
  lib/lp/bugs/browser/tests/test_bugtask.py
  lib/lp/bugs/doc/bugtask-status-workflow.txt
  lib/lp/bugs/interfaces/bugtask.py
  lib/lp/bugs/tests/bugs-emailinterface.txt
  lib/lp/bugs/tests/bugtarget-bugcount.txt

== Pylint notices ==

lib/lp/bugs/interfaces/bugtask.py
    1245: [C0322, BugTaskSearchParams.fromSearchForm] Operator not preceded by a space
    search_params.linked_branches=linked_branches
    ^

To post a comment you must log in.
Revision history for this message
Graham Binns (gmb) wrote :

I think that the description of the new status could be rephrased thus:

    The bug remains open for discussion only. This status is usually used where there is disagreement over whether the bug is relevant to the current target and whether it should be fixed

Other than that, I'm happy with this change.

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 2010-05-21 15:19:20 +0000
+++ lib/lp/bugs/browser/bugtask.py 2010-06-04 09:40:47 +0000
@@ -2637,7 +2637,7 @@
2637 dict(2637 dict(
2638 value=term.token, title=term.title or term.token,2638 value=term.token, title=term.title or term.token,
2639 checked=term.value in default_values))2639 checked=term.value in default_values))
2640 return helpers.shortlist(widget_values, longest_expected=11)2640 return helpers.shortlist(widget_values, longest_expected=12)
26412641
2642 def getStatusWidgetValues(self):2642 def getStatusWidgetValues(self):
2643 """Return data used to render the status checkboxes."""2643 """Return data used to render the status checkboxes."""
26442644
=== modified file 'lib/lp/bugs/browser/tests/test_bugtask.py'
--- lib/lp/bugs/browser/tests/test_bugtask.py 2010-04-15 13:26:33 +0000
+++ lib/lp/bugs/browser/tests/test_bugtask.py 2010-06-04 09:40:47 +0000
@@ -245,8 +245,8 @@
245 self.bug.default_bugtask, LaunchpadTestRequest())245 self.bug.default_bugtask, LaunchpadTestRequest())
246 view.initialize()246 view.initialize()
247 self.assertEqual(247 self.assertEqual(
248 ['New', 'Incomplete', 'Invalid', 'Confirmed', 'In Progress',248 ['New', 'Incomplete', 'Opinion', 'Invalid', 'Confirmed',
249 'Fix Committed', 'Fix Released'],249 'In Progress', 'Fix Committed', 'Fix Released'],
250 self.getWidgetOptionTitles(view.form_fields['status']))250 self.getWidgetOptionTitles(view.form_fields['status']))
251251
252 def test_status_field_privileged_persons(self):252 def test_status_field_privileged_persons(self):
@@ -260,8 +260,9 @@
260 self.bug.default_bugtask, LaunchpadTestRequest())260 self.bug.default_bugtask, LaunchpadTestRequest())
261 view.initialize()261 view.initialize()
262 self.assertEqual(262 self.assertEqual(
263 ['New', 'Incomplete', 'Invalid', "Won't Fix", 'Confirmed',263 ['New', 'Incomplete', 'Opinion', 'Invalid', "Won't Fix",
264 'Triaged', 'In Progress', 'Fix Committed', 'Fix Released'],264 'Confirmed', 'Triaged', 'In Progress', 'Fix Committed',
265 'Fix Released'],
265 self.getWidgetOptionTitles(view.form_fields['status']),266 self.getWidgetOptionTitles(view.form_fields['status']),
266 'Unexpected set of settable status options for %s'267 'Unexpected set of settable status options for %s'
267 % user.name)268 % user.name)
@@ -278,8 +279,8 @@
278 self.bug.default_bugtask, LaunchpadTestRequest())279 self.bug.default_bugtask, LaunchpadTestRequest())
279 view.initialize()280 view.initialize()
280 self.assertEqual(281 self.assertEqual(
281 ['New', 'Incomplete', 'Invalid', 'Confirmed', 'In Progress',282 ['New', 'Incomplete', 'Opinion', 'Invalid', 'Confirmed',
282 'Fix Committed', 'Fix Released', 'Unknown'],283 'In Progress', 'Fix Committed', 'Fix Released', 'Unknown'],
283 self.getWidgetOptionTitles(view.form_fields['status']))284 self.getWidgetOptionTitles(view.form_fields['status']))
284285
285 def test_status_field_bug_task_in_status_expired(self):286 def test_status_field_bug_task_in_status_expired(self):
@@ -292,8 +293,8 @@
292 self.bug.default_bugtask, LaunchpadTestRequest())293 self.bug.default_bugtask, LaunchpadTestRequest())
293 view.initialize()294 view.initialize()
294 self.assertEqual(295 self.assertEqual(
295 ['New', 'Incomplete', 'Invalid', 'Expired', 'Confirmed',296 ['New', 'Incomplete', 'Opinion', 'Invalid', 'Expired',
296 'In Progress', 'Fix Committed', 'Fix Released'],297 'Confirmed', 'In Progress', 'Fix Committed', 'Fix Released'],
297 self.getWidgetOptionTitles(view.form_fields['status']))298 self.getWidgetOptionTitles(view.form_fields['status']))
298299
299300
300301
=== modified file 'lib/lp/bugs/doc/bugtask-status-workflow.txt'
--- lib/lp/bugs/doc/bugtask-status-workflow.txt 2010-04-15 15:28:22 +0000
+++ lib/lp/bugs/doc/bugtask-status-workflow.txt 2010-06-04 09:40:47 +0000
@@ -145,7 +145,7 @@
145 >>> ubuntu_firefox_task.date_inprogress is None145 >>> ubuntu_firefox_task.date_inprogress is None
146 True146 True
147147
148Marking the bug Triaged sets `date_triged`.148Marking the bug Triaged sets `date_triaged`.
149149
150 >>> print ubuntu_firefox_task.date_triaged150 >>> print ubuntu_firefox_task.date_triaged
151 None151 None
@@ -188,6 +188,16 @@
188188
189 >>> ubuntu_firefox_task.transitionToStatus(189 >>> ubuntu_firefox_task.transitionToStatus(
190 ... BugTaskStatus.CONFIRMED, getUtility(ILaunchBag).user)190 ... BugTaskStatus.CONFIRMED, getUtility(ILaunchBag).user)
191 >>> ubuntu_firefox_task.date_closed is None
192 True
193
194 >>> ubuntu_firefox_task.transitionToStatus(
195 ... BugTaskStatus.OPINION, getUtility(ILaunchBag).user)
196 >>> ubuntu_firefox_task.date_closed
197 datetime.datetime...
198
199 >>> ubuntu_firefox_task.transitionToStatus(
200 ... BugTaskStatus.CONFIRMED, getUtility(ILaunchBag).user)
191 >>> ubuntu_firefox_task.date_inprogress is None201 >>> ubuntu_firefox_task.date_inprogress is None
192 True202 True
193 >>> ubuntu_firefox_task.transitionToStatus(203 >>> ubuntu_firefox_task.transitionToStatus(
194204
=== modified file 'lib/lp/bugs/interfaces/bugtask.py'
--- lib/lp/bugs/interfaces/bugtask.py 2010-05-18 17:50:25 +0000
+++ lib/lp/bugs/interfaces/bugtask.py 2010-06-04 09:40:47 +0000
@@ -158,6 +158,14 @@
158 the user was visiting when the bug occurred, etc.158 the user was visiting when the bug occurred, etc.
159 """)159 """)
160160
161 OPINION = DBItem(16, """
162 Opinion
163
164 The bug remains open for discussion only. This status is usually
165 used where there is disagreement over whether the bug is relevant
166 to the current target and whether it should be fixed.
167 """)
168
161 INVALID = DBItem(17, """169 INVALID = DBItem(17, """
162 Invalid170 Invalid
163171
@@ -234,8 +242,8 @@
234242
235 sort_order = (243 sort_order = (
236 'NEW', 'INCOMPLETE_WITH_RESPONSE', 'INCOMPLETE_WITHOUT_RESPONSE',244 'NEW', 'INCOMPLETE_WITH_RESPONSE', 'INCOMPLETE_WITHOUT_RESPONSE',
237 'INCOMPLETE', 'INVALID', 'WONTFIX', 'EXPIRED', 'CONFIRMED', 'TRIAGED',245 'INCOMPLETE', 'OPINION', 'INVALID', 'WONTFIX', 'EXPIRED',
238 'INPROGRESS', 'FIXCOMMITTED', 'FIXRELEASED')246 'CONFIRMED', 'TRIAGED', 'INPROGRESS', 'FIXCOMMITTED', 'FIXRELEASED')
239247
240 INCOMPLETE_WITH_RESPONSE = DBItem(35, """248 INCOMPLETE_WITH_RESPONSE = DBItem(35, """
241 Incomplete (with response)249 Incomplete (with response)
@@ -311,6 +319,7 @@
311319
312RESOLVED_BUGTASK_STATUSES = (320RESOLVED_BUGTASK_STATUSES = (
313 BugTaskStatus.FIXRELEASED,321 BugTaskStatus.FIXRELEASED,
322 BugTaskStatus.OPINION,
314 BugTaskStatus.INVALID,323 BugTaskStatus.INVALID,
315 BugTaskStatus.WONTFIX,324 BugTaskStatus.WONTFIX,
316 BugTaskStatus.EXPIRED)325 BugTaskStatus.EXPIRED)
317326
=== modified file 'lib/lp/bugs/tests/bugs-emailinterface.txt'
--- lib/lp/bugs/tests/bugs-emailinterface.txt 2010-04-22 18:53:09 +0000
+++ lib/lp/bugs/tests/bugs-emailinterface.txt 2010-06-04 09:40:47 +0000
@@ -1435,7 +1435,7 @@
1435 status foo1435 status foo
1436 ...1436 ...
1437 The 'status' command expects any of the following arguments:1437 The 'status' command expects any of the following arguments:
1438 new, incomplete, invalid, wontfix, expired, confirmed, triaged, inprogress, fixcommitted, fixreleased1438 new, incomplete, opinion, invalid, wontfix, expired, confirmed, triaged, inprogress, fixcommitted, fixreleased
1439 <BLANKLINE>1439 <BLANKLINE>
1440 For example:1440 For example:
1441 <BLANKLINE>1441 <BLANKLINE>
14421442
=== modified file 'lib/lp/bugs/tests/bugtarget-bugcount.txt'
--- lib/lp/bugs/tests/bugtarget-bugcount.txt 2010-04-15 13:26:33 +0000
+++ lib/lp/bugs/tests/bugtarget-bugcount.txt 2010-06-04 09:40:47 +0000
@@ -11,6 +11,7 @@
11 ... print status.name11 ... print status.name
12 NEW12 NEW
13 INCOMPLETE13 INCOMPLETE
14 OPINION
14 INVALID15 INVALID
15 WONTFIX16 WONTFIX
16 EXPIRED17 EXPIRED
@@ -54,6 +55,7 @@
54 ... print_count_difference(new_bug_counts, old_counts, status)55 ... print_count_difference(new_bug_counts, old_counts, status)
55 NEW: 5 bug(s) more56 NEW: 5 bug(s) more
56 INCOMPLETE: 5 bug(s) more57 INCOMPLETE: 5 bug(s) more
58 OPINION: 5 bug(s) more
57 INVALID: 5 bug(s) more59 INVALID: 5 bug(s) more
58 WONTFIX: 5 bug(s) more60 WONTFIX: 5 bug(s) more
59 EXPIRED: 5 bug(s) more61 EXPIRED: 5 bug(s) more

Subscribers

People subscribed via source and target branches

to status/vote changes: