Update PhabricatorRepositoryManagementLookupUsersWorkflow to use ConduitCall
Summary: Ref T2783. This updates PhabricatorRepositoryManagementLookupUsersWorkflow to use ConduitCall to retrieve information about the commit. Test Plan: Ran `bin/repository lookup-users rTESTe9683b64d3283f0b2d355fdbf231bc918b5ac0ab --trace` and saw the information returned (by making a request to `diffusion.querycommits` as the omnipotent user, signed with the device key). Mucked with `cluster.addresses` and saw requests rejected. Reviewers: hach-que, btrahan Reviewed By: btrahan Subscribers: Krenair, epriestley, Korvin Maniphest Tasks: T2783 Differential Revision: https://secure.phabricator.com/D10403
This commit is contained in:
@@ -9,6 +9,26 @@ final class DiffusionCommitRef extends Phobject {
|
||||
private $committerEmail;
|
||||
private $hashes = array();
|
||||
|
||||
public static function newFromConduitResult(array $result) {
|
||||
$ref = id(new DiffusionCommitRef())
|
||||
->setCommitterEmail(idx($result, 'committerEmail'))
|
||||
->setCommitterName(idx($result, 'committerName'))
|
||||
->setAuthorEmail(idx($result, 'authorEmail'))
|
||||
->setAuthorName(idx($result, 'authorName'))
|
||||
->setMessage(idx($result, 'message'));
|
||||
|
||||
$hashes = array();
|
||||
foreach (idx($result, 'hashes', array()) as $hash_result) {
|
||||
$hashes[] = id(new DiffusionCommitHash())
|
||||
->setHashType(idx($hash_result, 'type'))
|
||||
->setHashValue(idx($hash_result, 'value'));
|
||||
}
|
||||
|
||||
$ref->setHashes($hashes);
|
||||
|
||||
return $ref;
|
||||
}
|
||||
|
||||
public function setHashes(array $hashes) {
|
||||
$this->hashes = $hashes;
|
||||
return $this;
|
||||
|
||||
Reference in New Issue
Block a user