Merge lp:~wallyworld/launchpad/remove-decoratedbug into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 12539 | ||||
Proposed branch: | lp:~wallyworld/launchpad/remove-decoratedbug | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
718 lines (+228/-171) 14 files modified
lib/lp/code/browser/branch.py (+1/-1) lib/lp/code/browser/branchmergeproposal.py (+4/-13) lib/lp/code/browser/decorations.py (+0/-83) lib/lp/code/browser/tests/test_branch.py (+3/-2) lib/lp/code/browser/tests/test_branchmergeproposal.py (+12/-1) lib/lp/code/configure.zcml (+1/-0) lib/lp/code/interfaces/branchcollection.py (+6/-2) lib/lp/code/interfaces/branchmergeproposal.py (+3/-0) lib/lp/code/model/branch.py (+27/-19) lib/lp/code/model/branchcollection.py (+49/-17) lib/lp/code/model/branchmergeproposal.py (+16/-2) lib/lp/code/model/tests/test_branchcollection.py (+59/-18) lib/lp/code/model/tests/test_branchmergeproposal.py (+41/-7) lib/lp/code/templates/branch-macros.pt (+6/-6) |
||||
To merge this branch: | bzr merge lp:~wallyworld/launchpad/remove-decoratedbug | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Penhey (community) | Approve | ||
Review via email: mp+52003@code.launchpad.net |
Commit message
Remove the now obsolete DecoratedBug class and use Branch.
Description of the change
This branch is the first of 3. The bug which started it all said "Cannot view branch with revisions fixing private bugs". Fixing the root cause is to ensure that private bugs are not exposed via APIs on branch merge proposals.
The core work is done here: remove the now obsolete DecoratedBug class and the linked_bugs property on DecoratedBranch and add a new getRelatedBugTa
== Implementation ==
The basis of the approach is to use the recently added Branch.
A new getRelatedBugTa
== Demo and QA ==
Create a merge proposal for a branch which is linked to at least one private bug. The private bug should not show on the merge proposal index page for an unauthorised user.
Merge the source branch of the merge proposal into another branch. The target branch's index page should show the recent revisions with the merge proposal but the private bug should not show for unauthorised users.
== Tests ==
Some new tests were added:
- browser.
test_
- model.tests.
test_
- model.tests.
test_
test_
test_
test_
Existing test_branchmerg
== Lint ==
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
./lib/lp/
50: E301 expected 1 blank line, found 2
./lib/lp/
317: Line exceeds 78 characters.
739: Line exceeds 78 characters.
In the function filter_ one_task_ per_bug, I think it would be better
to use the enumerate function to create values for the sorting, rather
that the length of the list. Also, remembering bug instead of traversing
over the attributes every time. Also indexing [1] looks kinda random.
So...
from collections import namedtuple
TaskIndex = namedtuple( 'TaskIndex' , 'sort_order task')
order[ bug].task = task order.values) ]
for pos, task in enumerate(tasks):
bug = task.bug
if bug not in order:
order[bug] = TaskIndex(pos, None)
if task.target == bugtarget:
for task in tasks:
index = order[task.bug]
if index.task is None:
index.task = task
return [index.task for index in sorted(
That's all I have to say :-), and you still have more additions than
removals.