Merge lp:~deryck/launchpad/sort-by-heat-as-default-77701 into lp:launchpad/db-devel

Proposed by Deryck Hodge
Status: Rejected
Rejected by: Deryck Hodge
Proposed branch: lp:~deryck/launchpad/sort-by-heat-as-default-77701
Merge into: lp:launchpad/db-devel
Diff against target: 260 lines (+47/-54)
7 files modified
lib/lp/bugs/browser/bugtask.py (+1/-1)
lib/lp/bugs/browser/tests/bugtask-search-views.txt (+7/-7)
lib/lp/bugs/stories/bugs/xx-front-page-search.txt (+7/-14)
lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.txt (+1/-1)
lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt (+14/-14)
lib/lp/bugs/stories/bugtask-searches/xx-sort-orders.txt (+12/-12)
lib/lp/bugs/templates/bugtarget-macros-search.pt (+5/-5)
To merge this branch: bzr merge lp:~deryck/launchpad/sort-by-heat-as-default-77701
Reviewer Review Type Date Requested Status
Graham Binns (community) Approve
Review via email: mp+17919@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Deryck Hodge (deryck) wrote :

This branch changes the default sort on bug listings to be heat
descending rather than importance descending. As a consequence of the
change, it fixes bug 77701. Affected tests have been updated and
default sort is well tested.

Cheers,
deryck

= 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/templates/bugtarget-macros-search.pt
  lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt
  lib/lp/bugs/stories/bugs/xx-front-page-search.txt
  lib/lp/bugs/browser/bugtask.py
  lib/lp/bugs/stories/bugtask-searches/xx-sort-orders.txt
  lib/lp/bugs/browser/tests/bugtask-search-views.txt
  lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.txt

Revision history for this message
Graham Binns (gmb) wrote :

I'm happy for this to land (though apparently Martin isn't, so that could be moot).

review: Approve
Revision history for this message
Deryck Hodge (deryck) wrote :

I'll hold on to the branch since it's complete and do a more extensive UI discussion and review with Martin A. next week to determine if we want to go forward with this approach.

Unmerged revisions

8919. By Deryck Hodge

Fix broken tests.

8918. By Deryck Hodge

Change the search input ordering to default to bug heat.

8917. By Deryck Hodge

Change default sort order from -importance to -heat.

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-01-19 20:21:55 +0000
3+++ lib/lp/bugs/browser/bugtask.py 2010-01-22 20:25:23 +0000
4@@ -293,7 +293,7 @@
5 return order_by
6 else:
7 # No sort ordering specified, so use a reasonable default.
8- return ["-importance"]
9+ return ['-heat']
10
11
12 def get_default_search_params(user):
13
14=== modified file 'lib/lp/bugs/browser/tests/bugtask-search-views.txt'
15--- lib/lp/bugs/browser/tests/bugtask-search-views.txt 2009-11-27 14:34:31 +0000
16+++ lib/lp/bugs/browser/tests/bugtask-search-views.txt 2010-01-22 20:25:23 +0000
17@@ -35,9 +35,9 @@
18 >>> open_bugtasks = list(distro_search_listingview.search().batch)
19 >>> [(bugtask.bug.id, bugtask.status.name, bugtask.importance.name)
20 ... for bugtask in open_bugtasks]
21- [(3, 'NEW', 'UNKNOWN'),
22- (1, 'CONFIRMED', 'LOW'),
23- (2, 'CONFIRMED', 'LOW')]
24+ [(1, 'CONFIRMED', 'LOW'),
25+ (2, 'CONFIRMED', 'LOW'),
26+ (3, 'NEW', 'UNKNOWN')]
27
28 And the advanced form allows us to query for specific bug statuses.
29
30@@ -301,10 +301,10 @@
31 >>> open_bugtasks = list(mozilla_search_listingview.search().batch)
32 >>> for bugtask in open_bugtasks:
33 ... print bugtask.bug.id, bugtask.product.name, bugtask.status.name
34+ 1 firefox NEW
35+ 4 firefox NEW
36+ 5 firefox NEW
37 15 thunderbird NEW
38- 5 firefox NEW
39- 4 firefox NEW
40- 1 firefox NEW
41
42 And now we'll change the status of one of the bugtasks (we are still
43 logged in from earlier):
44@@ -327,7 +327,7 @@
45 >>> invalid_bugtasks = list(mozilla_search_listingview.search().batch)
46 >>> for bugtask in invalid_bugtasks:
47 ... print bugtask.bug.id, bugtask.product.name, bugtask.status.name
48- 15 thunderbird INVALID
49+ 1 firefox INVALID
50
51 >>> open_bugtasks[0].transitionToStatus(
52 ... previous_status, getUtility(ILaunchBag).user)
53
54=== modified file 'lib/lp/bugs/stories/bugs/xx-front-page-search.txt'
55--- lib/lp/bugs/stories/bugs/xx-front-page-search.txt 2009-09-23 13:26:26 +0000
56+++ lib/lp/bugs/stories/bugs/xx-front-page-search.txt 2010-01-22 20:25:23 +0000
57@@ -28,20 +28,13 @@
58 >>> print anon_browser.title
59 Search
60 >>> print_bugtasks(anon_browser.contents)
61- 3 Bug Title Test
62- mozilla-firefox (Debian) Unknown New
63- 15 Nonsensical bugs are useless
64- Mozilla Thunderbird Unknown New
65- 3 Bug Title Test
66- mozilla-firefox (Debian Woody) Medium New
67- 3 Bug Title Test
68- mozilla-firefox (Debian Sarge) Medium New
69- 7 A test bug
70- Evolution Medium New
71- 10 another test bug
72- linux-source-2.6.15 (Ubuntu) Medium New
73- 15 Nonsensical bugs are useless
74- Redfish Undecided New
75+ 3 Bug Title Test mozilla-firefox (Debian) Unknown New
76+ 3 Bug Title Test mozilla-firefox (Debian Woody) Medium New
77+ 3 Bug Title Test mozilla-firefox (Debian Sarge) Medium New
78+ 7 A test bug Evolution Medium New
79+ 10 another test bug linux-source-2.6.15 (Ubuntu) Medium New
80+ 15 Nonsensical bugs are useless Redfish Undecided New
81+ 15 Nonsensical bugs are useless Mozilla Thunderbird Unknown New
82
83 Even if a product is specified in the bug target widget, all bug reports
84 will be searched.
85
86=== modified file 'lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.txt'
87--- lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.txt 2009-09-09 23:16:08 +0000
88+++ lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.txt 2010-01-22 20:25:23 +0000
89@@ -70,8 +70,8 @@
90 >>> anon_browser.getControl(name='field.bug_reporter').value = 'name12'
91 >>> anon_browser.getControl('Search', index=0).click()
92 >>> print_bugtasks(anon_browser.contents)
93+ 2 Blackhole Trash folder mozilla-firefox (Debian) Low Confirmed
94 5 Firefox install instructions should be complete Mozilla Firefox Critical New
95- 2 Blackhole Trash folder mozilla-firefox (Debian) Low Confirmed
96
97 and invalid searches don't OOPS:
98
99
100=== modified file 'lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt'
101--- lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt 2010-01-19 20:45:38 +0000
102+++ lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt 2010-01-22 20:25:23 +0000
103@@ -7,18 +7,18 @@
104 >>> from lp.bugs.tests.bug import print_bugtasks
105 >>> user_browser.open("http://launchpad.dev/mozilla/+bugs")
106 >>> print_bugtasks(user_browser.contents)
107+ 1 Firefox does not support SVG firefox Low New
108+ 4 Reflow problems with complex page layouts firefox Medium New
109+ 5 Firefox install instructions should be complete firefox Critical New
110 15 Nonsensical bugs are useless thunderbird Unknown New
111- 5 Firefox install instructions should be complete firefox Critical New
112- 4 Reflow problems with complex page layouts firefox Medium New
113- 1 Firefox does not support SVG firefox Low New
114
115 Bug listings default to open bugtasks:
116
117 >>> user_browser.open('http://launchpad.dev/debian/+bugs')
118 >>> print_bugtasks(user_browser.contents)
119+ 1 Firefox does not support SVG mozilla-firefox Low Confirmed
120+ 2 Blackhole Trash folder mozilla-firefox Low Confirmed
121 3 Bug Title Test mozilla-firefox Unknown New
122- 1 Firefox does not support SVG mozilla-firefox Low Confirmed
123- 2 Blackhole Trash folder mozilla-firefox Low Confirmed
124
125 But you can make it show fixed ones to:
126
127@@ -48,9 +48,9 @@
128
129 >>> user_browser.open("http://launchpad.dev/firefox/+bugs")
130 >>> print_bugtasks(user_browser.contents)
131+ 1 Firefox does not support SVG Low New
132+ 4 Reflow problems with complex page layouts Medium New
133 5 Firefox install instructions should be complete Critical New
134- 4 Reflow problems with complex page layouts Medium New
135- 1 Firefox does not support SVG Low New
136
137 View the distribution bug listing as Foo Bar, who's a maintainer.
138
139@@ -74,10 +74,10 @@
140
141 >>> anon_browser.open("""http://launchpad.dev/firefox/+bugs?field.searchtext=&field.status%3Alist=New&field.status%3Alist=Confirmed&field.status-empty-marker=1&field.importance-empty-marker=1&field.assignee=&field.unassigned.used=&field.omit_dupes=&field.milestone-empty-marker=1&search=Search""")
142 >>> print_bugtasks(anon_browser.contents)
143+ 1 Firefox does not support SVG Low New
144+ 4 Reflow problems with complex page layouts Medium New
145 5 Firefox install instructions should be complete Critical New
146 6 Firefox crashes when Save As dialog for a nonexistent window is closed High New
147- 4 Reflow problems with complex page layouts Medium New
148- 1 Firefox does not support SVG Low New
149
150
151 == Critical bugs ==
152@@ -164,8 +164,8 @@
153
154 >>> user_browser.open("http://launchpad.dev/firefox/+bugs?field.searchtext=install&search=Search&advanced=&milestone=1&status=10&status=20&assignee=all")
155 >>> print_bugtasks(user_browser.contents)
156+ 1 Firefox does not support SVG Low New
157 5 Firefox install instructions should be complete Critical New
158- 1 Firefox does not support SVG Low New
159
160 If we search for something and get no matches, it'll say so in a meaningful way
161 instead of displaying an empty table.
162@@ -206,12 +206,12 @@
163
164 >>> browser.open('http://bugs.launchpad.dev/firefox/+bugs')
165 >>> names_and_branches(browser.contents)
166- /firefox/+bug/5
167- Badge: branch
168- /firefox/+bug/4
169- Badge: branch
170 /firefox/+bug/1
171 Badge: blueprint
172+ /firefox/+bug/4
173+ Badge: branch
174+ /firefox/+bug/5
175+ Badge: branch
176
177 Milestones are also presented as badges on bugs, and linked to the
178 relevant listings:
179
180=== modified file 'lib/lp/bugs/stories/bugtask-searches/xx-sort-orders.txt'
181--- lib/lp/bugs/stories/bugtask-searches/xx-sort-orders.txt 2009-06-12 16:36:02 +0000
182+++ lib/lp/bugs/stories/bugtask-searches/xx-sort-orders.txt 2010-01-22 20:25:23 +0000
183@@ -9,12 +9,12 @@
184
185 >>> from lp.bugs.tests.bug import print_bugtasks
186 >>> print_bugtasks(anon_browser.contents)
187+ 1 Firefox does not support SVG
188+ Low New
189+ 4 Reflow problems with complex page layouts
190+ Medium New
191 5 Firefox install instructions should be complete
192 Critical New
193- 4 Reflow problems with complex page layouts
194- Medium New
195- 1 Firefox does not support SVG
196- Low New
197
198 Newest:
199
200@@ -35,12 +35,12 @@
201
202 >>> anon_browser.open("http://launchpad.dev/debian/+bugs")
203 >>> print_bugtasks(anon_browser.contents)
204+ 1 Firefox does not support SVG
205+ mozilla-firefox Low Confirmed
206+ 2 Blackhole Trash folder
207+ mozilla-firefox Low Confirmed
208 3 Bug Title Test
209 mozilla-firefox Unknown New
210- 1 Firefox does not support SVG
211- mozilla-firefox Low Confirmed
212- 2 Blackhole Trash folder
213- mozilla-firefox Low Confirmed
214
215 By most recently changed:
216
217@@ -111,12 +111,12 @@
218 >>> anon_browser.open(
219 ... "http://launchpad.dev/debian/+source/mozilla-firefox/+bugs")
220 >>> print_bugtasks(anon_browser.contents)
221+ 1 Firefox does not support SVG
222+ Low Confirmed
223+ 2 Blackhole Trash folder
224+ Low Confirmed
225 3 Bug Title Test
226 Unknown New
227- 1 Firefox does not support SVG
228- Low Confirmed
229- 2 Blackhole Trash folder
230- Low Confirmed
231
232 Sort by importance:
233
234
235=== modified file 'lib/lp/bugs/templates/bugtarget-macros-search.pt'
236--- lib/lp/bugs/templates/bugtarget-macros-search.pt 2010-01-19 22:34:00 +0000
237+++ lib/lp/bugs/templates/bugtarget-macros-search.pt 2010-01-22 20:25:23 +0000
238@@ -9,7 +9,11 @@
239 method.
240 </tal:comment>
241 <select name="orderby" id="orderby" size="1"
242- tal:define="orderby request/orderby|string:-importance">
243+ tal:define="orderby request/orderby|string:-heat">
244+ <option
245+ value="-heat"
246+ tal:attributes="selected python:orderby == '-heat'"
247+ >by bug heat</option>
248 <option
249 value="-importance"
250 tal:attributes="selected python:orderby == '-importance'"
251@@ -55,10 +59,6 @@
252 value="-users_affected_count"
253 tal:attributes="selected python:orderby == '-users_affected_count'"
254 >by number of users affected</option>
255- <option
256- value="-heat"
257- tal:attributes="selected python:orderby == '-heat'"
258- >by bug heat</option>
259 </select>
260 </metal:block>
261

Subscribers

People subscribed via source and target branches

to status/vote changes: