Comment 4 for bug 34540

Revision history for this message
David Allouche (ddaa) wrote :

I mean general case as in "delete a branch, from the web ui, even if it referenced from other places".

If we provide a deletion UI, but database constraints prevent us from deleting a branch, we need to be able to diagnose the reason and at least explain it to the user. And maybe just delete the branch and the references. For example, branch links from bugs, specs, release series, subscriptions, etc.

If the web UI does not immediately deletes the database entry, but just marks the branch as "to-delete" (which is preferrable because it allows undeletion) we need to implement filtering for deleted branches in every part of Launchpad that deals with branch. Which is difficult.

Finally, we should support garbage collection of branch-related filesystem data, including the branch mirror, the sftp area (for hosted branch), the loggerhead caches, etc. One way to approach the problem is to delete any filesystem data that is not associated to a database object, but that opens several race condition for non-web systems that operate on this filesystem data. Those race conditions do not seem serious, but would produce spurious error reports and should be avoided.

Another approach to garbage collection, with the to-delete flag, would be adding a "garbage-collected" status (no, in-progress, done), and only allow deletion of the database object when the garbage collection is complete.

So, it's complicated.

On the upside, I taught Tom how to delete branches, so he will manually handle administrative requests to delete branches.