@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Modularize all Diffusion commit Herald fields

Summary: Ref T8726.

Test Plan:
Created a giant rule with every commit field:

{F594686}

Ran the upgrade, got the same rule with new fields:

{F594688}

Used "Test Console" to run transcripts, saw all the fields populate correctly.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T8726

Differential Revision: https://secure.phabricator.com/D13567

+819 -162
+133
resources/sql/autopatches/20150706.herald.1.sql
··· 1 + UPDATE {$NAMESPACE}_herald.herald_condition 2 + SET fieldName = 'diffusion.commit.autoclose' 3 + WHERE fieldName = 'repository-autoclose-branch'; 4 + 5 + UPDATE {$NAMESPACE}_herald.herald_condition 6 + SET fieldName = 'diffusion.commit.package.audit' 7 + WHERE fieldName = 'need-audit-for-package'; 8 + 9 + UPDATE {$NAMESPACE}_herald.herald_condition c 10 + JOIN {$NAMESPACE}_herald.herald_rule r 11 + ON c.ruleID = r.id 12 + SET c.fieldName = 'diffusion.commit.affected' 13 + WHERE r.contentType = 'commit' 14 + AND c.fieldName = 'diff-file'; 15 + 16 + UPDATE {$NAMESPACE}_herald.herald_condition c 17 + JOIN {$NAMESPACE}_herald.herald_rule r 18 + ON c.ruleID = r.id 19 + SET c.fieldName = 'diffusion.commit.author' 20 + WHERE r.contentType = 'commit' 21 + AND c.fieldName = 'author'; 22 + 23 + UPDATE {$NAMESPACE}_herald.herald_condition c 24 + JOIN {$NAMESPACE}_herald.herald_rule r 25 + ON c.ruleID = r.id 26 + SET c.fieldName = 'diffusion.commit.branches' 27 + WHERE r.contentType = 'commit' 28 + AND c.fieldName = 'branches'; 29 + 30 + UPDATE {$NAMESPACE}_herald.herald_condition c 31 + JOIN {$NAMESPACE}_herald.herald_rule r 32 + ON c.ruleID = r.id 33 + SET c.fieldName = 'diffusion.commit.committer' 34 + WHERE r.contentType = 'commit' 35 + AND c.fieldName = 'committer'; 36 + 37 + UPDATE {$NAMESPACE}_herald.herald_condition c 38 + JOIN {$NAMESPACE}_herald.herald_rule r 39 + ON c.ruleID = r.id 40 + SET c.fieldName = 'diffusion.commit.diff.new' 41 + WHERE r.contentType = 'commit' 42 + AND c.fieldName = 'diff-added-content'; 43 + 44 + UPDATE {$NAMESPACE}_herald.herald_condition c 45 + JOIN {$NAMESPACE}_herald.herald_rule r 46 + ON c.ruleID = r.id 47 + SET c.fieldName = 'diffusion.commit.diff' 48 + WHERE r.contentType = 'commit' 49 + AND c.fieldName = 'diff-content'; 50 + 51 + UPDATE {$NAMESPACE}_herald.herald_condition c 52 + JOIN {$NAMESPACE}_herald.herald_rule r 53 + ON c.ruleID = r.id 54 + SET c.fieldName = 'diffusion.commit.diff.old' 55 + WHERE r.contentType = 'commit' 56 + AND c.fieldName = 'diff-removed-content'; 57 + 58 + UPDATE {$NAMESPACE}_herald.herald_condition c 59 + JOIN {$NAMESPACE}_herald.herald_rule r 60 + ON c.ruleID = r.id 61 + SET c.fieldName = 'diffusion.commit.enormous' 62 + WHERE r.contentType = 'commit' 63 + AND c.fieldName = 'diff-enormous'; 64 + 65 + UPDATE {$NAMESPACE}_herald.herald_condition c 66 + JOIN {$NAMESPACE}_herald.herald_rule r 67 + ON c.ruleID = r.id 68 + SET c.fieldName = 'diffusion.commit.message' 69 + WHERE r.contentType = 'commit' 70 + AND c.fieldName = 'body'; 71 + 72 + UPDATE {$NAMESPACE}_herald.herald_condition c 73 + JOIN {$NAMESPACE}_herald.herald_rule r 74 + ON c.ruleID = r.id 75 + SET c.fieldName = 'diffusion.commit.package' 76 + WHERE r.contentType = 'commit' 77 + AND c.fieldName = 'affected-package'; 78 + 79 + UPDATE {$NAMESPACE}_herald.herald_condition c 80 + JOIN {$NAMESPACE}_herald.herald_rule r 81 + ON c.ruleID = r.id 82 + SET c.fieldName = 'diffusion.commit.package.owners' 83 + WHERE r.contentType = 'commit' 84 + AND c.fieldName = 'affected-package-owner'; 85 + 86 + UPDATE {$NAMESPACE}_herald.herald_condition c 87 + JOIN {$NAMESPACE}_herald.herald_rule r 88 + ON c.ruleID = r.id 89 + SET c.fieldName = 'diffusion.commit.repository' 90 + WHERE r.contentType = 'commit' 91 + AND c.fieldName = 'repository'; 92 + 93 + UPDATE {$NAMESPACE}_herald.herald_condition c 94 + JOIN {$NAMESPACE}_herald.herald_rule r 95 + ON c.ruleID = r.id 96 + SET c.fieldName = 'diffusion.commit.repository.projects' 97 + WHERE r.contentType = 'commit' 98 + AND c.fieldName = 'repository-projects'; 99 + 100 + UPDATE {$NAMESPACE}_herald.herald_condition c 101 + JOIN {$NAMESPACE}_herald.herald_rule r 102 + ON c.ruleID = r.id 103 + SET c.fieldName = 'diffusion.commit.reviewer' 104 + WHERE r.contentType = 'commit' 105 + AND c.fieldName = 'reviewer'; 106 + 107 + UPDATE {$NAMESPACE}_herald.herald_condition c 108 + JOIN {$NAMESPACE}_herald.herald_rule r 109 + ON c.ruleID = r.id 110 + SET c.fieldName = 'diffusion.commit.revision.accepted' 111 + WHERE r.contentType = 'commit' 112 + AND c.fieldName = 'differential-accepted'; 113 + 114 + UPDATE {$NAMESPACE}_herald.herald_condition c 115 + JOIN {$NAMESPACE}_herald.herald_rule r 116 + ON c.ruleID = r.id 117 + SET c.fieldName = 'diffusion.commit.revision' 118 + WHERE r.contentType = 'commit' 119 + AND c.fieldName = 'differential-revision'; 120 + 121 + UPDATE {$NAMESPACE}_herald.herald_condition c 122 + JOIN {$NAMESPACE}_herald.herald_rule r 123 + ON c.ruleID = r.id 124 + SET c.fieldName = 'diffusion.commit.revision.subscribers' 125 + WHERE r.contentType = 'commit' 126 + AND c.fieldName = 'differential-ccs'; 127 + 128 + UPDATE {$NAMESPACE}_herald.herald_condition c 129 + JOIN {$NAMESPACE}_herald.herald_rule r 130 + ON c.ruleID = r.id 131 + SET c.fieldName = 'diffusion.commit.revision.reviewers' 132 + WHERE r.contentType = 'commit' 133 + AND c.fieldName = 'differential-reviewers';
+43 -1
src/__phutil_library_map__.php
··· 481 481 'DiffusionBrowseTableView' => 'applications/diffusion/view/DiffusionBrowseTableView.php', 482 482 'DiffusionCachedResolveRefsQuery' => 'applications/diffusion/query/DiffusionCachedResolveRefsQuery.php', 483 483 'DiffusionChangeController' => 'applications/diffusion/controller/DiffusionChangeController.php', 484 + 'DiffusionCommitAffectedFilesHeraldField' => 'applications/diffusion/herald/DiffusionCommitAffectedFilesHeraldField.php', 485 + 'DiffusionCommitAuthorHeraldField' => 'applications/diffusion/herald/DiffusionCommitAuthorHeraldField.php', 486 + 'DiffusionCommitAutocloseHeraldField' => 'applications/diffusion/herald/DiffusionCommitAutocloseHeraldField.php', 484 487 'DiffusionCommitBranchesController' => 'applications/diffusion/controller/DiffusionCommitBranchesController.php', 488 + 'DiffusionCommitBranchesHeraldField' => 'applications/diffusion/herald/DiffusionCommitBranchesHeraldField.php', 485 489 'DiffusionCommitChangeTableView' => 'applications/diffusion/view/DiffusionCommitChangeTableView.php', 490 + 'DiffusionCommitCommitterHeraldField' => 'applications/diffusion/herald/DiffusionCommitCommitterHeraldField.php', 486 491 'DiffusionCommitController' => 'applications/diffusion/controller/DiffusionCommitController.php', 492 + 'DiffusionCommitDiffContentAddedHeraldField' => 'applications/diffusion/herald/DiffusionCommitDiffContentAddedHeraldField.php', 493 + 'DiffusionCommitDiffContentHeraldField' => 'applications/diffusion/herald/DiffusionCommitDiffContentHeraldField.php', 494 + 'DiffusionCommitDiffContentRemovedHeraldField' => 'applications/diffusion/herald/DiffusionCommitDiffContentRemovedHeraldField.php', 495 + 'DiffusionCommitDiffEnormousHeraldField' => 'applications/diffusion/herald/DiffusionCommitDiffEnormousHeraldField.php', 487 496 'DiffusionCommitEditController' => 'applications/diffusion/controller/DiffusionCommitEditController.php', 488 497 'DiffusionCommitHasRevisionEdgeType' => 'applications/diffusion/edge/DiffusionCommitHasRevisionEdgeType.php', 489 498 'DiffusionCommitHasTaskEdgeType' => 'applications/diffusion/edge/DiffusionCommitHasTaskEdgeType.php', 490 499 'DiffusionCommitHash' => 'applications/diffusion/data/DiffusionCommitHash.php', 500 + 'DiffusionCommitHeraldField' => 'applications/diffusion/herald/DiffusionCommitHeraldField.php', 491 501 'DiffusionCommitHookEngine' => 'applications/diffusion/engine/DiffusionCommitHookEngine.php', 492 502 'DiffusionCommitHookRejectException' => 'applications/diffusion/exception/DiffusionCommitHookRejectException.php', 503 + 'DiffusionCommitMessageHeraldField' => 'applications/diffusion/herald/DiffusionCommitMessageHeraldField.php', 504 + 'DiffusionCommitPackageAuditHeraldField' => 'applications/diffusion/herald/DiffusionCommitPackageAuditHeraldField.php', 505 + 'DiffusionCommitPackageHeraldField' => 'applications/diffusion/herald/DiffusionCommitPackageHeraldField.php', 506 + 'DiffusionCommitPackageOwnerHeraldField' => 'applications/diffusion/herald/DiffusionCommitPackageOwnerHeraldField.php', 493 507 'DiffusionCommitParentsQueryConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionCommitParentsQueryConduitAPIMethod.php', 494 508 'DiffusionCommitQuery' => 'applications/diffusion/query/DiffusionCommitQuery.php', 495 509 'DiffusionCommitRef' => 'applications/diffusion/data/DiffusionCommitRef.php', 496 510 'DiffusionCommitRemarkupRule' => 'applications/diffusion/remarkup/DiffusionCommitRemarkupRule.php', 497 511 'DiffusionCommitRemarkupRuleTestCase' => 'applications/diffusion/remarkup/__tests__/DiffusionCommitRemarkupRuleTestCase.php', 512 + 'DiffusionCommitRepositoryHeraldField' => 'applications/diffusion/herald/DiffusionCommitRepositoryHeraldField.php', 513 + 'DiffusionCommitRepositoryProjectsHeraldField' => 'applications/diffusion/herald/DiffusionCommitRepositoryProjectsHeraldField.php', 498 514 'DiffusionCommitRevertedByCommitEdgeType' => 'applications/diffusion/edge/DiffusionCommitRevertedByCommitEdgeType.php', 499 515 'DiffusionCommitRevertsCommitEdgeType' => 'applications/diffusion/edge/DiffusionCommitRevertsCommitEdgeType.php', 516 + 'DiffusionCommitReviewerHeraldField' => 'applications/diffusion/herald/DiffusionCommitReviewerHeraldField.php', 517 + 'DiffusionCommitRevisionAcceptedHeraldField' => 'applications/diffusion/herald/DiffusionCommitRevisionAcceptedHeraldField.php', 518 + 'DiffusionCommitRevisionHeraldField' => 'applications/diffusion/herald/DiffusionCommitRevisionHeraldField.php', 519 + 'DiffusionCommitRevisionReviewersHeraldField' => 'applications/diffusion/herald/DiffusionCommitRevisionReviewersHeraldField.php', 520 + 'DiffusionCommitRevisionSubscribersHeraldField' => 'applications/diffusion/herald/DiffusionCommitRevisionSubscribersHeraldField.php', 500 521 'DiffusionCommitTagsController' => 'applications/diffusion/controller/DiffusionCommitTagsController.php', 501 522 'DiffusionConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionConduitAPIMethod.php', 502 523 'DiffusionController' => 'applications/diffusion/controller/DiffusionController.php', ··· 933 954 'HeraldAlwaysField' => 'applications/herald/field/HeraldAlwaysField.php', 934 955 'HeraldAnotherRuleField' => 'applications/herald/field/HeraldAnotherRuleField.php', 935 956 'HeraldApplyTranscript' => 'applications/herald/storage/transcript/HeraldApplyTranscript.php', 936 - 'HeraldCommitAdapter' => 'applications/herald/adapter/HeraldCommitAdapter.php', 957 + 'HeraldCommitAdapter' => 'applications/diffusion/herald/HeraldCommitAdapter.php', 937 958 'HeraldCondition' => 'applications/herald/storage/HeraldCondition.php', 938 959 'HeraldConditionTranscript' => 'applications/herald/storage/transcript/HeraldConditionTranscript.php', 939 960 'HeraldContentSourceField' => 'applications/herald/field/HeraldContentSourceField.php', ··· 3925 3946 'DiffusionBrowseTableView' => 'DiffusionView', 3926 3947 'DiffusionCachedResolveRefsQuery' => 'DiffusionLowLevelQuery', 3927 3948 'DiffusionChangeController' => 'DiffusionController', 3949 + 'DiffusionCommitAffectedFilesHeraldField' => 'DiffusionCommitHeraldField', 3950 + 'DiffusionCommitAuthorHeraldField' => 'DiffusionCommitHeraldField', 3951 + 'DiffusionCommitAutocloseHeraldField' => 'DiffusionCommitHeraldField', 3928 3952 'DiffusionCommitBranchesController' => 'DiffusionController', 3953 + 'DiffusionCommitBranchesHeraldField' => 'DiffusionCommitHeraldField', 3929 3954 'DiffusionCommitChangeTableView' => 'DiffusionView', 3955 + 'DiffusionCommitCommitterHeraldField' => 'DiffusionCommitHeraldField', 3930 3956 'DiffusionCommitController' => 'DiffusionController', 3957 + 'DiffusionCommitDiffContentAddedHeraldField' => 'DiffusionCommitHeraldField', 3958 + 'DiffusionCommitDiffContentHeraldField' => 'DiffusionCommitHeraldField', 3959 + 'DiffusionCommitDiffContentRemovedHeraldField' => 'DiffusionCommitHeraldField', 3960 + 'DiffusionCommitDiffEnormousHeraldField' => 'DiffusionCommitHeraldField', 3931 3961 'DiffusionCommitEditController' => 'DiffusionController', 3932 3962 'DiffusionCommitHasRevisionEdgeType' => 'PhabricatorEdgeType', 3933 3963 'DiffusionCommitHasTaskEdgeType' => 'PhabricatorEdgeType', 3934 3964 'DiffusionCommitHash' => 'Phobject', 3965 + 'DiffusionCommitHeraldField' => 'HeraldField', 3935 3966 'DiffusionCommitHookEngine' => 'Phobject', 3936 3967 'DiffusionCommitHookRejectException' => 'Exception', 3968 + 'DiffusionCommitMessageHeraldField' => 'DiffusionCommitHeraldField', 3969 + 'DiffusionCommitPackageAuditHeraldField' => 'DiffusionCommitHeraldField', 3970 + 'DiffusionCommitPackageHeraldField' => 'DiffusionCommitHeraldField', 3971 + 'DiffusionCommitPackageOwnerHeraldField' => 'DiffusionCommitHeraldField', 3937 3972 'DiffusionCommitParentsQueryConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod', 3938 3973 'DiffusionCommitQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 3939 3974 'DiffusionCommitRef' => 'Phobject', 3940 3975 'DiffusionCommitRemarkupRule' => 'PhabricatorObjectRemarkupRule', 3941 3976 'DiffusionCommitRemarkupRuleTestCase' => 'PhabricatorTestCase', 3977 + 'DiffusionCommitRepositoryHeraldField' => 'DiffusionCommitHeraldField', 3978 + 'DiffusionCommitRepositoryProjectsHeraldField' => 'DiffusionCommitHeraldField', 3942 3979 'DiffusionCommitRevertedByCommitEdgeType' => 'PhabricatorEdgeType', 3943 3980 'DiffusionCommitRevertsCommitEdgeType' => 'PhabricatorEdgeType', 3981 + 'DiffusionCommitReviewerHeraldField' => 'DiffusionCommitHeraldField', 3982 + 'DiffusionCommitRevisionAcceptedHeraldField' => 'DiffusionCommitHeraldField', 3983 + 'DiffusionCommitRevisionHeraldField' => 'DiffusionCommitHeraldField', 3984 + 'DiffusionCommitRevisionReviewersHeraldField' => 'DiffusionCommitHeraldField', 3985 + 'DiffusionCommitRevisionSubscribersHeraldField' => 'DiffusionCommitHeraldField', 3944 3986 'DiffusionCommitTagsController' => 'DiffusionController', 3945 3987 'DiffusionConduitAPIMethod' => 'ConduitAPIMethod', 3946 3988 'DiffusionController' => 'PhabricatorController',
+24
src/applications/diffusion/herald/DiffusionCommitAffectedFilesHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitAffectedFilesHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.affected'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Affected files'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + return $this->getAdapter()->loadAffectedPaths(); 14 + } 15 + 16 + protected function getHeraldFieldStandardConditions() { 17 + return self::STANDARD_TEXT_LIST; 18 + } 19 + 20 + public function getHeraldFieldValueType($condition) { 21 + return HeraldAdapter::VALUE_TEXT; 22 + } 23 + 24 + }
+30
src/applications/diffusion/herald/DiffusionCommitAuthorHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitAuthorHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.author'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Author'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + return $object->getCommitData()->getCommitDetail('authorPHID'); 14 + } 15 + 16 + protected function getHeraldFieldStandardConditions() { 17 + return self::STANDARD_PHID_NULLABLE; 18 + } 19 + 20 + public function getHeraldFieldValueType($condition) { 21 + switch ($condition) { 22 + case HeraldAdapter::CONDITION_EXISTS: 23 + case HeraldAdapter::CONDITION_NOT_EXISTS: 24 + return HeraldAdapter::VALUE_NONE; 25 + default: 26 + return HeraldAdapter::VALUE_USER; 27 + } 28 + } 29 + 30 + }
+26
src/applications/diffusion/herald/DiffusionCommitAutocloseHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitAutocloseHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.autoclose'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Commit is on autoclose branch'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + return $object->getRepository()->shouldAutocloseCommit($object); 14 + } 15 + 16 + public function getHeraldFieldConditions() { 17 + return array( 18 + HeraldAdapter::CONDITION_UNCONDITIONALLY, 19 + ); 20 + } 21 + 22 + public function getHeraldFieldValueType($condition) { 23 + return HeraldAdapter::VALUE_NONE; 24 + } 25 + 26 + }
+38
src/applications/diffusion/herald/DiffusionCommitBranchesHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitBranchesHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.branches'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Branches'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + $commit = $object; 14 + $repository = $object->getRepository(); 15 + 16 + $params = array( 17 + 'callsign' => $repository->getCallsign(), 18 + 'contains' => $commit->getCommitIdentifier(), 19 + ); 20 + 21 + $result = id(new ConduitCall('diffusion.branchquery', $params)) 22 + ->setUser(PhabricatorUser::getOmnipotentUser()) 23 + ->execute(); 24 + 25 + $refs = DiffusionRepositoryRef::loadAllFromDictionaries($result); 26 + 27 + return mpull($refs, 'getShortName'); 28 + } 29 + 30 + protected function getHeraldFieldStandardConditions() { 31 + return self::STANDARD_TEXT_LIST; 32 + } 33 + 34 + public function getHeraldFieldValueType($condition) { 35 + return HeraldAdapter::VALUE_TEXT; 36 + } 37 + 38 + }
+30
src/applications/diffusion/herald/DiffusionCommitCommitterHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitCommitterHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.committer'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Committer'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + return $object->getCommitData()->getCommitDetail('committerPHID'); 14 + } 15 + 16 + protected function getHeraldFieldStandardConditions() { 17 + return self::STANDARD_PHID_NULLABLE; 18 + } 19 + 20 + public function getHeraldFieldValueType($condition) { 21 + switch ($condition) { 22 + case HeraldAdapter::CONDITION_EXISTS: 23 + case HeraldAdapter::CONDITION_NOT_EXISTS: 24 + return HeraldAdapter::VALUE_NONE; 25 + default: 26 + return HeraldAdapter::VALUE_USER; 27 + } 28 + } 29 + 30 + }
+24
src/applications/diffusion/herald/DiffusionCommitDiffContentAddedHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitDiffContentAddedHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.diff.new'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Diff content added'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + return $this->getAdapter()->loadDiffContent('+'); 14 + } 15 + 16 + protected function getHeraldFieldStandardConditions() { 17 + return self::STANDARD_TEXT_MAP; 18 + } 19 + 20 + public function getHeraldFieldValueType($condition) { 21 + return HeraldAdapter::VALUE_TEXT; 22 + } 23 + 24 + }
+24
src/applications/diffusion/herald/DiffusionCommitDiffContentHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitDiffContentHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.diff'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Diff content'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + return $this->getAdapter()->loadDiffContent('*'); 14 + } 15 + 16 + protected function getHeraldFieldStandardConditions() { 17 + return self::STANDARD_TEXT_MAP; 18 + } 19 + 20 + public function getHeraldFieldValueType($condition) { 21 + return HeraldAdapter::VALUE_TEXT; 22 + } 23 + 24 + }
+24
src/applications/diffusion/herald/DiffusionCommitDiffContentRemovedHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitDiffContentRemovedHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.diff.old'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Diff content removed'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + return $this->getAdapter()->loadDiffContent('-'); 14 + } 15 + 16 + protected function getHeraldFieldStandardConditions() { 17 + return self::STANDARD_TEXT_MAP; 18 + } 19 + 20 + public function getHeraldFieldValueType($condition) { 21 + return HeraldAdapter::VALUE_TEXT; 22 + } 23 + 24 + }
+24
src/applications/diffusion/herald/DiffusionCommitDiffEnormousHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitDiffEnormousHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.enormous'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Change is enormous'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + return $this->getAdapter()->isDiffEnormous(); 14 + } 15 + 16 + protected function getHeraldFieldStandardConditions() { 17 + return self::STANDARD_BOOL; 18 + } 19 + 20 + public function getHeraldFieldValueType($condition) { 21 + return HeraldAdapter::VALUE_NONE; 22 + } 23 + 24 + }
+9
src/applications/diffusion/herald/DiffusionCommitHeraldField.php
··· 1 + <?php 2 + 3 + abstract class DiffusionCommitHeraldField extends HeraldField { 4 + 5 + public function supportsObject($object) { 6 + return ($object instanceof PhabricatorRepositoryCommit); 7 + } 8 + 9 + }
+24
src/applications/diffusion/herald/DiffusionCommitMessageHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitMessageHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.message'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Commit message'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + return $object->getCommitData()->getCommitMessage(); 14 + } 15 + 16 + protected function getHeraldFieldStandardConditions() { 17 + return self::STANDARD_TEXT; 18 + } 19 + 20 + public function getHeraldFieldValueType($condition) { 21 + return HeraldAdapter::VALUE_TEXT; 22 + } 23 + 24 + }
+35
src/applications/diffusion/herald/DiffusionCommitPackageAuditHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitPackageAuditHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.package.audit'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Affected packages that need audit'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + $packages = $this->getAdapter()->loadAuditNeededPackages(); 14 + if (!$packages) { 15 + return array(); 16 + } 17 + 18 + return mpull($packages, 'getPHID'); 19 + } 20 + 21 + protected function getHeraldFieldStandardConditions() { 22 + return self::STANDARD_LIST; 23 + } 24 + 25 + public function getHeraldFieldValueType($condition) { 26 + switch ($condition) { 27 + case HeraldAdapter::CONDITION_EXISTS: 28 + case HeraldAdapter::CONDITION_NOT_EXISTS: 29 + return HeraldAdapter::VALUE_NONE; 30 + default: 31 + return HeraldAdapter::VALUE_OWNERS_PACKAGE; 32 + } 33 + } 34 + 35 + }
+31
src/applications/diffusion/herald/DiffusionCommitPackageHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitPackageHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.package'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Affected packages'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + $packages = $this->getAdapter()->loadAffectedPackages(); 14 + return mpull($packages, 'getPHID'); 15 + } 16 + 17 + protected function getHeraldFieldStandardConditions() { 18 + return self::STANDARD_LIST; 19 + } 20 + 21 + public function getHeraldFieldValueType($condition) { 22 + switch ($condition) { 23 + case HeraldAdapter::CONDITION_EXISTS: 24 + case HeraldAdapter::CONDITION_NOT_EXISTS: 25 + return HeraldAdapter::VALUE_NONE; 26 + default: 27 + return HeraldAdapter::VALUE_OWNERS_PACKAGE; 28 + } 29 + } 30 + 31 + }
+37
src/applications/diffusion/herald/DiffusionCommitPackageOwnerHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitPackageOwnerHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.package.owners'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Affected package owners'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + $packages = $this->getAdapter()->loadAffectedPackages(); 14 + if (!$packages) { 15 + return array(); 16 + } 17 + 18 + $owners = PhabricatorOwnersOwner::loadAllForPackages($packages); 19 + 20 + return mpull($owners, 'getUserPHID'); 21 + } 22 + 23 + protected function getHeraldFieldStandardConditions() { 24 + return self::STANDARD_LIST; 25 + } 26 + 27 + public function getHeraldFieldValueType($condition) { 28 + switch ($condition) { 29 + case HeraldAdapter::CONDITION_EXISTS: 30 + case HeraldAdapter::CONDITION_NOT_EXISTS: 31 + return HeraldAdapter::VALUE_NONE; 32 + default: 33 + return HeraldAdapter::VALUE_USER; 34 + } 35 + } 36 + 37 + }
+24
src/applications/diffusion/herald/DiffusionCommitRepositoryHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitRepositoryHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.repository'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Repository'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + return $object->getRepository()->getPHID(); 14 + } 15 + 16 + protected function getHeraldFieldStandardConditions() { 17 + return self::STANDARD_PHID; 18 + } 19 + 20 + public function getHeraldFieldValueType($condition) { 21 + return HeraldAdapter::VALUE_REPOSITORY; 22 + } 23 + 24 + }
+32
src/applications/diffusion/herald/DiffusionCommitRepositoryProjectsHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitRepositoryProjectsHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.repository.projects'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Repository projects'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + return PhabricatorEdgeQuery::loadDestinationPHIDs( 14 + $object->getRepository()->getPHID(), 15 + PhabricatorProjectObjectHasProjectEdgeType::EDGECONST); 16 + } 17 + 18 + protected function getHeraldFieldStandardConditions() { 19 + return self::STANDARD_LIST; 20 + } 21 + 22 + public function getHeraldFieldValueType($condition) { 23 + switch ($condition) { 24 + case HeraldAdapter::CONDITION_EXISTS: 25 + case HeraldAdapter::CONDITION_NOT_EXISTS: 26 + return HeraldAdapter::VALUE_NONE; 27 + default: 28 + return HeraldAdapter::VALUE_PROJECT; 29 + } 30 + } 31 + 32 + }
+30
src/applications/diffusion/herald/DiffusionCommitReviewerHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitReviewerHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.reviewer'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Reviewer'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + return $object->getCommitData()->getCommitDetail('reviewerPHID'); 14 + } 15 + 16 + protected function getHeraldFieldStandardConditions() { 17 + return self::STANDARD_PHID_NULLABLE; 18 + } 19 + 20 + public function getHeraldFieldValueType($condition) { 21 + switch ($condition) { 22 + case HeraldAdapter::CONDITION_EXISTS: 23 + case HeraldAdapter::CONDITION_NOT_EXISTS: 24 + return HeraldAdapter::VALUE_NONE; 25 + default: 26 + return HeraldAdapter::VALUE_USER; 27 + } 28 + } 29 + 30 + }
+40
src/applications/diffusion/herald/DiffusionCommitRevisionAcceptedHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitRevisionAcceptedHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.revision.accepted'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Accepted Differential revision'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + $revision = $this->getAdapter()->loadDifferentialRevision(); 14 + if (!$revision) { 15 + return null; 16 + } 17 + 18 + $data = $object->getCommitData(); 19 + $status = $data->getCommitDetail( 20 + 'precommitRevisionStatus', 21 + $revision->getStatus()); 22 + 23 + switch ($status) { 24 + case ArcanistDifferentialRevisionStatus::ACCEPTED: 25 + case ArcanistDifferentialRevisionStatus::CLOSED: 26 + return $revision->getPHID(); 27 + } 28 + 29 + return null; 30 + } 31 + 32 + protected function getHeraldFieldStandardConditions() { 33 + return self::STANDARD_PHID_BOOL; 34 + } 35 + 36 + public function getHeraldFieldValueType($condition) { 37 + return HeraldAdapter::VALUE_NONE; 38 + } 39 + 40 + }
+30
src/applications/diffusion/herald/DiffusionCommitRevisionHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitRevisionHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.revision'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Differential revision'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + $revision = $this->getAdapter()->loadDifferentialRevision(); 14 + 15 + if (!$revision) { 16 + return null; 17 + } 18 + 19 + return $revision->getPHID(); 20 + } 21 + 22 + protected function getHeraldFieldStandardConditions() { 23 + return self::STANDARD_PHID_BOOL; 24 + } 25 + 26 + public function getHeraldFieldValueType($condition) { 27 + return HeraldAdapter::VALUE_NONE; 28 + } 29 + 30 + }
+36
src/applications/diffusion/herald/DiffusionCommitRevisionReviewersHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitRevisionReviewersHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.revision.reviewers'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Differential reviewers'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + $revision = $this->getAdapter()->loadDifferentialRevision(); 14 + 15 + if (!$revision) { 16 + return array(); 17 + } 18 + 19 + return $revision->getReviewers(); 20 + } 21 + 22 + protected function getHeraldFieldStandardConditions() { 23 + return self::STANDARD_LIST; 24 + } 25 + 26 + public function getHeraldFieldValueType($condition) { 27 + switch ($condition) { 28 + case HeraldAdapter::CONDITION_EXISTS: 29 + case HeraldAdapter::CONDITION_NOT_EXISTS: 30 + return HeraldAdapter::VALUE_NONE; 31 + default: 32 + return HeraldAdapter::VALUE_USER_OR_PROJECT; 33 + } 34 + } 35 + 36 + }
+37
src/applications/diffusion/herald/DiffusionCommitRevisionSubscribersHeraldField.php
··· 1 + <?php 2 + 3 + final class DiffusionCommitRevisionSubscribersHeraldField 4 + extends DiffusionCommitHeraldField { 5 + 6 + const FIELDCONST = 'diffusion.commit.revision.subscribers'; 7 + 8 + public function getHeraldFieldName() { 9 + return pht('Differential subscribers'); 10 + } 11 + 12 + public function getHeraldFieldValue($object) { 13 + $revision = $this->getAdapter()->loadDifferentialRevision(); 14 + 15 + if (!$revision) { 16 + return array(); 17 + } 18 + 19 + $phid = $revision->getPHID(); 20 + return PhabricatorSubscribersQuery::loadSubscribersForPHID($phid); 21 + } 22 + 23 + protected function getHeraldFieldStandardConditions() { 24 + return self::STANDARD_LIST; 25 + } 26 + 27 + public function getHeraldFieldValueType($condition) { 28 + switch ($condition) { 29 + case HeraldAdapter::CONDITION_EXISTS: 30 + case HeraldAdapter::CONDITION_NOT_EXISTS: 31 + return HeraldAdapter::VALUE_NONE; 32 + default: 33 + return HeraldAdapter::VALUE_USER_OR_PROJECT; 34 + } 35 + } 36 + 37 + }
+7 -159
src/applications/herald/adapter/HeraldCommitAdapter.php src/applications/diffusion/herald/HeraldCommitAdapter.php
··· 2 2 3 3 final class HeraldCommitAdapter extends HeraldAdapter { 4 4 5 - const FIELD_NEED_AUDIT_FOR_PACKAGE = 'need-audit-for-package'; 6 - const FIELD_REPOSITORY_AUTOCLOSE_BRANCH = 'repository-autoclose-branch'; 7 - 8 5 protected $diff; 9 6 protected $revision; 10 7 ··· 86 83 return pht('This rule can trigger for **repositories** and **projects**.'); 87 84 } 88 85 89 - public function getFieldNameMap() { 90 - return array( 91 - self::FIELD_NEED_AUDIT_FOR_PACKAGE => 92 - pht('Affected packages that need audit'), 93 - self::FIELD_REPOSITORY_AUTOCLOSE_BRANCH 94 - => pht('Commit is on closing branch'), 95 - ) + parent::getFieldNameMap(); 96 - } 97 - 98 - public function getFields() { 99 - return array_merge( 100 - array( 101 - self::FIELD_BODY, 102 - self::FIELD_AUTHOR, 103 - self::FIELD_COMMITTER, 104 - self::FIELD_REVIEWER, 105 - self::FIELD_REPOSITORY, 106 - self::FIELD_REPOSITORY_PROJECTS, 107 - self::FIELD_DIFF_FILE, 108 - self::FIELD_DIFF_CONTENT, 109 - self::FIELD_DIFF_ADDED_CONTENT, 110 - self::FIELD_DIFF_REMOVED_CONTENT, 111 - self::FIELD_DIFF_ENORMOUS, 112 - self::FIELD_AFFECTED_PACKAGE, 113 - self::FIELD_AFFECTED_PACKAGE_OWNER, 114 - self::FIELD_NEED_AUDIT_FOR_PACKAGE, 115 - self::FIELD_DIFFERENTIAL_REVISION, 116 - self::FIELD_DIFFERENTIAL_ACCEPTED, 117 - self::FIELD_DIFFERENTIAL_REVIEWERS, 118 - self::FIELD_DIFFERENTIAL_CCS, 119 - self::FIELD_BRANCHES, 120 - self::FIELD_REPOSITORY_AUTOCLOSE_BRANCH, 121 - ), 122 - parent::getFields()); 123 - } 124 - 125 - public function getConditionsForField($field) { 126 - switch ($field) { 127 - case self::FIELD_NEED_AUDIT_FOR_PACKAGE: 128 - return array( 129 - self::CONDITION_INCLUDE_ANY, 130 - self::CONDITION_INCLUDE_NONE, 131 - ); 132 - case self::FIELD_REPOSITORY_AUTOCLOSE_BRANCH: 133 - return array( 134 - self::CONDITION_UNCONDITIONALLY, 135 - ); 136 - } 137 - return parent::getConditionsForField($field); 138 - } 139 - 140 86 public function getActions($rule_type) { 141 87 switch ($rule_type) { 142 88 case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL: ··· 165 111 } 166 112 } 167 113 168 - public function getValueTypeForFieldAndCondition($field, $condition) { 169 - switch ($field) { 170 - case self::FIELD_DIFFERENTIAL_CCS: 171 - return self::VALUE_EMAIL; 172 - case self::FIELD_NEED_AUDIT_FOR_PACKAGE: 173 - return self::VALUE_OWNERS_PACKAGE; 174 - } 175 - 176 - return parent::getValueTypeForFieldAndCondition($field, $condition); 177 - } 178 - 179 114 public static function newLegacyAdapter( 180 115 PhabricatorRepository $repository, 181 116 PhabricatorRepositoryCommit $commit, ··· 221 156 return $this; 222 157 } 223 158 224 - public function getPHID() { 225 - return $this->commit->getPHID(); 226 - } 227 - 228 159 public function getAuditMap() { 229 160 return $this->auditMap; 230 161 } ··· 261 192 return $this->affectedPackages; 262 193 } 263 194 264 - public function loadAuditNeededPackage() { 195 + public function loadAuditNeededPackages() { 265 196 if ($this->auditNeededPackages === null) { 266 197 $status_arr = array( 267 198 PhabricatorAuditStatusConstants::AUDIT_REQUIRED, ··· 351 282 return $diff; 352 283 } 353 284 354 - private function getDiffContent($type) { 285 + public function isDiffEnormous() { 286 + $this->loadDiffContent('*'); 287 + return ($this->commitDiff instanceof Exception); 288 + } 289 + 290 + public function loadDiffContent($type) { 355 291 if ($this->commitDiff === null) { 356 292 try { 357 293 $this->commitDiff = $this->loadCommitDiff(); ··· 395 331 } 396 332 397 333 return $result; 398 - } 399 - 400 - public function getHeraldField($field) { 401 - $data = $this->commitData; 402 - switch ($field) { 403 - case self::FIELD_BODY: 404 - return $data->getCommitMessage(); 405 - case self::FIELD_AUTHOR: 406 - return $data->getCommitDetail('authorPHID'); 407 - case self::FIELD_COMMITTER: 408 - return $data->getCommitDetail('committerPHID'); 409 - case self::FIELD_REVIEWER: 410 - return $data->getCommitDetail('reviewerPHID'); 411 - case self::FIELD_DIFF_FILE: 412 - return $this->loadAffectedPaths(); 413 - case self::FIELD_REPOSITORY: 414 - return $this->repository->getPHID(); 415 - case self::FIELD_REPOSITORY_PROJECTS: 416 - return $this->repository->getProjectPHIDs(); 417 - case self::FIELD_DIFF_CONTENT: 418 - return $this->getDiffContent('*'); 419 - case self::FIELD_DIFF_ADDED_CONTENT: 420 - return $this->getDiffContent('+'); 421 - case self::FIELD_DIFF_REMOVED_CONTENT: 422 - return $this->getDiffContent('-'); 423 - case self::FIELD_DIFF_ENORMOUS: 424 - $this->getDiffContent('*'); 425 - return ($this->commitDiff instanceof Exception); 426 - case self::FIELD_AFFECTED_PACKAGE: 427 - $packages = $this->loadAffectedPackages(); 428 - return mpull($packages, 'getPHID'); 429 - case self::FIELD_AFFECTED_PACKAGE_OWNER: 430 - $packages = $this->loadAffectedPackages(); 431 - $owners = PhabricatorOwnersOwner::loadAllForPackages($packages); 432 - return mpull($owners, 'getUserPHID'); 433 - case self::FIELD_NEED_AUDIT_FOR_PACKAGE: 434 - return $this->loadAuditNeededPackage(); 435 - case self::FIELD_DIFFERENTIAL_REVISION: 436 - $revision = $this->loadDifferentialRevision(); 437 - if (!$revision) { 438 - return null; 439 - } 440 - return $revision->getID(); 441 - case self::FIELD_DIFFERENTIAL_ACCEPTED: 442 - $revision = $this->loadDifferentialRevision(); 443 - if (!$revision) { 444 - return null; 445 - } 446 - 447 - $status = $data->getCommitDetail( 448 - 'precommitRevisionStatus', 449 - $revision->getStatus()); 450 - switch ($status) { 451 - case ArcanistDifferentialRevisionStatus::ACCEPTED: 452 - case ArcanistDifferentialRevisionStatus::CLOSED: 453 - return $revision->getPHID(); 454 - } 455 - 456 - return null; 457 - case self::FIELD_DIFFERENTIAL_REVIEWERS: 458 - $revision = $this->loadDifferentialRevision(); 459 - if (!$revision) { 460 - return array(); 461 - } 462 - return $revision->getReviewers(); 463 - case self::FIELD_DIFFERENTIAL_CCS: 464 - $revision = $this->loadDifferentialRevision(); 465 - if (!$revision) { 466 - return array(); 467 - } 468 - return $revision->getCCPHIDs(); 469 - case self::FIELD_BRANCHES: 470 - $params = array( 471 - 'callsign' => $this->repository->getCallsign(), 472 - 'contains' => $this->commit->getCommitIdentifier(), 473 - ); 474 - 475 - $result = id(new ConduitCall('diffusion.branchquery', $params)) 476 - ->setUser(PhabricatorUser::getOmnipotentUser()) 477 - ->execute(); 478 - 479 - $refs = DiffusionRepositoryRef::loadAllFromDictionaries($result); 480 - return mpull($refs, 'getShortName'); 481 - case self::FIELD_REPOSITORY_AUTOCLOSE_BRANCH: 482 - return $this->repository->shouldAutocloseCommit($this->commit); 483 - } 484 - 485 - return parent::getHeraldField($field); 486 334 } 487 335 488 336 public function applyHeraldEffects(array $effects) {
+19
src/applications/herald/field/HeraldField.php
··· 7 7 const STANDARD_LIST = 'standard.list'; 8 8 const STANDARD_BOOL = 'standard.bool'; 9 9 const STANDARD_TEXT = 'standard.text'; 10 + const STANDARD_TEXT_LIST = 'standard.text.list'; 11 + const STANDARD_TEXT_MAP = 'standard.text.map'; 10 12 const STANDARD_PHID = 'standard.phid'; 13 + const STANDARD_PHID_BOOL = 'standard.phid.bool'; 11 14 const STANDARD_PHID_NULLABLE = 'standard.phid.nullable'; 12 15 13 16 abstract public function getHeraldFieldName(); ··· 41 44 HeraldAdapter::CONDITION_IS_ANY, 42 45 HeraldAdapter::CONDITION_IS_NOT_ANY, 43 46 ); 47 + case self::STANDARD_PHID_BOOL: 48 + return array( 49 + HeraldAdapter::CONDITION_EXISTS, 50 + HeraldAdapter::CONDITION_NOT_EXISTS, 51 + ); 44 52 case self::STANDARD_PHID_NULLABLE: 45 53 return array( 46 54 HeraldAdapter::CONDITION_IS_ANY, 47 55 HeraldAdapter::CONDITION_IS_NOT_ANY, 48 56 HeraldAdapter::CONDITION_EXISTS, 49 57 HeraldAdapter::CONDITION_NOT_EXISTS, 58 + ); 59 + case self::STANDARD_TEXT_LIST: 60 + return array( 61 + HeraldAdapter::CONDITION_CONTAINS, 62 + HeraldAdapter::CONDITION_REGEXP, 63 + ); 64 + case self::STANDARD_TEXT_MAP: 65 + return array( 66 + HeraldAdapter::CONDITION_CONTAINS, 67 + HeraldAdapter::CONDITION_REGEXP, 68 + HeraldAdapter::CONDITION_REGEXP_PAIR, 50 69 ); 51 70 } 52 71
+7 -1
src/applications/maniphest/herald/ManiphestTaskAssigneeHeraldField.php
··· 18 18 } 19 19 20 20 public function getHeraldFieldValueType($condition) { 21 - return HeraldAdapter::VALUE_USER; 21 + switch ($condition) { 22 + case HeraldAdapter::CONDITION_EXISTS: 23 + case HeraldAdapter::CONDITION_NOT_EXISTS: 24 + return HeraldAdapter::VALUE_NONE; 25 + default: 26 + return HeraldAdapter::VALUE_USER; 27 + } 22 28 } 23 29 24 30 }
+1 -1
src/applications/subscriptions/herald/HeraldSubscribersField.php
··· 27 27 case HeraldAdapter::CONDITION_NOT_EXISTS: 28 28 return HeraldAdapter::VALUE_NONE; 29 29 default: 30 - return HeraldAdapter::VALUE_PROJECT; 30 + return HeraldAdapter::VALUE_USER_OR_PROJECT; 31 31 } 32 32 } 33 33