mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-10 23:01:04 +01:00
Use the configured viewer more consistently in the Herald commit adapter
Summary: See PHI276. Ref T13048. The fix in D18933 got one callsite, but missed the one in the `callConduit()` method, so the issue isn't fully fixed in production. Convert this adapter to use a real viewer (if one is available) more thoroughly. Test Plan: Ran rules in test console, saw field values. Will test in production again. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13048 Differential Revision: https://secure.phabricator.com/D18950
This commit is contained in:
parent
98402b885b
commit
d8f51dff6e
1 changed files with 9 additions and 3 deletions
|
@ -135,13 +135,16 @@ final class HeraldCommitAdapter
|
|||
}
|
||||
|
||||
public function loadAffectedPaths() {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
if ($this->affectedPaths === null) {
|
||||
$result = PhabricatorOwnerPathQuery::loadAffectedPaths(
|
||||
$this->getRepository(),
|
||||
$this->commit,
|
||||
PhabricatorUser::getOmnipotentUser());
|
||||
$viewer);
|
||||
$this->affectedPaths = $result;
|
||||
}
|
||||
|
||||
return $this->affectedPaths;
|
||||
}
|
||||
|
||||
|
@ -172,6 +175,8 @@ final class HeraldCommitAdapter
|
|||
}
|
||||
|
||||
public function loadDifferentialRevision() {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
if ($this->affectedRevision === null) {
|
||||
$this->affectedRevision = false;
|
||||
|
||||
|
@ -189,7 +194,7 @@ final class HeraldCommitAdapter
|
|||
|
||||
$revision = id(new DifferentialRevisionQuery())
|
||||
->withIDs(array($revision_id))
|
||||
->setViewer(PhabricatorUser::getOmnipotentUser())
|
||||
->setViewer($viewer)
|
||||
->needReviewers(true)
|
||||
->executeOne();
|
||||
if ($revision) {
|
||||
|
@ -197,6 +202,7 @@ final class HeraldCommitAdapter
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->affectedRevision;
|
||||
}
|
||||
|
||||
|
@ -323,7 +329,7 @@ final class HeraldCommitAdapter
|
|||
}
|
||||
|
||||
private function callConduit($method, array $params) {
|
||||
$viewer = PhabricatorUser::getOmnipotentUser();
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$drequest = DiffusionRequest::newFromDictionary(
|
||||
array(
|
||||
|
|
Loading…
Reference in a new issue