cannot delete/merge a team with private branches
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Critical
|
Curtis Hovey |
Bug Description
I tried to delete a team that had private branches in projects with branch visibility rules. Merge transfers artefacts that must have owners, such as as branches to ~registry. Merge oopses because ~registry does not have a policy for the project. Lp might want to ask the user to provide another team to transfer the branches too. Maybe Lp should explain the user might want to do a merge with a new team instead.
This error also happens when I attempt to merge the team into another team. I hoped that the branches and policies would be transferred to the new team. Lp really must support this case. The issue might be moot if branch branch visibility policies are replaced with project sharing policies and merge handles them properly.
OOPS-b2214aa38cea8f74df0b9d79b02ef765
BranchCreatio
Traceback (most recent call last):
Module lp.services.
self.
Module lp.services.
job.run()
Module lp.registry.
reviewer=
Module lp.registry.
return self._merge(
Module lp.registry.
self.
Module lp.registry.
removeSecur
Module lp.code.
new_
Module lp.code.
self.
Module lp.code.
self.
Module lp.code.
'You cannot create branches in "%s"' % self.name)
BranchCreationF
While this bug will disappear when BVP is removed. We do not want ~registry to own private branches. The delete page must explain that the team cannot be deleted until the team's private branches are deleted or the ownership is transferred to another person. Delete may need to delete merged branches...the user needs to find all the other branches.
Related branches
- Richard Harding (community): Approve
-
Diff: 199 lines (+59/-8)6 files modifiedlib/lp/code/interfaces/branchcollection.py (+3/-0)
lib/lp/code/model/branchcollection.py (+9/-1)
lib/lp/code/model/tests/test_branchcollection.py (+15/-1)
lib/lp/registry/browser/peoplemerge.py (+7/-0)
lib/lp/registry/browser/tests/test_peoplemerge.py (+18/-5)
lib/lp/registry/model/person.py (+7/-1)
description: | updated |
Changed in launchpad: | |
assignee: | nobody → Steve Kowalik (stevenk) |
status: | Triaged → In Progress |
tags: | added: sharing |
description: | updated |
Changed in launchpad: | |
assignee: | nobody → Curtis Hovey (sinzui) |
status: | Triaged → In Progress |
tags: |
added: qa-ok removed: qa-needstesting |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |
There is a second manifestation for this bug. I took ownership the old team and manually added branch policies the new team. I Merge thought it completed, but the DB reported an Integrity error. Looks like it is impossible to merge a team with another team if they both have visibility policies for a project. OOPS-190f295665ef293127cdd356371fc0c4
IntegrityError: duplicate key value violates unique constraint "branchvisibili typolicy_ _unq"
Traceback (most recent call last): job.runner, line 267, in runJobHandleError runJob( job) job.runner, line 225, in runJob model.persontra nsferjob, line 437, in run self.reviewer) model.person, line 4067, in merge from_person, to_person, reviewer) model.person, line 4259, in _merge database. sqlbase, line 619, in execute n.execute( query) .postgres, line 261, in execute execute( self, statement, params, noresult) execute( statement, params) .postgres, line 271, in raw_execute raw_execute( self, statement, params) _check_ disconnect( raw_cursor. execute, *args) typolicy_ _unq"
Module lp.services.
self.
Module lp.services.
job.run()
Module lp.registry.
reviewer=
Module lp.registry.
return self._merge(
Module lp.registry.
src_tab, src_col, to_person.id, src_col, from_person.id))
Module lp.services.
self._result = self._connectio
Module storm.databases
return Connection.
Module storm.database, line 238, in execute
raw_cursor = self.raw_
Module storm.databases
return Connection.
Module storm.database, line 322, in raw_execute
self.
Module storm.database, line 371, in _check_disconnect
return function(*args, **kwargs)
IntegrityError: duplicate key value violates unique constraint "branchvisibili