Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15424783
D18925.id45420.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D18925.id45420.diff
View Options
diff --git a/src/applications/calendar/herald/PhabricatorCalendarEventHeraldAdapter.php b/src/applications/calendar/herald/PhabricatorCalendarEventHeraldAdapter.php
--- a/src/applications/calendar/herald/PhabricatorCalendarEventHeraldAdapter.php
+++ b/src/applications/calendar/herald/PhabricatorCalendarEventHeraldAdapter.php
@@ -49,13 +49,6 @@
}
}
- public function getRepetitionOptions() {
- return array(
- HeraldRepetitionPolicyConfig::EVERY,
- HeraldRepetitionPolicyConfig::FIRST,
- );
- }
-
public function getHeraldName() {
return $this->getObject()->getMonogram();
}
diff --git a/src/applications/differential/herald/HeraldDifferentialDiffAdapter.php b/src/applications/differential/herald/HeraldDifferentialDiffAdapter.php
--- a/src/applications/differential/herald/HeraldDifferentialDiffAdapter.php
+++ b/src/applications/differential/herald/HeraldDifferentialDiffAdapter.php
@@ -53,12 +53,6 @@
}
}
- public function getRepetitionOptions() {
- return array(
- HeraldRepetitionPolicyConfig::FIRST,
- );
- }
-
public function getHeraldName() {
return pht('New Diff');
}
diff --git a/src/applications/differential/herald/HeraldDifferentialRevisionAdapter.php b/src/applications/differential/herald/HeraldDifferentialRevisionAdapter.php
--- a/src/applications/differential/herald/HeraldDifferentialRevisionAdapter.php
+++ b/src/applications/differential/herald/HeraldDifferentialRevisionAdapter.php
@@ -69,13 +69,6 @@
}
}
- public function getRepetitionOptions() {
- return array(
- HeraldRepetitionPolicyConfig::EVERY,
- HeraldRepetitionPolicyConfig::FIRST,
- );
- }
-
public static function newLegacyAdapter(
DifferentialRevision $revision,
DifferentialDiff $diff) {
diff --git a/src/applications/herald/adapter/HeraldAdapter.php b/src/applications/herald/adapter/HeraldAdapter.php
--- a/src/applications/herald/adapter/HeraldAdapter.php
+++ b/src/applications/herald/adapter/HeraldAdapter.php
@@ -764,9 +764,19 @@
public function getRepetitionOptions() {
- return array(
- HeraldRepetitionPolicyConfig::EVERY,
- );
+ $options = array();
+
+ $options[] = HeraldRepetitionPolicyConfig::EVERY;
+
+ // Some rules, like pre-commit rules, only ever fire once. It doesn't
+ // make sense to use state-based repetition policies like "only the first
+ // time" for these rules.
+
+ if (!$this->isSingleEventAdapter()) {
+ $options[] = HeraldRepetitionPolicyConfig::FIRST;
+ }
+
+ return $options;
}
protected function initializeNewAdapter() {
diff --git a/src/applications/maniphest/herald/HeraldManiphestTaskAdapter.php b/src/applications/maniphest/herald/HeraldManiphestTaskAdapter.php
--- a/src/applications/maniphest/herald/HeraldManiphestTaskAdapter.php
+++ b/src/applications/maniphest/herald/HeraldManiphestTaskAdapter.php
@@ -33,13 +33,6 @@
return true;
}
- public function getRepetitionOptions() {
- return array(
- HeraldRepetitionPolicyConfig::EVERY,
- HeraldRepetitionPolicyConfig::FIRST,
- );
- }
-
public function supportsRuleType($rule_type) {
switch ($rule_type) {
case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL:
diff --git a/src/applications/metamta/herald/PhabricatorMailOutboundMailHeraldAdapter.php b/src/applications/metamta/herald/PhabricatorMailOutboundMailHeraldAdapter.php
--- a/src/applications/metamta/herald/PhabricatorMailOutboundMailHeraldAdapter.php
+++ b/src/applications/metamta/herald/PhabricatorMailOutboundMailHeraldAdapter.php
@@ -49,12 +49,6 @@
return true;
}
- public function getRepetitionOptions() {
- return array(
- HeraldRepetitionPolicyConfig::FIRST,
- );
- }
-
public function supportsRuleType($rule_type) {
switch ($rule_type) {
case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL:
diff --git a/src/applications/phame/herald/HeraldPhameBlogAdapter.php b/src/applications/phame/herald/HeraldPhameBlogAdapter.php
--- a/src/applications/phame/herald/HeraldPhameBlogAdapter.php
+++ b/src/applications/phame/herald/HeraldPhameBlogAdapter.php
@@ -24,13 +24,6 @@
return true;
}
- public function getRepetitionOptions() {
- return array(
- HeraldRepetitionPolicyConfig::EVERY,
- HeraldRepetitionPolicyConfig::FIRST,
- );
- }
-
public function supportsRuleType($rule_type) {
switch ($rule_type) {
case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL:
diff --git a/src/applications/phame/herald/HeraldPhamePostAdapter.php b/src/applications/phame/herald/HeraldPhamePostAdapter.php
--- a/src/applications/phame/herald/HeraldPhamePostAdapter.php
+++ b/src/applications/phame/herald/HeraldPhamePostAdapter.php
@@ -24,13 +24,6 @@
return true;
}
- public function getRepetitionOptions() {
- return array(
- HeraldRepetitionPolicyConfig::EVERY,
- HeraldRepetitionPolicyConfig::FIRST,
- );
- }
-
public function supportsRuleType($rule_type) {
switch ($rule_type) {
case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL:
diff --git a/src/applications/ponder/herald/HeraldPonderQuestionAdapter.php b/src/applications/ponder/herald/HeraldPonderQuestionAdapter.php
--- a/src/applications/ponder/herald/HeraldPonderQuestionAdapter.php
+++ b/src/applications/ponder/herald/HeraldPonderQuestionAdapter.php
@@ -39,13 +39,6 @@
return true;
}
- public function getRepetitionOptions() {
- return array(
- HeraldRepetitionPolicyConfig::EVERY,
- HeraldRepetitionPolicyConfig::FIRST,
- );
- }
-
public function supportsRuleType($rule_type) {
switch ($rule_type) {
case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL:
diff --git a/src/applications/project/herald/PhabricatorProjectHeraldAdapter.php b/src/applications/project/herald/PhabricatorProjectHeraldAdapter.php
--- a/src/applications/project/herald/PhabricatorProjectHeraldAdapter.php
+++ b/src/applications/project/herald/PhabricatorProjectHeraldAdapter.php
@@ -24,13 +24,6 @@
return true;
}
- public function getRepetitionOptions() {
- return array(
- HeraldRepetitionPolicyConfig::EVERY,
- HeraldRepetitionPolicyConfig::FIRST,
- );
- }
-
public function supportsRuleType($rule_type) {
switch ($rule_type) {
case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 24, 12:19 AM (4 d, 23 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7543971
Default Alt Text
D18925.id45420.diff (6 KB)
Attached To
Mode
D18925: Define available Herald rule repetition options in terms of "isSingleEventAdapter()"
Attached
Detach File
Event Timeline
Log In to Comment