Merge lp:~danilo/launchpad/bug-1000787 into lp:launchpad
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Francesco Banconi on 2012-05-23 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | 15300 | ||||
| Proposed branch: | lp:~danilo/launchpad/bug-1000787 | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
68 lines (+44/-2) 2 files modified
lib/lp/registry/browser/person.py (+2/-2) lib/lp/registry/browser/tests/test_person_upcomingwork.py (+42/-0) |
||||
| To merge this branch: | bzr merge lp:~danilo/launchpad/bug-1000787 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Raphaël Badin (community) | 2012-05-23 | Approve on 2012-05-23 | |
| Francesco Banconi (community) | code* | 2012-05-23 | Approve on 2012-05-23 |
|
Review via email:
|
|||
Commit Message
Upcoming work view should split out blueprint work items into appropriate milestone blocks.
Description of the Change
= Bug 1000787: incorrect grouping of workitems in different milestones =
Initially, this bug was about a ZeroDivisionError, where we were dividing by zero as a total number of work items in a single "date grouping". That should have been impossible, so James Tunnicliffe just guarded against division-by-zero in one of his other branches, and that helped uncover where the bug was.
A single blueprint can have workitems targetted to multiple milestones. However, due to code structure, all of them ended up in the same blueprint-container that could only go under one single date.
== Proposed fix ==
The change is to make by-blueprint (specification) grouping be also by milestone first, so we would create a spec-container in each of the milestones that require it.
== LOC rationale ==
All branches so far:
https:/
== Tests ==
bin/test -cvvt person_upcoming
== Demo and Q/A ==
1. Create a BP, target it to a certain milestone (with the date set)
2. Add two workitems, one in default milestone; another in a different milestone with a different date (use "Work items for milestone-name:" in the work-items edit box to do that)
3. Assign the BP to a person/team
4. Go to that person's/team's upcomingwork page
This should show up work-items/
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
| Raphaël Badin (rvb) wrote : | # |
Looks good.
[0]
53 + self.assertCont
54 + [container.spec
56 + self.assertCont
57 + [item.actual_
63 + self.assertCont
64 + [container.spec
66 + self.assertCont
67 + [item.actual_
Weird line wrapping here.
| Данило Шеган (danilo) wrote : | # |
Francesco, thanks for the review, and indeed, that's good suggestion, I'll use that.
Raphael (thanks as well), what line wrapping would you suggest instead? I've used something that should be a bit more conservative now :)
Also, if the changes make you happy, can you please submit this for landing?

The code looks good, tests pass, thank you.
Just a suggestion: maybe the code in lines 9..11 could be simplified, e.g.::
container = containers_ by_spec. setdefault( milestone, {}).get(spec)