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

Summary:
Ref T1191. Nothing too notable here:

- Allow a Lisk object to specify that there's no expectation that a table exists. We have one Harbormaster object and one Token object like this.
- Removed BuildPlanTransactionComment because it's currently unused.

Test Plan:
- Saw ~200 fewer warnings; just ~800 left.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T1191

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

+192 -19
+2 -2
src/__phutil_library_map__.php
··· 710 710 'HarbormasterBuildPlanQuery' => 'applications/harbormaster/query/HarbormasterBuildPlanQuery.php', 711 711 'HarbormasterBuildPlanSearchEngine' => 'applications/harbormaster/query/HarbormasterBuildPlanSearchEngine.php', 712 712 'HarbormasterBuildPlanTransaction' => 'applications/harbormaster/storage/configuration/HarbormasterBuildPlanTransaction.php', 713 - 'HarbormasterBuildPlanTransactionComment' => 'applications/harbormaster/storage/configuration/HarbormasterBuildPlanTransactionComment.php', 714 713 'HarbormasterBuildPlanTransactionQuery' => 'applications/harbormaster/query/HarbormasterBuildPlanTransactionQuery.php', 715 714 'HarbormasterBuildQuery' => 'applications/harbormaster/query/HarbormasterBuildQuery.php', 716 715 'HarbormasterBuildStep' => 'applications/harbormaster/storage/configuration/HarbormasterBuildStep.php', ··· 762 761 'HarbormasterQueryBuildablesConduitAPIMethod' => 'applications/harbormaster/conduit/HarbormasterQueryBuildablesConduitAPIMethod.php', 763 762 'HarbormasterQueryBuildsConduitAPIMethod' => 'applications/harbormaster/conduit/HarbormasterQueryBuildsConduitAPIMethod.php', 764 763 'HarbormasterRemarkupRule' => 'applications/harbormaster/remarkup/HarbormasterRemarkupRule.php', 764 + 'HarbormasterSchemaSpec' => 'applications/harbormaster/storage/HarbormasterSchemaSpec.php', 765 765 'HarbormasterScratchTable' => 'applications/harbormaster/storage/HarbormasterScratchTable.php', 766 766 'HarbormasterSendMessageConduitAPIMethod' => 'applications/harbormaster/conduit/HarbormasterSendMessageConduitAPIMethod.php', 767 767 'HarbormasterSleepBuildStepImplementation' => 'applications/harbormaster/step/HarbormasterSleepBuildStepImplementation.php', ··· 3585 3585 'HarbormasterBuildPlanQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 3586 3586 'HarbormasterBuildPlanSearchEngine' => 'PhabricatorApplicationSearchEngine', 3587 3587 'HarbormasterBuildPlanTransaction' => 'PhabricatorApplicationTransaction', 3588 - 'HarbormasterBuildPlanTransactionComment' => 'PhabricatorApplicationTransactionComment', 3589 3588 'HarbormasterBuildPlanTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 3590 3589 'HarbormasterBuildQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 3591 3590 'HarbormasterBuildStep' => array( ··· 3649 3648 'HarbormasterQueryBuildablesConduitAPIMethod' => 'HarbormasterConduitAPIMethod', 3650 3649 'HarbormasterQueryBuildsConduitAPIMethod' => 'HarbormasterConduitAPIMethod', 3651 3650 'HarbormasterRemarkupRule' => 'PhabricatorObjectRemarkupRule', 3651 + 'HarbormasterSchemaSpec' => 'PhabricatorConfigSchemaSpec', 3652 3652 'HarbormasterScratchTable' => 'HarbormasterDAO', 3653 3653 'HarbormasterSendMessageConduitAPIMethod' => 'HarbormasterConduitAPIMethod', 3654 3654 'HarbormasterSleepBuildStepImplementation' => 'HarbormasterBuildStepImplementation',
+3
src/applications/config/schema/PhabricatorConfigSchemaSpec.php
··· 42 42 ->loadObjects(); 43 43 44 44 foreach ($objects as $object) { 45 + if ($object->getConfigOption(LiskDAO::CONFIG_NO_TABLE)) { 46 + continue; 47 + } 45 48 $this->buildLiskObjectSchema($object); 46 49 } 47 50 }
+13
src/applications/harbormaster/storage/HarbormasterBuildCommand.php
··· 10 10 protected $targetPHID; 11 11 protected $command; 12 12 13 + public function getConfiguration() { 14 + return array( 15 + self::CONFIG_COLUMN_SCHEMA => array( 16 + 'command' => 'text128', 17 + ), 18 + self::CONFIG_KEY_SCHEMA => array( 19 + 'key_target' => array( 20 + 'columns' => array('targetPHID'), 21 + ), 22 + ), 23 + ) + parent::getConfiguration(); 24 + } 25 + 13 26 }
+14
src/applications/harbormaster/storage/HarbormasterBuildMessage.php
··· 22 22 ->setIsConsumed(0); 23 23 } 24 24 25 + public function getConfiguration() { 26 + return array( 27 + self::CONFIG_COLUMN_SCHEMA => array( 28 + 'type' => 'text16', 29 + 'isConsumed' => 'bool', 30 + ), 31 + self::CONFIG_KEY_SCHEMA => array( 32 + 'key_buildtarget' => array( 33 + 'columns' => array('buildTargetPHID'), 34 + ), 35 + ), 36 + ) + parent::getConfiguration(); 37 + } 38 + 25 39 public function getBuildTarget() { 26 40 return $this->assertAttached($this->buildTarget); 27 41 }
+16
src/applications/harbormaster/storage/HarbormasterBuildable.php
··· 155 155 public function getConfiguration() { 156 156 return array( 157 157 self::CONFIG_AUX_PHID => true, 158 + self::CONFIG_COLUMN_SCHEMA => array( 159 + 'containerPHID' => 'phid?', 160 + 'buildableStatus' => 'text32', 161 + 'isManualBuildable' => 'bool', 162 + ), 163 + self::CONFIG_KEY_SCHEMA => array( 164 + 'key_buildable' => array( 165 + 'columns' => array('buildablePHID'), 166 + ), 167 + 'key_container' => array( 168 + 'columns' => array('containerPHID'), 169 + ), 170 + 'key_manual' => array( 171 + 'columns' => array('isManualBuildable'), 172 + ), 173 + ), 158 174 ) + parent::getConfiguration(); 159 175 } 160 176
+3 -1
src/applications/harbormaster/storage/HarbormasterObject.php
··· 2 2 3 3 final class HarbormasterObject extends HarbormasterDAO { 4 4 5 - protected $phid; 6 5 protected $name; 7 6 8 7 public function getConfiguration() { 9 8 return array( 10 9 self::CONFIG_AUX_PHID => true, 10 + self::CONFIG_COLUMN_SCHEMA => array( 11 + 'name' => 'text255', 12 + ), 11 13 ) + parent::getConfiguration(); 12 14 } 13 15
+45
src/applications/harbormaster/storage/HarbormasterSchemaSpec.php
··· 1 + <?php 2 + 3 + final class HarbormasterSchemaSpec extends PhabricatorConfigSchemaSpec { 4 + 5 + public function buildSchemata() { 6 + $this->buildLiskSchemata('HarbormasterDAO'); 7 + 8 + $this->buildEdgeSchemata(new HarbormasterBuildable()); 9 + $this->buildCounterSchema(new HarbormasterBuildable()); 10 + 11 + $this->buildTransactionSchema( 12 + new HarbormasterBuildableTransaction()); 13 + 14 + $this->buildTransactionSchema( 15 + new HarbormasterBuildTransaction()); 16 + 17 + $this->buildTransactionSchema( 18 + new HarbormasterBuildPlanTransaction()); 19 + 20 + $this->buildTransactionSchema( 21 + new HarbormasterBuildStepTransaction()); 22 + 23 + $this->buildRawSchema( 24 + id(new HarbormasterBuildable())->getApplicationName(), 25 + 'harbormaster_buildlogchunk', 26 + array( 27 + 'id' => 'id', 28 + 'logID' => 'id', 29 + 'encoding' => 'text32', 30 + 'size' => 'uint32', 31 + 'chunk' => 'bytes', 32 + ), 33 + array( 34 + 'PRIMARY' => array( 35 + 'columns' => array('id'), 36 + 'unique' => true, 37 + ), 38 + 'key_log' => array( 39 + 'columns' => array('logID'), 40 + ), 41 + )); 42 + 43 + } 44 + 45 + }
+14
src/applications/harbormaster/storage/HarbormasterScratchTable.php
··· 11 11 protected $data; 12 12 protected $bigData; 13 13 14 + public function getConfiguration() { 15 + return array( 16 + self::CONFIG_COLUMN_SCHEMA => array( 17 + 'data' => 'text64', 18 + 'bigData' => 'text?', 19 + ), 20 + self::CONFIG_KEY_SCHEMA => array( 21 + 'data' => array( 22 + 'columns' => array('data'), 23 + ), 24 + ), 25 + ) + parent::getConfiguration(); 26 + } 27 + 14 28 }
+15
src/applications/harbormaster/storage/build/HarbormasterBuild.php
··· 143 143 public function getConfiguration() { 144 144 return array( 145 145 self::CONFIG_AUX_PHID => true, 146 + self::CONFIG_COLUMN_SCHEMA => array( 147 + 'buildStatus' => 'text32', 148 + 'buildGeneration' => 'uint32', 149 + ), 150 + self::CONFIG_KEY_SCHEMA => array( 151 + 'key_buildable' => array( 152 + 'columns' => array('buildablePHID'), 153 + ), 154 + 'key_plan' => array( 155 + 'columns' => array('buildPlanPHID'), 156 + ), 157 + 'key_status' => array( 158 + 'columns' => array('buildStatus'), 159 + ), 160 + ), 146 161 ) + parent::getConfiguration(); 147 162 } 148 163
+14
src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php
··· 26 26 self::CONFIG_SERIALIZATION => array( 27 27 'artifactData' => self::SERIALIZATION_JSON, 28 28 ), 29 + self::CONFIG_COLUMN_SCHEMA => array( 30 + 'artifactType' => 'text32', 31 + 'artifactIndex' => 'bytes12', 32 + 'artifactKey' => 'text255', 33 + ), 34 + self::CONFIG_KEY_SCHEMA => array( 35 + 'key_artifact' => array( 36 + 'columns' => array('artifactType', 'artifactIndex'), 37 + 'unique' => true, 38 + ), 39 + 'key_garbagecollect' => array( 40 + 'columns' => array('artifactType', 'dateCreated'), 41 + ), 42 + ), 29 43 ) + parent::getConfiguration(); 30 44 } 31 45
+1
src/applications/harbormaster/storage/build/HarbormasterBuildItem.php
··· 7 7 public function getConfiguration() { 8 8 return array( 9 9 self::CONFIG_AUX_PHID => true, 10 + self::CONFIG_NO_TABLE => true, 10 11 ) + parent::getConfiguration(); 11 12 } 12 13
+11
src/applications/harbormaster/storage/build/HarbormasterBuildLog.php
··· 30 30 public function getConfiguration() { 31 31 return array( 32 32 self::CONFIG_AUX_PHID => true, 33 + self::CONFIG_COLUMN_SCHEMA => array( 34 + 'logSource' => 'text255', 35 + 'logType' => 'text255', 36 + 'duration' => 'uint32', 37 + 'live' => 'bool', 38 + ), 39 + self::CONFIG_KEY_SCHEMA => array( 40 + 'key_buildtarget' => array( 41 + 'columns' => array('buildTargetPHID'), 42 + ), 43 + ), 33 44 ) + parent::getConfiguration(); 34 45 } 35 46
+14 -1
src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php
··· 99 99 self::CONFIG_SERIALIZATION => array( 100 100 'details' => self::SERIALIZATION_JSON, 101 101 'variables' => self::SERIALIZATION_JSON, 102 - ) 102 + ), 103 + self::CONFIG_COLUMN_SCHEMA => array( 104 + 'className' => 'text255', 105 + 'targetStatus' => 'text64', 106 + 'name' => 'text255', 107 + 'dateStarted' => 'epoch?', 108 + 'dateCompleted' => 'epoch?', 109 + 'buildGeneration' => 'uint32', 110 + ), 111 + self::CONFIG_KEY_SCHEMA => array( 112 + 'key_build' => array( 113 + 'columns' => array('buildPHID', 'buildStepPHID'), 114 + ), 115 + ), 103 116 ) + parent::getConfiguration(); 104 117 } 105 118
+9
src/applications/harbormaster/storage/configuration/HarbormasterBuildPlan.php
··· 21 21 public function getConfiguration() { 22 22 return array( 23 23 self::CONFIG_AUX_PHID => true, 24 + self::CONFIG_COLUMN_SCHEMA => array( 25 + 'name' => 'text255', 26 + 'planStatus' => 'text32', 27 + ), 28 + self::CONFIG_KEY_SCHEMA => array( 29 + 'key_status' => array( 30 + 'columns' => array('planStatus'), 31 + ), 32 + ), 24 33 ) + parent::getConfiguration(); 25 34 } 26 35
-4
src/applications/harbormaster/storage/configuration/HarbormasterBuildPlanTransaction.php
··· 14 14 return HarbormasterBuildPlanPHIDType::TYPECONST; 15 15 } 16 16 17 - public function getApplicationTransactionCommentObject() { 18 - return new HarbormasterBuildPlanTransactionComment(); 19 - } 20 - 21 17 public function getIcon() { 22 18 $old = $this->getOldValue(); 23 19 $new = $this->getNewValue();
-10
src/applications/harbormaster/storage/configuration/HarbormasterBuildPlanTransactionComment.php
··· 1 - <?php 2 - 3 - final class HarbormasterBuildPlanTransactionComment 4 - extends PhabricatorApplicationTransactionComment { 5 - 6 - public function getApplicationTransactionObject() { 7 - return new HarbormasterBuildPlan(); 8 - } 9 - 10 - }
+12 -1
src/applications/harbormaster/storage/configuration/HarbormasterBuildStep.php
··· 25 25 self::CONFIG_AUX_PHID => true, 26 26 self::CONFIG_SERIALIZATION => array( 27 27 'details' => self::SERIALIZATION_JSON, 28 - ) 28 + ), 29 + self::CONFIG_COLUMN_SCHEMA => array( 30 + 'className' => 'text255', 31 + 'sequence' => 'uint32', 32 + 'name' => 'text255', 33 + 'description' => 'text', 34 + ), 35 + self::CONFIG_KEY_SCHEMA => array( 36 + 'key_plan' => array( 37 + 'columns' => array('buildPlanPHID'), 38 + ), 39 + ), 29 40 ) + parent::getConfiguration(); 30 41 } 31 42
+1
src/applications/tokens/storage/PhabricatorToken.php
··· 10 10 public function getConfiguration() { 11 11 return array( 12 12 self::CONFIG_AUX_PHID => true, 13 + self::CONFIG_NO_TABLE => true, 13 14 ) + parent::getConfiguration(); 14 15 } 15 16
+5
src/infrastructure/storage/lisk/LiskDAO.php
··· 171 171 const CONFIG_BINARY = 'binary'; 172 172 const CONFIG_COLUMN_SCHEMA = 'col-schema'; 173 173 const CONFIG_KEY_SCHEMA = 'key-schema'; 174 + const CONFIG_NO_TABLE = 'no-table'; 174 175 175 176 const SERIALIZATION_NONE = 'id'; 176 177 const SERIALIZATION_JSON = 'json'; ··· 350 351 * 351 352 * CONFIG_KEY_SCHEMA 352 353 * Provide a map of key names to key specifications. 354 + * 355 + * CONFIG_NO_TABLE 356 + * Allows you to specify that this object does not actually have a table in 357 + * the database. 353 358 * 354 359 * @return dictionary Map of configuration options to values. 355 360 *