1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-30 01:10:58 +01:00

Herald - add ability to conditionalize on Maniphest Task projects

Summary: adds FIELD_PROJECTS and deploys it to Maniphest Task Herald Adapter. Went with "projects" because it feels like that could go well in other Adapters that want to conditionalize based on project.

Test Plan: made a new herald rule to be cc'd if project foo was on a task. it worked!

Reviewers: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7564
This commit is contained in:
Bob Trahan 2013-11-11 14:19:12 -08:00
parent a4e8fd2289
commit f35ce505a1
2 changed files with 7 additions and 0 deletions

View file

@ -24,6 +24,7 @@ abstract class HeraldAdapter {
const FIELD_CONTENT_SOURCE = 'contentsource';
const FIELD_ALWAYS = 'always';
const FIELD_AUTHOR_PROJECTS = 'authorprojects';
const FIELD_PROJECTS = 'projects';
const CONDITION_CONTAINS = 'contains';
const CONDITION_NOT_CONTAINS = '!contains';
@ -154,6 +155,7 @@ abstract class HeraldAdapter {
self::FIELD_CONTENT_SOURCE => pht('Content Source'),
self::FIELD_ALWAYS => pht('Always'),
self::FIELD_AUTHOR_PROJECTS => pht("Author's projects"),
self::FIELD_PROJECTS => pht("Projects"),
);
}
@ -207,6 +209,7 @@ abstract class HeraldAdapter {
case self::FIELD_REVIEWERS:
case self::FIELD_CC:
case self::FIELD_AUTHOR_PROJECTS:
case self::FIELD_PROJECTS:
return array(
self::CONDITION_INCLUDE_ALL,
self::CONDITION_INCLUDE_ANY,
@ -600,6 +603,7 @@ abstract class HeraldAdapter {
case self::FIELD_AFFECTED_PACKAGE:
return self::VALUE_OWNERS_PACKAGE;
case self::FIELD_AUTHOR_PROJECTS:
case self::FIELD_PROJECTS:
return self::VALUE_PROJECT;
case self::FIELD_REVIEWERS:
return self::VALUE_USER_OR_PROJECT;

View file

@ -62,6 +62,7 @@ final class HeraldManiphestTaskAdapter extends HeraldAdapter {
self::FIELD_AUTHOR,
self::FIELD_CC,
self::FIELD_CONTENT_SOURCE,
self::FIELD_PROJECTS,
),
parent::getFields());
}
@ -103,6 +104,8 @@ final class HeraldManiphestTaskAdapter extends HeraldAdapter {
return $this->getTask()->getAuthorPHID();
case self::FIELD_CC:
return $this->getTask()->getCCPHIDs();
case self::FIELD_PROJECTS:
return $this->getTask()->getProjectPHIDs();
}
return parent::getHeraldField($field);