Merge lp:~sinzui/launchpad/allow-vcs-imports-to-rename-a-branch into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Richard Harding |
Approved revision: | no longer in the source branch. |
Merged at revision: | 16368 |
Proposed branch: | lp:~sinzui/launchpad/allow-vcs-imports-to-rename-a-branch |
Merge into: | lp:launchpad |
Diff against target: |
178 lines (+51/-27) 5 files modified
lib/lp/code/interfaces/branch.py (+16/-5) lib/lp/code/interfaces/branchnamespace.py (+3/-1) lib/lp/code/model/branchnamespace.py (+3/-3) lib/lp/code/model/tests/test_branchnamespace.py (+27/-0) lib/lp/security.py (+2/-18) |
To merge this branch: | bzr merge lp:~sinzui/launchpad/allow-vcs-imports-to-rename-a-branch |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Richard Harding (community) | Approve | ||
Review via email: mp+139270@code.launchpad.net |
Commit message
Allow ~vcs-imports members to rename imported branches.
Description of the change
Members of ~vcs-branches are responsible for moderating imported branches.
An oops can be raised when the member renames an imported branch and the
member is not a member of the owning team. This error is raised even though
the member is not changing the branch owner.
RULES
Pre-
* The oops is caused by over zealous permission checking that does not
distinguish between the branch name and the owner name in the branch's
unique_name.
* This issue also relates to asymmetric rules for responsibility and
rules for permission. Permission to change the branch owner is given
to ~admins and ~bazaar-experts, and most member of ~vcs-imports are
also members of ~bazaar-experts. But ~bazaar-experts are not
responsible for managing imports.
* ~bazaar-experts were removed from user_has_
* Code that checks ownership or team membership must recognise that
* The branch edit security checker has a complex check for the
to check a specific user.
* user_has_
checker code were moved into it.
QA
* Visit https:/
* Verify the owner field uses the picker instead of a select list.
* Change the name from "trunk" to "main" and submit.
* Verify the change is accepted.
LINT
lib/
lib/
lib/
lib/
lib/
lib/
LoC
I have more than 10,000 lines of credit this week.
TEST
./bin/test -vc -t validateMove -t validateRegistrant lp.code.model.tests
./bin/test -vc -t 'test_branch\
IMPLEMENTATION
I moved the rules to check if the case is a ~vcs-imports member working
with a code import branch into user_has_
lib/
lib/
I updated validateRegistr
is in turn passed to user_has_
rename an imported branch and change the owner without doing arranging for
help.
lib/
lib/
lib/
I passed the branch to user_has_
members also permitted to reassign imported branch to anyone. This is a big
help to cases where we are asked to give the project and branch to someone
claiming a project.
lib/