@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.

Generate expected schemata for Fact, Owners, Herald and Diviner

Summary:
Ref T1191. Notable:

- `HeraldApplyTranscript` is not actually a DAO and has no table (it is serialized into HeraldTranscript).

Test Plan: Down to fewer than 300 issues.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T1191

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

+357 -12
+9 -1
src/__phutil_library_map__.php
··· 549 549 'DivinerPublisher' => 'applications/diviner/publisher/DivinerPublisher.php', 550 550 'DivinerRenderer' => 'applications/diviner/renderer/DivinerRenderer.php', 551 551 'DivinerReturnTableView' => 'applications/diviner/view/DivinerReturnTableView.php', 552 + 'DivinerSchemaSpec' => 'applications/diviner/storage/DivinerSchemaSpec.php', 552 553 'DivinerSectionView' => 'applications/diviner/view/DivinerSectionView.php', 553 554 'DivinerStaticPublisher' => 'applications/diviner/publisher/DivinerStaticPublisher.php', 554 555 'DivinerSymbolRemarkupRule' => 'applications/diviner/markup/DivinerSymbolRemarkupRule.php', ··· 819 820 'HeraldRuleTranscript' => 'applications/herald/storage/transcript/HeraldRuleTranscript.php', 820 821 'HeraldRuleTypeConfig' => 'applications/herald/config/HeraldRuleTypeConfig.php', 821 822 'HeraldRuleViewController' => 'applications/herald/controller/HeraldRuleViewController.php', 823 + 'HeraldSchemaSpec' => 'applications/herald/storage/HeraldSchemaSpec.php', 822 824 'HeraldTestConsoleController' => 'applications/herald/controller/HeraldTestConsoleController.php', 823 825 'HeraldTransactionQuery' => 'applications/herald/query/HeraldTransactionQuery.php', 824 826 'HeraldTranscript' => 'applications/herald/storage/transcript/HeraldTranscript.php', ··· 1572 1574 'PhabricatorFactManagementStatusWorkflow' => 'applications/fact/management/PhabricatorFactManagementStatusWorkflow.php', 1573 1575 'PhabricatorFactManagementWorkflow' => 'applications/fact/management/PhabricatorFactManagementWorkflow.php', 1574 1576 'PhabricatorFactRaw' => 'applications/fact/storage/PhabricatorFactRaw.php', 1577 + 'PhabricatorFactSchemaSpec' => 'applications/fact/storage/PhabricatorFactSchemaSpec.php', 1575 1578 'PhabricatorFactSimpleSpec' => 'applications/fact/spec/PhabricatorFactSimpleSpec.php', 1576 1579 'PhabricatorFactSpec' => 'applications/fact/spec/PhabricatorFactSpec.php', 1577 1580 'PhabricatorFactUpdateIterator' => 'applications/fact/extract/PhabricatorFactUpdateIterator.php', ··· 1896 1899 'PhabricatorOwnersPackageQuery' => 'applications/owners/query/PhabricatorOwnersPackageQuery.php', 1897 1900 'PhabricatorOwnersPackageTestCase' => 'applications/owners/storage/__tests__/PhabricatorOwnersPackageTestCase.php', 1898 1901 'PhabricatorOwnersPath' => 'applications/owners/storage/PhabricatorOwnersPath.php', 1902 + 'PhabricatorOwnersSchemaSpec' => 'applications/owners/storage/PhabricatorOwnersSchemaSpec.php', 1899 1903 'PhabricatorPHDConfigOptions' => 'applications/config/option/PhabricatorPHDConfigOptions.php', 1900 1904 'PhabricatorPHID' => 'applications/phid/storage/PhabricatorPHID.php', 1901 1905 'PhabricatorPHIDConstants' => 'applications/phid/PhabricatorPHIDConstants.php', ··· 3386 3390 'DivinerParameterTableView' => 'AphrontTagView', 3387 3391 'DivinerPublishCache' => 'DivinerDiskCache', 3388 3392 'DivinerReturnTableView' => 'AphrontTagView', 3393 + 'DivinerSchemaSpec' => 'PhabricatorConfigSchemaSpec', 3389 3394 'DivinerSectionView' => 'AphrontTagView', 3390 3395 'DivinerStaticPublisher' => 'DivinerPublisher', 3391 3396 'DivinerSymbolRemarkupRule' => 'PhutilRemarkupRule', ··· 3668 3673 'HarbormasterWaitForPreviousBuildStepImplementation' => 'HarbormasterBuildStepImplementation', 3669 3674 'HarbormasterWorker' => 'PhabricatorWorker', 3670 3675 'HeraldAction' => 'HeraldDAO', 3671 - 'HeraldApplyTranscript' => 'HeraldDAO', 3676 + 'HeraldApplyTranscript' => 'Phobject', 3672 3677 'HeraldCommitAdapter' => 'HeraldAdapter', 3673 3678 'HeraldCondition' => 'HeraldDAO', 3674 3679 'HeraldController' => 'PhabricatorController', ··· 3708 3713 'HeraldRuleTransaction' => 'PhabricatorApplicationTransaction', 3709 3714 'HeraldRuleTransactionComment' => 'PhabricatorApplicationTransactionComment', 3710 3715 'HeraldRuleViewController' => 'HeraldController', 3716 + 'HeraldSchemaSpec' => 'PhabricatorConfigSchemaSpec', 3711 3717 'HeraldTestConsoleController' => 'HeraldController', 3712 3718 'HeraldTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 3713 3719 'HeraldTranscript' => array( ··· 4523 4529 'PhabricatorFactManagementStatusWorkflow' => 'PhabricatorFactManagementWorkflow', 4524 4530 'PhabricatorFactManagementWorkflow' => 'PhabricatorManagementWorkflow', 4525 4531 'PhabricatorFactRaw' => 'PhabricatorFactDAO', 4532 + 'PhabricatorFactSchemaSpec' => 'PhabricatorConfigSchemaSpec', 4526 4533 'PhabricatorFactSimpleSpec' => 'PhabricatorFactSpec', 4527 4534 'PhabricatorFactUpdateIterator' => 'PhutilBufferedIterator', 4528 4535 'PhabricatorFeedApplication' => 'PhabricatorApplication', ··· 4847 4854 'PhabricatorOwnersPackageQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 4848 4855 'PhabricatorOwnersPackageTestCase' => 'PhabricatorTestCase', 4849 4856 'PhabricatorOwnersPath' => 'PhabricatorOwnersDAO', 4857 + 'PhabricatorOwnersSchemaSpec' => 'PhabricatorConfigSchemaSpec', 4850 4858 'PhabricatorPHDConfigOptions' => 'PhabricatorApplicationConfigOptions', 4851 4859 'PhabricatorPHPASTApplication' => 'PhabricatorApplication', 4852 4860 'PhabricatorPHPMailerConfigOptions' => 'PhabricatorApplicationConfigOptions',
+6
src/applications/diviner/storage/DivinerLiveAtom.php
··· 13 13 'content' => self::SERIALIZATION_JSON, 14 14 'atomData' => self::SERIALIZATION_JSON, 15 15 ), 16 + self::CONFIG_KEY_SCHEMA => array( 17 + 'symbolPHID' => array( 18 + 'columns' => array('symbolPHID'), 19 + 'unique' => true, 20 + ), 21 + ), 16 22 ) + parent::getConfiguration(); 17 23 } 18 24
+14
src/applications/diviner/storage/DivinerLiveBook.php
··· 13 13 self::CONFIG_SERIALIZATION => array( 14 14 'configurationData' => self::SERIALIZATION_JSON, 15 15 ), 16 + self::CONFIG_COLUMN_SCHEMA => array( 17 + 'name' => 'text64', 18 + ), 19 + self::CONFIG_KEY_SCHEMA => array( 20 + 'key_phid' => null, 21 + 'phid' => array( 22 + 'columns' => array('phid'), 23 + 'unique' => true, 24 + ), 25 + 'name' => array( 26 + 'columns' => array('name'), 27 + 'unique' => true, 28 + ), 29 + ), 16 30 ) + parent::getConfiguration(); 17 31 } 18 32
+48
src/applications/diviner/storage/DivinerLiveSymbol.php
··· 27 27 return array( 28 28 self::CONFIG_AUX_PHID => true, 29 29 self::CONFIG_TIMESTAMPS => false, 30 + self::CONFIG_COLUMN_SCHEMA => array( 31 + 'context' => 'text255?', 32 + 'type' => 'text32', 33 + 'name' => 'text255', 34 + 'atomIndex' => 'uint32', 35 + 'identityHash' => 'bytes12', 36 + 'graphHash' => 'bytes64?', 37 + 'title' => 'text?', 38 + 'titleSlugHash' => 'bytes12?', 39 + 'groupName' => 'text255?', 40 + 'summary' => 'text?', 41 + 'isDocumentable' => 'bool', 42 + 'nodeHash' => 'bytes64?', 43 + ), 44 + self::CONFIG_KEY_SCHEMA => array( 45 + 'key_phid' => null, 46 + 'identityHash' => array( 47 + 'columns' => array('identityHash'), 48 + 'unique' => true, 49 + ), 50 + 'phid' => array( 51 + 'columns' => array('phid'), 52 + 'unique' => true, 53 + ), 54 + 'graphHash' => array( 55 + 'columns' => array('graphHash'), 56 + 'unique' => true, 57 + ), 58 + 'nodeHash' => array( 59 + 'columns' => array('nodeHash'), 60 + 'unique' => true, 61 + ), 62 + 'bookPHID' => array( 63 + 'columns' => array( 64 + 'bookPHID', 65 + 'type', 66 + 'name(64)', 67 + 'context(64)', 68 + 'atomIndex', 69 + ), 70 + ), 71 + 'name' => array( 72 + 'columns' => array('name'), 73 + ), 74 + 'key_slug' => array( 75 + 'columns' => array('titleSlugHash'), 76 + ), 77 + ), 30 78 ) + parent::getConfiguration(); 31 79 } 32 80
+9
src/applications/diviner/storage/DivinerSchemaSpec.php
··· 1 + <?php 2 + 3 + final class DivinerSchemaSpec extends PhabricatorConfigSchemaSpec { 4 + 5 + public function buildSchemata() { 6 + $this->buildLiskSchemata('DivinerDAO'); 7 + } 8 + 9 + }
+17 -1
src/applications/fact/storage/PhabricatorFactAggregate.php
··· 2 2 3 3 final class PhabricatorFactAggregate extends PhabricatorFactDAO { 4 4 5 - protected $id; 6 5 protected $factType; 7 6 protected $objectPHID; 8 7 protected $valueX; 8 + 9 + public function getConfiguration() { 10 + return array( 11 + self::CONFIG_COLUMN_SCHEMA => array( 12 + 'id' => null, 13 + 'factType' => 'text32', 14 + 'valueX' => 'uint64', 15 + ), 16 + self::CONFIG_KEY_SCHEMA => array( 17 + 'PRIMARY' => null, 18 + 'factType' => array( 19 + 'columns' => array('factType', 'objectPHID'), 20 + 'unique' => true, 21 + ), 22 + ), 23 + ) + parent::getConfiguration(); 24 + } 9 25 10 26 }
+15 -1
src/applications/fact/storage/PhabricatorFactCursor.php
··· 2 2 3 3 final class PhabricatorFactCursor extends PhabricatorFactDAO { 4 4 5 - protected $id; 6 5 protected $name; 7 6 protected $position; 7 + 8 + public function getConfiguration() { 9 + return array( 10 + self::CONFIG_COLUMN_SCHEMA => array( 11 + 'name' => 'text64', 12 + 'position' => 'text64', 13 + ), 14 + self::CONFIG_KEY_SCHEMA => array( 15 + 'name' => array( 16 + 'columns' => array('name'), 17 + 'unique' => true, 18 + ), 19 + ), 20 + ) + parent::getConfiguration(); 21 + } 8 22 9 23 }
+25 -1
src/applications/fact/storage/PhabricatorFactRaw.php
··· 5 5 */ 6 6 final class PhabricatorFactRaw extends PhabricatorFactDAO { 7 7 8 - protected $id; 9 8 protected $factType; 10 9 protected $objectPHID; 11 10 protected $objectA; 12 11 protected $valueX; 13 12 protected $valueY; 14 13 protected $epoch; 14 + 15 + public function getConfiguration() { 16 + return array( 17 + self::CONFIG_COLUMN_SCHEMA => array( 18 + 'id' => null, 19 + 'factType' => 'text32', 20 + 'objectA' => 'phid', 21 + 'valueX' => 'sint64', 22 + 'valueY' => 'sint64', 23 + ), 24 + self::CONFIG_KEY_SCHEMA => array( 25 + 'PRIMARY' => null, 26 + 'objectPHID' => array( 27 + 'columns' => array('objectPHID'), 28 + ), 29 + 'factType' => array( 30 + 'columns' => array('factType', 'epoch'), 31 + ), 32 + 'factType_2' => array( 33 + 'columns' => array('factType', 'objectA'), 34 + ), 35 + ), 36 + ) + parent::getConfiguration(); 37 + } 38 + 15 39 16 40 }
+9
src/applications/fact/storage/PhabricatorFactSchemaSpec.php
··· 1 + <?php 2 + 3 + final class PhabricatorFactSchemaSpec extends PhabricatorConfigSchemaSpec { 4 + 5 + public function buildSchemata() { 6 + $this->buildLiskSchemata('PhabricatorFactDAO'); 7 + } 8 + 9 + }
+9
src/applications/herald/storage/HeraldAction.php
··· 13 13 'target' => self::SERIALIZATION_JSON, 14 14 ), 15 15 self::CONFIG_TIMESTAMPS => false, 16 + self::CONFIG_COLUMN_SCHEMA => array( 17 + 'action' => 'text255', 18 + 'target' => 'text', 19 + ), 20 + self::CONFIG_KEY_SCHEMA => array( 21 + 'ruleID' => array( 22 + 'columns' => array('ruleID'), 23 + ), 24 + ), 16 25 ) + parent::getConfiguration(); 17 26 } 18 27
+10
src/applications/herald/storage/HeraldCondition.php
··· 14 14 'value' => self::SERIALIZATION_JSON, 15 15 ), 16 16 self::CONFIG_TIMESTAMPS => false, 17 + self::CONFIG_COLUMN_SCHEMA => array( 18 + 'fieldName' => 'text255', 19 + 'fieldCondition' => 'text255', 20 + 'value' => 'text', 21 + ), 22 + self::CONFIG_KEY_SCHEMA => array( 23 + 'ruleID' => array( 24 + 'columns' => array('ruleID'), 25 + ), 26 + ), 17 27 ) + parent::getConfiguration(); 18 28 } 19 29
+27
src/applications/herald/storage/HeraldRule.php
··· 31 31 public function getConfiguration() { 32 32 return array( 33 33 self::CONFIG_AUX_PHID => true, 34 + self::CONFIG_COLUMN_SCHEMA => array( 35 + 'name' => 'text255', 36 + 'contentType' => 'text255', 37 + 'mustMatchAll' => 'bool', 38 + 'configVersion' => 'uint32', 39 + 'repetitionPolicy' => 'uint32', 40 + 'ruleType' => 'text255', 41 + 'isDisabled' => 'uint32', 42 + 'triggerObjectPHID' => 'phid?', 43 + ), 44 + self::CONFIG_KEY_SCHEMA => array( 45 + 'key_phid' => null, 46 + 'phid' => array( 47 + 'columns' => array('phid'), 48 + 'unique' => true, 49 + ), 50 + 'authorPHID' => array( 51 + 'columns' => array('authorPHID', 'name'), 52 + 'unique' => true, 53 + ), 54 + 'IDX_RULE_TYPE' => array( 55 + 'columns' => array('ruleType'), 56 + ), 57 + 'key_trigger' => array( 58 + 'columns' => array('triggerObjectPHID'), 59 + ), 60 + ), 34 61 ) + parent::getConfiguration(); 35 62 } 36 63
+14
src/applications/herald/storage/HeraldRuleEdit.php
··· 7 7 protected $ruleName; 8 8 protected $action; 9 9 10 + public function getConfiguration() { 11 + return array( 12 + self::CONFIG_COLUMN_SCHEMA => array( 13 + 'ruleName' => 'text255', 14 + 'action' => 'text32', 15 + ), 16 + self::CONFIG_KEY_SCHEMA => array( 17 + 'ruleID' => array( 18 + 'columns' => array('ruleID', 'dateCreated'), 19 + ), 20 + ), 21 + ) + parent::getConfiguration(); 22 + } 23 + 10 24 }
+44
src/applications/herald/storage/HeraldSchemaSpec.php
··· 1 + <?php 2 + 3 + final class HeraldSchemaSpec extends PhabricatorConfigSchemaSpec { 4 + 5 + public function buildSchemata() { 6 + $this->buildLiskSchemata('HeraldDAO'); 7 + 8 + $this->buildTransactionSchema( 9 + new HeraldRuleTransaction(), 10 + new HeraldRuleTransactionComment()); 11 + 12 + $this->buildRawSchema( 13 + id(new HeraldRule())->getApplicationName(), 14 + HeraldRule::TABLE_RULE_APPLIED, 15 + array( 16 + 'ruleID' => 'id', 17 + 'phid' => 'phid', 18 + ), 19 + array( 20 + 'PRIMARY' => array( 21 + 'columns' => array('ruleID', 'phid'), 22 + 'unique' => true, 23 + ), 24 + 'phid' => array( 25 + 'columns' => array('phid'), 26 + ), 27 + )); 28 + 29 + $this->buildRawSchema( 30 + id(new HeraldRule())->getApplicationName(), 31 + HeraldTranscript::TABLE_SAVED_HEADER, 32 + array( 33 + 'phid' => 'phid', 34 + 'header' => 'text', 35 + ), 36 + array( 37 + 'PRIMARY' => array( 38 + 'columns' => array('phid'), 39 + 'unique' => true, 40 + ), 41 + )); 42 + } 43 + 44 + }
+37 -8
src/applications/herald/storage/transcript/HeraldApplyTranscript.php
··· 1 1 <?php 2 2 3 - final class HeraldApplyTranscript extends HeraldDAO { 3 + final class HeraldApplyTranscript extends Phobject { 4 4 5 - protected $action; 6 - protected $target; 5 + private $action; 6 + private $target; 7 7 8 - protected $ruleID; 9 - protected $effector; 8 + private $ruleID; 9 + private $effector; 10 10 11 - protected $reason; 11 + private $reason; 12 12 13 - protected $applied; 14 - protected $appliedReason; 13 + private $applied; 14 + private $appliedReason; 15 15 16 16 public function __construct( 17 17 HeraldEffect $effect, ··· 25 25 $this->setReason($effect->getReason()); 26 26 $this->setApplied($applied); 27 27 $this->setAppliedReason($reason); 28 + } 28 29 30 + public function setAction($action) { 31 + $this->action = $action; 32 + return $this; 29 33 } 30 34 31 35 public function getAction() { 32 36 return $this->action; 33 37 } 34 38 39 + public function setTarget($target) { 40 + $this->target = $target; 41 + return $this; 42 + } 43 + 35 44 public function getTarget() { 36 45 return $this->target; 37 46 } 38 47 48 + public function setRuleID($rule_id) { 49 + $this->ruleID = $rule_id; 50 + return $this; 51 + } 52 + 39 53 public function getRuleID() { 40 54 return $this->ruleID; 41 55 } 42 56 57 + public function setEffector($effector) { 58 + $this->effector = $effector; 59 + return $this; 60 + } 61 + 43 62 public function getEffector() { 44 63 return $this->effector; 64 + } 65 + 66 + public function setReason($reason) { 67 + $this->reason = $reason; 68 + return $this; 45 69 } 46 70 47 71 public function getReason() { 48 72 return $this->reason; 73 + } 74 + 75 + public function setApplied($applied) { 76 + $this->applied = $applied; 77 + return $this; 49 78 } 50 79 51 80 public function getApplied() {
+19
src/applications/herald/storage/transcript/HeraldTranscript.php
··· 100 100 'conditionTranscripts' => true, 101 101 'applyTranscripts' => true, 102 102 ), 103 + self::CONFIG_COLUMN_SCHEMA => array( 104 + 'time' => 'epoch', 105 + 'host' => 'text255', 106 + 'duration' => 'double', 107 + 'dryRun' => 'bool', 108 + ), 109 + self::CONFIG_KEY_SCHEMA => array( 110 + 'key_phid' => null, 111 + 'phid' => array( 112 + 'columns' => array('phid'), 113 + 'unique' => true, 114 + ), 115 + 'objectPHID' => array( 116 + 'columns' => array('objectPHID'), 117 + ), 118 + 'garbageCollected' => array( 119 + 'columns' => array('garbageCollected', 'time'), 120 + ), 121 + ), 103 122 ) + parent::getConfiguration(); 104 123 } 105 124
+9
src/applications/owners/storage/PhabricatorOwnersOwner.php
··· 12 12 public function getConfiguration() { 13 13 return array( 14 14 self::CONFIG_TIMESTAMPS => false, 15 + self::CONFIG_KEY_SCHEMA => array( 16 + 'packageID' => array( 17 + 'columns' => array('packageID', 'userPHID'), 18 + 'unique' => true, 19 + ), 20 + 'userPHID' => array( 21 + 'columns' => array('userPHID'), 22 + ), 23 + ), 15 24 ) + parent::getConfiguration(); 16 25 } 17 26
+18
src/applications/owners/storage/PhabricatorOwnersPackage.php
··· 38 38 // This information is better available from the history table. 39 39 self::CONFIG_TIMESTAMPS => false, 40 40 self::CONFIG_AUX_PHID => true, 41 + self::CONFIG_COLUMN_SCHEMA => array( 42 + 'name' => 'text255', 43 + 'originalName' => 'text255', 44 + 'description' => 'text', 45 + 'primaryOwnerPHID' => 'phid?', 46 + 'auditingEnabled' => 'bool', 47 + ), 48 + self::CONFIG_KEY_SCHEMA => array( 49 + 'key_phid' => null, 50 + 'phid' => array( 51 + 'columns' => array('phid'), 52 + 'unique' => true, 53 + ), 54 + 'name' => array( 55 + 'columns' => array('name'), 56 + 'unique' => true, 57 + ), 58 + ), 41 59 ) + parent::getConfiguration(); 42 60 } 43 61
+9
src/applications/owners/storage/PhabricatorOwnersPath.php
··· 10 10 public function getConfiguration() { 11 11 return array( 12 12 self::CONFIG_TIMESTAMPS => false, 13 + self::CONFIG_COLUMN_SCHEMA => array( 14 + 'path' => 'text255', 15 + 'excluded' => 'bool', 16 + ), 17 + self::CONFIG_KEY_SCHEMA => array( 18 + 'packageID' => array( 19 + 'columns' => array('packageID'), 20 + ), 21 + ), 13 22 ) + parent::getConfiguration(); 14 23 } 15 24
+9
src/applications/owners/storage/PhabricatorOwnersSchemaSpec.php
··· 1 + <?php 2 + 3 + final class PhabricatorOwnersSchemaSpec extends PhabricatorConfigSchemaSpec { 4 + 5 + public function buildSchemata() { 6 + $this->buildLiskSchemata('PhabricatorOwnersDAO'); 7 + } 8 + 9 + }