mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
add committer as supported field for herald rules
Summary: Allows building Herald rules against committer, similar to author. Useful for monitoring cherry-picked commits. Test Plan: Applied patch, restarted php-fpm and phd daemons to ensure code changes took effect. Added a new herald rule to trigger audit when committer was me. Cherry-picked someone else's commit (author=them, committer=me) and pushed to origin. Audit was triggered. Reviewers: epriestley Reviewed By: epriestley CC: Korvin, aran Differential Revision: https://secure.phabricator.com/D6838
This commit is contained in:
parent
d06129b81e
commit
9a95b1e7d1
2 changed files with 6 additions and 0 deletions
|
@ -10,6 +10,7 @@ abstract class HeraldAdapter {
|
|||
const FIELD_AUTHOR = 'author';
|
||||
const FIELD_REVIEWER = 'reviewer';
|
||||
const FIELD_REVIEWERS = 'reviewers';
|
||||
const FIELD_COMMITTER = 'committer';
|
||||
const FIELD_CC = 'cc';
|
||||
const FIELD_TAGS = 'tags';
|
||||
const FIELD_DIFF_FILE = 'diff-file';
|
||||
|
@ -95,6 +96,7 @@ abstract class HeraldAdapter {
|
|||
self::FIELD_TITLE => pht('Title'),
|
||||
self::FIELD_BODY => pht('Body'),
|
||||
self::FIELD_AUTHOR => pht('Author'),
|
||||
self::FIELD_COMMITTER => pht('Committer'),
|
||||
self::FIELD_REVIEWER => pht('Reviewer'),
|
||||
self::FIELD_REVIEWERS => pht('Reviewers'),
|
||||
self::FIELD_CC => pht('CCs'),
|
||||
|
@ -147,6 +149,7 @@ abstract class HeraldAdapter {
|
|||
self::CONDITION_REGEXP,
|
||||
);
|
||||
case self::FIELD_AUTHOR:
|
||||
case self::FIELD_COMMITTER:
|
||||
case self::FIELD_REPOSITORY:
|
||||
case self::FIELD_REVIEWER:
|
||||
return array(
|
||||
|
|
|
@ -52,6 +52,7 @@ final class HeraldCommitAdapter extends HeraldAdapter {
|
|||
return array(
|
||||
self::FIELD_BODY,
|
||||
self::FIELD_AUTHOR,
|
||||
self::FIELD_COMMITTER,
|
||||
self::FIELD_REVIEWER,
|
||||
self::FIELD_REPOSITORY,
|
||||
self::FIELD_DIFF_FILE,
|
||||
|
@ -241,6 +242,8 @@ final class HeraldCommitAdapter extends HeraldAdapter {
|
|||
return $data->getCommitMessage();
|
||||
case self::FIELD_AUTHOR:
|
||||
return $data->getCommitDetail('authorPHID');
|
||||
case self::FIELD_COMMITTER:
|
||||
return $data->getCommitDetail('committerPHID');
|
||||
case self::FIELD_REVIEWER:
|
||||
return $data->getCommitDetail('reviewerPHID');
|
||||
case self::FIELD_DIFF_FILE:
|
||||
|
|
Loading…
Reference in a new issue