Homec4science

Move determination of reviewer authority into DifferentialRevisionQuery

Authored by epriestley <git@epriestley.com> on Oct 7 2013, 02:08.

Description

Move determination of reviewer authority into DifferentialRevisionQuery

Summary:
Ref T1279. We currently determine reviewers at display time, but this is bad for several reasons:

  • It puts queries very close to the display layer.
  • We have to query for each revision if we want to figure out authority for several.
  • We need to figure it out in several places, so we'll end up with copies of this logic.
  • The logic isn't trivial (exceptions for the viewer, exceptions to that rule for install configuration).
  • We already do this "figure it out when we need it" stuff in Diffusion for audits and it's really bad: we have half-working copies of the logic spread all over the place.

Instead, put it in the Query. Callers query for it and get the data attached to the reviewer objects.

Test Plan:

  • Looked at some revisions, verified the correct lines were highlighted.
    • Looked at a revision I created and verified that projects I was a member of were not highlighted.
      • With self-accept enabled, these are highlighted.
    • Looked at a revision I did not create and verified that projects I was a member of were highlighted.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1279

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

Details

Committed
epriestley <git@epriestley.com>Oct 7 2013, 02:08
Pushed
aubortJan 31 2017, 17:16
Parents
rPH515f9a36ab7a: When editing objects which use files, attach the files to the objects
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH3d3d3b6d8005: Move determination of reviewer authority into DifferentialRevisionQuery (authored by epriestley <git@epriestley.com>).Oct 7 2013, 02:08