Homec4science

Never raise policy exceptions for the omnipotent viewer

Authored by epriestley <git@epriestley.com> on Nov 19 2013, 23:10.

Description

Never raise policy exceptions for the omnipotent viewer

Summary:
Fixes T4109. If a revision has a bad repositoryPHID (for example, because the repository was deleted), DifferentialRevisionQuery calls didRejectResult() on it, which raises a policy exception, even if the viewer is omnipotent. This aborts the MessageParser, because it does not expect policy exceptions to be raised for an omnipotent viewer.

Fix this in two ways:

  1. Never raise a policy exception for an omnipotent viewer. I think this is the expected behavior and a reasonable rule.
  2. In this case, load the revision for an omnipotent viewer.

This feels a little gross, but it's the only place where we do this in the codebase right now. We can clean this up later on once it's more clear what the circumstances of checks like these are.

Test Plan: Set a revision to have an invalid repositoryPHID, ran message parser on it, got a clean parse.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4109

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

Details

Committed
epriestley <git@epriestley.com>Nov 19 2013, 23:10
Pushed
aubortJan 31 2017, 17:16
Parents
rPH200b51df5d9a: Set a default paste header
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHc207964036ce: Never raise policy exceptions for the omnipotent viewer (authored by epriestley <git@epriestley.com>).Nov 19 2013, 23:10