Homec4science

Read materialized project members instead of real members

Authored by epriestley <git@epriestley.com> on Dec 27 2015, 13:27.

Description

Read materialized project members instead of real members

Summary:
Ref T10010. This will allow us to find superprojects with withMemberPHIDs(...) queries.

  • Copy all the current real member edges to materialized member edges.
  • Redirect all reads to look at materialized members.
  • This table is already kept in sync by earlier work with indexing.

Basically, flow is:

  • Writes (joining, leaving, adding/removing members) write to the real member edge type.
  • After a project's members change, they're copied to the materialized member edge type for that project and all of its superprojects.
  • Reads look at materialized members, so "Parent" sees the members of "Child" and "Grandchild" as its own members, but we still have the "real members" edge type to keep track of "natural" or "direct" members.

Test Plan:

  • Ran migration.
  • Ran unit tests.
  • Saw the same projects as projects I was a member of.
  • Added some var_dump() stuff to verify the Owners changed.
  • Used grep to look for other readers of this edge type.
  • Made some project updates.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10010

Differential Revision: https://secure.phabricator.com/D14893

Details

Committed
epriestley <git@epriestley.com>Dec 27 2015, 18:26
Pushed
aubortJan 31 2017, 17:16
Parents
rPH77897ce86258: Clean up ProjectQuery when viewer is logged-out or omnipotent
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH373ff7f9d465: Read materialized project members instead of real members (authored by epriestley <git@epriestley.com>).Dec 27 2015, 18:26