Merge lp:~danilo/launchpad/bug-1000787 into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Francesco Banconi | ||||
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) | Approve | ||
Francesco Banconi (community) | code* | Approve | |
Review via email: mp+107041@code.launchpad.net |
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/
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)