← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/db-git-permissions into lp:launchpad/db-devel

 

The proposal to merge lp:~cjwatson/launchpad/db-git-permissions into lp:launchpad/db-devel has been updated.

Description changed to:

Initial schema changes for fine-grained Git permissions.  See https://docs.google.com/document/d/1JW_D_Tgo4X2-vPMZtShSbi3cm1iOsGcNIzeOpa5E_wA for the design and https://code.launchpad.net/~cjwatson/launchpad/git-permissions-model/+merge/354201 for the initial code model.

The GitRepository.rule_order array column isn't perfect, because PostgreSQL doesn't support arrays of foreign keys and so we lose some referential integrity.  However, all the other options I can think of have worse downsides:

 * GitRule.position integer (rearranging rules requires writing to potentially many rows)
 * GitRule.position rational so that you can always insert a rule between two others (I've seen this seriously suggested on the internet as a solution to this class of problem, but good grief it seems unreasonably complex)
 * Store all rules and grants in a single JSON column on GitRepository (would become very wide and would require custom and probably slow person merging code)

I therefore propose that we live with reduced referential integrity and enforce this constraint in the application instead.  It's not great, but I think it's tolerable.

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/db-git-permissions/+merge/354200
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/db-git-permissions into lp:launchpad/db-devel.


References