Merge lp:~jkakar/kanban/better-card-ordering into lp:kanban

Proposed by Jamu Kakar
Status: Merged
Approved by: Martin Pool
Approved revision: 27
Merged at revision: 27
Proposed branch: lp:~jkakar/kanban/better-card-ordering
Merge into: lp:kanban
Diff against target: 41 lines (+9/-6)
2 files modified
kanban/board.py (+2/-2)
kanban/tests/test_board.py (+7/-4)
To merge this branch: bzr merge lp:~jkakar/kanban/better-card-ordering
Reviewer Review Type Date Requested Status
Martin Pool Approve
Review via email: mp+55344@code.launchpad.net

Description of the change

This branch introduces the following changes:

- Bugs are compared by (importance, bug number) now, instead of by
  (importance, title). This has the effect that bugs with the same
  importance will be listed chronologically, in a given status column,
  which is desirable when the column contains bugs that stack upon
  each other.

To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

That sounds good. What do you mean by "stack on each other"? Depend on each other; on the theory that earlier bugs are more likely to be the underlying bug?

review: Approve
Revision history for this message
Jamu Kakar (jkakar) wrote :

Thanks for the review! What I meant by 'stack on each other' is when
you have one bug that builds on the next... ie, when you break up a
large task into smaller ones.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'kanban/board.py'
2--- kanban/board.py 2011-03-12 07:54:27 +0000
3+++ kanban/board.py 2011-03-29 14:08:25 +0000
4@@ -113,7 +113,7 @@
5 """Compare two L{Bug}s.
6
7 Bugs with a higher importance are sorted first. Bugs with the same
8- importance are ordered alphabetically by title.
9+ importance are ordered by bug number.
10 """
11 a_importance = IMPORTANCE_ORDER.index(a.importance)
12 b_importance = IMPORTANCE_ORDER.index(b.importance)
13@@ -122,7 +122,7 @@
14 elif a_importance > b_importance:
15 return 1
16 else:
17- return cmp(a.title, b.title)
18+ return cmp(a.id, b.id)
19
20
21 class BugCollectionMixin(object):
22
23=== modified file 'kanban/tests/test_board.py'
24--- kanban/tests/test_board.py 2011-03-12 07:54:27 +0000
25+++ kanban/tests/test_board.py 2011-03-29 14:08:25 +0000
26@@ -266,10 +266,13 @@
27 Bug("6", "kanban", CRITICAL, FIX_RELEASED, "A title")]
28 self.assertEquals(list(reversed(bugs)), sorted(bugs, compare_bugs))
29
30- def test_same_status_defers_to_title(self):
31- """L{Bug}s with the importance status they are ordered by title."""
32- bugs = [Bug("1", "kanban", UNDECIDED, FIX_RELEASED, "Zebra"),
33- Bug("2", "kanban", UNDECIDED, FIX_RELEASED, "Alpha")]
34+ def test_same_status_defers_to_bug_number(self):
35+ """
36+ L{Bug}s with the same importance status are secondarily ordered by
37+ L{Bug.id}.
38+ """
39+ bugs = [Bug("2", "kanban", UNDECIDED, FIX_RELEASED, "Zebra"),
40+ Bug("1", "kanban", UNDECIDED, FIX_RELEASED, "Alpha")]
41 self.assertEquals(list(reversed(bugs)), sorted(bugs, compare_bugs))
42
43

Subscribers

People subscribed via source and target branches

to all changes: