mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-03 12:12:43 +01:00
ead5f4fd9c
Summary: See PHI262. Fixes T12578. Although this is a bit niche and probably better accomplished through advisory/soft measures ("Add blocking reviewers") in most cases, it isn't difficult to implement and doesn't create any technical or product tension. If installs write a rule that blocks commits, that will probably also naturally lead them to an "add reviewers" rule anyway. Also, allow packages to be hit with the typeahead. They're valid reviewers but previously you couldn't write rules against them, for no actual reason. Test Plan: Used test console to run this against commits, got sensible results for the field value. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T12578 Differential Revision: https://secure.phabricator.com/D18839
34 lines
749 B
PHP
34 lines
749 B
PHP
<?php
|
|
|
|
final class DiffusionCommitRevisionReviewersHeraldField
|
|
extends DiffusionCommitHeraldField {
|
|
|
|
const FIELDCONST = 'diffusion.commit.revision.reviewers';
|
|
|
|
public function getHeraldFieldName() {
|
|
return pht('Differential reviewers');
|
|
}
|
|
|
|
public function getFieldGroupKey() {
|
|
return HeraldRelatedFieldGroup::FIELDGROUPKEY;
|
|
}
|
|
|
|
public function getHeraldFieldValue($object) {
|
|
$revision = $this->getAdapter()->loadDifferentialRevision();
|
|
|
|
if (!$revision) {
|
|
return array();
|
|
}
|
|
|
|
return $revision->getReviewerPHIDs();
|
|
}
|
|
|
|
protected function getHeraldFieldStandardType() {
|
|
return self::STANDARD_PHID_LIST;
|
|
}
|
|
|
|
protected function getDatasource() {
|
|
return new DifferentialReviewerDatasource();
|
|
}
|
|
|
|
}
|