1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 01:32:42 +01:00
phorge-phorge/src/applications/project/storage
epriestley 26ba4e8717 Materialize parent project memberships
Summary:
Ref T10010. Subprojects have the following general membership rule: if you are a member of a subproject ("Engineering > Backend"), you are also a member of the parent project.

It would be unreasonably difficult to implement this rule directly in SQL when querying `withMemberPHIDs()`, because we'd have to do an arbitrarily large number of arbitrarily deep joins, or fetch and then requery a lot of data.

Instead, introduce "materailized members", which are just a copy of all the effective members of a project. When a subproject has a membership change, we go recompute the effective membership of all the parent projects. Then we can just JOIN to satisfy `withMemberPHIDs()`.

Having this process avialable will also be useful in the future, when a project's membership might be defined by some external source.

Also make milestones mostly work like we'd expect them to with respect to membership and visibility.

Test Plan:
  - Added and executed unit tests.
  - Changed project members, verified materialized members populated correctly in the database.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10010

Differential Revision: https://secure.phabricator.com/D14863
2015-12-23 14:39:09 -08:00
..
PhabricatorProject.php Implement child/descendant query rules in Projects 2015-12-23 14:38:51 -08:00
PhabricatorProjectColumn.php [Redesign] Remove PHUIActionHeaderView 2015-05-18 10:00:15 -07:00
PhabricatorProjectColumnPosition.php Fix visiblity of LiskDAO::getConfiguration() 2015-01-14 06:54:13 +11:00
PhabricatorProjectColumnTransaction.php Use __CLASS__ instead of hard-coding class names 2015-05-14 07:21:13 +10:00
PhabricatorProjectCustomFieldNumericIndex.php Various linter fixes. 2014-02-26 12:44:58 -08:00
PhabricatorProjectCustomFieldStorage.php Various linter fixes. 2014-02-26 12:44:58 -08:00
PhabricatorProjectCustomFieldStringIndex.php Various linter fixes. 2014-02-26 12:44:58 -08:00
PhabricatorProjectDAO.php Delete license headers from files 2012-11-05 11:16:51 -08:00
PhabricatorProjectSchemaSpec.php Automatically build all Lisk schemata 2014-10-02 09:51:20 -07:00
PhabricatorProjectSlug.php Fix visiblity of LiskDAO::getConfiguration() 2015-01-14 06:54:13 +11:00
PhabricatorProjectTransaction.php Materialize parent project memberships 2015-12-23 14:39:09 -08:00