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
1=== modified file 'lib/lp/bugs/browser/bugtask.py'
2--- lib/lp/bugs/browser/bugtask.py 2010-05-21 15:19:20 +0000
3+++ lib/lp/bugs/browser/bugtask.py 2010-06-04 09:40:47 +0000
4@@ -2637,7 +2637,7 @@
5 dict(
6 value=term.token, title=term.title or term.token,
7 checked=term.value in default_values))
8- return helpers.shortlist(widget_values, longest_expected=11)
9+ return helpers.shortlist(widget_values, longest_expected=12)
10
11 def getStatusWidgetValues(self):
12 """Return data used to render the status checkboxes."""
13
14=== modified file 'lib/lp/bugs/browser/tests/test_bugtask.py'
15--- lib/lp/bugs/browser/tests/test_bugtask.py 2010-04-15 13:26:33 +0000
16+++ lib/lp/bugs/browser/tests/test_bugtask.py 2010-06-04 09:40:47 +0000
17@@ -245,8 +245,8 @@
18 self.bug.default_bugtask, LaunchpadTestRequest())
19 view.initialize()
20 self.assertEqual(
21- ['New', 'Incomplete', 'Invalid', 'Confirmed', 'In Progress',
22- 'Fix Committed', 'Fix Released'],
23+ ['New', 'Incomplete', 'Opinion', 'Invalid', 'Confirmed',
24+ 'In Progress', 'Fix Committed', 'Fix Released'],
25 self.getWidgetOptionTitles(view.form_fields['status']))
26
27 def test_status_field_privileged_persons(self):
28@@ -260,8 +260,9 @@
29 self.bug.default_bugtask, LaunchpadTestRequest())
30 view.initialize()
31 self.assertEqual(
32- ['New', 'Incomplete', 'Invalid', "Won't Fix", 'Confirmed',
33- 'Triaged', 'In Progress', 'Fix Committed', 'Fix Released'],
34+ ['New', 'Incomplete', 'Opinion', 'Invalid', "Won't Fix",
35+ 'Confirmed', 'Triaged', 'In Progress', 'Fix Committed',
36+ 'Fix Released'],
37 self.getWidgetOptionTitles(view.form_fields['status']),
38 'Unexpected set of settable status options for %s'
39 % user.name)
40@@ -278,8 +279,8 @@
41 self.bug.default_bugtask, LaunchpadTestRequest())
42 view.initialize()
43 self.assertEqual(
44- ['New', 'Incomplete', 'Invalid', 'Confirmed', 'In Progress',
45- 'Fix Committed', 'Fix Released', 'Unknown'],
46+ ['New', 'Incomplete', 'Opinion', 'Invalid', 'Confirmed',
47+ 'In Progress', 'Fix Committed', 'Fix Released', 'Unknown'],
48 self.getWidgetOptionTitles(view.form_fields['status']))
49
50 def test_status_field_bug_task_in_status_expired(self):
51@@ -292,8 +293,8 @@
52 self.bug.default_bugtask, LaunchpadTestRequest())
53 view.initialize()
54 self.assertEqual(
55- ['New', 'Incomplete', 'Invalid', 'Expired', 'Confirmed',
56- 'In Progress', 'Fix Committed', 'Fix Released'],
57+ ['New', 'Incomplete', 'Opinion', 'Invalid', 'Expired',
58+ 'Confirmed', 'In Progress', 'Fix Committed', 'Fix Released'],
59 self.getWidgetOptionTitles(view.form_fields['status']))
60
61
62
63=== modified file 'lib/lp/bugs/doc/bugtask-status-workflow.txt'
64--- lib/lp/bugs/doc/bugtask-status-workflow.txt 2010-04-15 15:28:22 +0000
65+++ lib/lp/bugs/doc/bugtask-status-workflow.txt 2010-06-04 09:40:47 +0000
66@@ -145,7 +145,7 @@
67 >>> ubuntu_firefox_task.date_inprogress is None
68 True
69
70-Marking the bug Triaged sets `date_triged`.
71+Marking the bug Triaged sets `date_triaged`.
72
73 >>> print ubuntu_firefox_task.date_triaged
74 None
75@@ -188,6 +188,16 @@
76
77 >>> ubuntu_firefox_task.transitionToStatus(
78 ... BugTaskStatus.CONFIRMED, getUtility(ILaunchBag).user)
79+ >>> ubuntu_firefox_task.date_closed is None
80+ True
81+
82+ >>> ubuntu_firefox_task.transitionToStatus(
83+ ... BugTaskStatus.OPINION, getUtility(ILaunchBag).user)
84+ >>> ubuntu_firefox_task.date_closed
85+ datetime.datetime...
86+
87+ >>> ubuntu_firefox_task.transitionToStatus(
88+ ... BugTaskStatus.CONFIRMED, getUtility(ILaunchBag).user)
89 >>> ubuntu_firefox_task.date_inprogress is None
90 True
91 >>> ubuntu_firefox_task.transitionToStatus(
92
93=== modified file 'lib/lp/bugs/interfaces/bugtask.py'
94--- lib/lp/bugs/interfaces/bugtask.py 2010-05-18 17:50:25 +0000
95+++ lib/lp/bugs/interfaces/bugtask.py 2010-06-04 09:40:47 +0000
96@@ -158,6 +158,14 @@
97 the user was visiting when the bug occurred, etc.
98 """)
99
100+ OPINION = DBItem(16, """
101+ Opinion
102+
103+ The bug remains open for discussion only. This status is usually
104+ used where there is disagreement over whether the bug is relevant
105+ to the current target and whether it should be fixed.
106+ """)
107+
108 INVALID = DBItem(17, """
109 Invalid
110
111@@ -234,8 +242,8 @@
112
113 sort_order = (
114 'NEW', 'INCOMPLETE_WITH_RESPONSE', 'INCOMPLETE_WITHOUT_RESPONSE',
115- 'INCOMPLETE', 'INVALID', 'WONTFIX', 'EXPIRED', 'CONFIRMED', 'TRIAGED',
116- 'INPROGRESS', 'FIXCOMMITTED', 'FIXRELEASED')
117+ 'INCOMPLETE', 'OPINION', 'INVALID', 'WONTFIX', 'EXPIRED',
118+ 'CONFIRMED', 'TRIAGED', 'INPROGRESS', 'FIXCOMMITTED', 'FIXRELEASED')
119
120 INCOMPLETE_WITH_RESPONSE = DBItem(35, """
121 Incomplete (with response)
122@@ -311,6 +319,7 @@
123
124 RESOLVED_BUGTASK_STATUSES = (
125 BugTaskStatus.FIXRELEASED,
126+ BugTaskStatus.OPINION,
127 BugTaskStatus.INVALID,
128 BugTaskStatus.WONTFIX,
129 BugTaskStatus.EXPIRED)
130
131=== modified file 'lib/lp/bugs/tests/bugs-emailinterface.txt'
132--- lib/lp/bugs/tests/bugs-emailinterface.txt 2010-04-22 18:53:09 +0000
133+++ lib/lp/bugs/tests/bugs-emailinterface.txt 2010-06-04 09:40:47 +0000
134@@ -1435,7 +1435,7 @@
135 status foo
136 ...
137 The 'status' command expects any of the following arguments:
138- new, incomplete, invalid, wontfix, expired, confirmed, triaged, inprogress, fixcommitted, fixreleased
139+ new, incomplete, opinion, invalid, wontfix, expired, confirmed, triaged, inprogress, fixcommitted, fixreleased
140 <BLANKLINE>
141 For example:
142 <BLANKLINE>
143
144=== modified file 'lib/lp/bugs/tests/bugtarget-bugcount.txt'
145--- lib/lp/bugs/tests/bugtarget-bugcount.txt 2010-04-15 13:26:33 +0000
146+++ lib/lp/bugs/tests/bugtarget-bugcount.txt 2010-06-04 09:40:47 +0000
147@@ -11,6 +11,7 @@
148 ... print status.name
149 NEW
150 INCOMPLETE
151+ OPINION
152 INVALID
153 WONTFIX
154 EXPIRED
155@@ -54,6 +55,7 @@
156 ... print_count_difference(new_bug_counts, old_counts, status)
157 NEW: 5 bug(s) more
158 INCOMPLETE: 5 bug(s) more
159+ OPINION: 5 bug(s) more
160 INVALID: 5 bug(s) more
161 WONTFIX: 5 bug(s) more
162 EXPIRED: 5 bug(s) more

Subscribers

People subscribed via source and target branches

to status/vote changes: