mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 13:30:55 +01:00
Record which user accepted on behalf of packages/owners reviewers
Summary: Ref T12271. Don't do anything with this yet, but store who accepted/rejected/whatever on behalf of reviewers. In the future, we could use this to render stuff like "Blessed Committers (accepted by epriestley)" or whatever. I don't know that this is necessarily super useful, but it's easy to track, seems likely to be useful, and would be a gigantic pain to backfill later if we decide we want it. Test Plan: Accepted/rejected a revision, saw reviewers update appropriately. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12271 Differential Revision: https://secure.phabricator.com/D17537
This commit is contained in:
parent
fab37aa4e3
commit
aa91dc992e
3 changed files with 9 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
ALTER TABLE {$NAMESPACE}_differential.differential_reviewer
|
||||||
|
ADD lastActorPHID VARBINARY(64);
|
|
@ -8,6 +8,7 @@ final class DifferentialReviewer
|
||||||
protected $reviewerStatus;
|
protected $reviewerStatus;
|
||||||
protected $lastActionDiffPHID;
|
protected $lastActionDiffPHID;
|
||||||
protected $lastCommentDiffPHID;
|
protected $lastCommentDiffPHID;
|
||||||
|
protected $lastActorPHID;
|
||||||
|
|
||||||
private $authority = array();
|
private $authority = array();
|
||||||
|
|
||||||
|
@ -17,6 +18,7 @@ final class DifferentialReviewer
|
||||||
'reviewerStatus' => 'text64',
|
'reviewerStatus' => 'text64',
|
||||||
'lastActionDiffPHID' => 'phid?',
|
'lastActionDiffPHID' => 'phid?',
|
||||||
'lastCommentDiffPHID' => 'phid?',
|
'lastCommentDiffPHID' => 'phid?',
|
||||||
|
'lastActorPHID' => 'phid?',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'key_revision' => array(
|
'key_revision' => array(
|
||||||
|
|
|
@ -198,12 +198,17 @@ abstract class DifferentialRevisionReviewTransaction
|
||||||
->setReviewerPHID($dst_phid);
|
->setReviewerPHID($dst_phid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$old_status = $reviewer->getReviewerStatus();
|
||||||
$reviewer->setReviewerStatus($status);
|
$reviewer->setReviewerStatus($status);
|
||||||
|
|
||||||
if ($diff_phid) {
|
if ($diff_phid) {
|
||||||
$reviewer->setLastActionDiffPHID($diff_phid);
|
$reviewer->setLastActionDiffPHID($diff_phid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($old_status !== $status) {
|
||||||
|
$reviewer->setLastActorPHID($this->getActingAsPHID());
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$reviewer->save();
|
$reviewer->save();
|
||||||
} catch (AphrontDuplicateKeyQueryException $ex) {
|
} catch (AphrontDuplicateKeyQueryException $ex) {
|
||||||
|
|
Loading…
Reference in a new issue