1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-20 02:38:39 +01:00

[herald] Add support for Arcanist Project as a field for Differential revisions

Summary: Useful in cases where there is an Arcanist Project but not a repository tracked by Phabricator for a particular revision.

Test Plan: Created a new rule to flag Differential revisions with a particular Arcanist project, verified that it applied as expected via the test console to revisions with the project specified and with a different project specified.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: aran, epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D8463
This commit is contained in:
Neal Poole 2014-03-11 13:15:01 -07:00 committed by epriestley
parent 8b6c86e27d
commit 8818252f52
6 changed files with 27 additions and 16 deletions

View file

@ -380,7 +380,7 @@ return array(
'rsrc/js/application/files/behavior-icon-composer.js' => '8ef9ab58',
'rsrc/js/application/files/behavior-launch-icon-composer.js' => '48086888',
'rsrc/js/application/harbormaster/behavior-reorder-steps.js' => '957a7fde',
'rsrc/js/application/herald/HeraldRuleEditor.js' => '4f31d692',
'rsrc/js/application/herald/HeraldRuleEditor.js' => '4173dbd8',
'rsrc/js/application/herald/PathTypeahead.js' => 'f7fc67ec',
'rsrc/js/application/herald/herald-rule-editor.js' => '7ebaeed3',
'rsrc/js/application/maniphest/behavior-batch-editor.js' => '391457d7',
@ -523,7 +523,7 @@ return array(
'font-source-sans-pro' => '225851dd',
'global-drag-and-drop-css' => '697324ad',
'herald-css' => '59d48f01',
'herald-rule-editor' => '4f31d692',
'herald-rule-editor' => '4173dbd8',
'herald-test-css' => '2b7d0f54',
'inline-comment-summary-css' => '14a91639',
'javelin-aphlict' => '493665ee',
@ -1088,6 +1088,19 @@ return array(
0 => 'javelin-install',
1 => 'javelin-event',
),
'4173dbd8' =>
array(
0 => 'multirow-row-manager',
1 => 'javelin-install',
2 => 'javelin-typeahead',
3 => 'javelin-util',
4 => 'javelin-dom',
5 => 'javelin-tokenizer',
6 => 'javelin-typeahead-preloaded-source',
7 => 'javelin-stratcom',
8 => 'javelin-json',
9 => 'phabricator-prefab',
),
'441f2137' =>
array(
0 => 'javelin-behavior',
@ -1121,19 +1134,6 @@ return array(
1 => 'javelin-dom',
2 => 'javelin-reactor-dom',
),
'4f31d692' =>
array(
0 => 'multirow-row-manager',
1 => 'javelin-install',
2 => 'javelin-typeahead',
3 => 'javelin-util',
4 => 'javelin-dom',
5 => 'javelin-tokenizer',
6 => 'javelin-typeahead-preloaded-source',
7 => 'javelin-stratcom',
8 => 'javelin-json',
9 => 'phabricator-prefab',
),
'4f344388' =>
array(
0 => 'javelin-install',

View file

@ -40,6 +40,7 @@ abstract class HeraldAdapter {
const FIELD_COMMITTER_RAW = 'committer-raw';
const FIELD_IS_NEW_OBJECT = 'new-object';
const FIELD_TASK_PRIORITY = 'taskpriority';
const FIELD_ARCANIST_PROJECT = 'arcanist-project';
const CONDITION_CONTAINS = 'contains';
const CONDITION_NOT_CONTAINS = '!contains';
@ -91,6 +92,7 @@ abstract class HeraldAdapter {
const VALUE_USER_OR_PROJECT = 'userorproject';
const VALUE_BUILD_PLAN = 'buildplan';
const VALUE_TASK_PRIORITY = 'taskpriority';
const VALUE_ARCANIST_PROJECT = 'arcanistprojects';
private $contentSource;
private $isNewObject;
@ -237,6 +239,7 @@ abstract class HeraldAdapter {
self::FIELD_COMMITTER_RAW => pht('Raw committer name'),
self::FIELD_IS_NEW_OBJECT => pht('Is newly created?'),
self::FIELD_TASK_PRIORITY => pht('Task priority'),
self::FIELD_ARCANIST_PROJECT => pht('Arcanist Project'),
);
}
@ -289,6 +292,7 @@ abstract class HeraldAdapter {
case self::FIELD_REVIEWER:
case self::FIELD_PUSHER:
case self::FIELD_TASK_PRIORITY:
case self::FIELD_ARCANIST_PROJECT:
return array(
self::CONDITION_IS_ANY,
self::CONDITION_IS_NOT_ANY,
@ -725,6 +729,8 @@ abstract class HeraldAdapter {
return self::VALUE_REPOSITORY;
case self::FIELD_TASK_PRIORITY:
return self::VALUE_TASK_PRIORITY;
case self::FIELD_ARCANIST_PROJECT:
return self::VALUE_ARCANIST_PROJECT;
default:
return self::VALUE_USER;
}

View file

@ -76,6 +76,7 @@ final class HeraldDifferentialRevisionAdapter extends HeraldAdapter {
self::FIELD_AFFECTED_PACKAGE,
self::FIELD_AFFECTED_PACKAGE_OWNER,
self::FIELD_IS_NEW_OBJECT,
self::FIELD_ARCANIST_PROJECT,
),
parent::getFields());
}
@ -373,6 +374,8 @@ final class HeraldDifferentialRevisionAdapter extends HeraldAdapter {
$packages = $this->loadAffectedPackages();
return PhabricatorOwnersOwner::loadAffiliatedUserPHIDs(
mpull($packages, 'getID'));
case self::FIELD_ARCANIST_PROJECT:
return $this->revision->getArcanistProjectPHID();
}
return parent::getHeraldField($field);

View file

@ -593,6 +593,7 @@ final class HeraldRuleController extends HeraldController {
'userorproject' => '/typeahead/common/accountsorprojects/',
'buildplan' => '/typeahead/common/buildplans/',
'taskpriority' => '/typeahead/common/taskpriority/',
'arcanistprojects' => '/typeahead/common/arcanistprojects/',
),
'markup' => $template,
);

View file

@ -17,7 +17,7 @@ final class HeraldRule extends HeraldDAO
protected $isDisabled = 0;
protected $triggerObjectPHID;
protected $configVersion = 31;
protected $configVersion = 32;
// phids for which this rule has been applied
private $ruleApplied = self::ATTACHABLE;

View file

@ -223,6 +223,7 @@ JX.install('HeraldRuleEditor', {
case 'userorproject':
case 'buildplan':
case 'taskpriority':
case 'arcanistprojects':
var tokenizer = this._newTokenizer(type);
input = tokenizer[0];
get_fn = tokenizer[1];