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

Give HarbormasterBuildLogChunk a real table

Summary:
Ref T10457. Currently, this table is an ad-hoc table, but can easily be turned into a normal table.

This will make iterating over log chunks to compress and archive them easier.

Test Plan: Viewed logs, ran `bin/storage adjust` with no issues.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10457

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

+37 -28
+2
src/__phutil_library_map__.php
··· 1044 1044 'HarbormasterBuildGraph' => 'applications/harbormaster/engine/HarbormasterBuildGraph.php', 1045 1045 'HarbormasterBuildLintMessage' => 'applications/harbormaster/storage/build/HarbormasterBuildLintMessage.php', 1046 1046 'HarbormasterBuildLog' => 'applications/harbormaster/storage/build/HarbormasterBuildLog.php', 1047 + 'HarbormasterBuildLogChunk' => 'applications/harbormaster/storage/build/HarbormasterBuildLogChunk.php', 1047 1048 'HarbormasterBuildLogPHIDType' => 'applications/harbormaster/phid/HarbormasterBuildLogPHIDType.php', 1048 1049 'HarbormasterBuildLogQuery' => 'applications/harbormaster/query/HarbormasterBuildLogQuery.php', 1049 1050 'HarbormasterBuildMessage' => 'applications/harbormaster/storage/HarbormasterBuildMessage.php', ··· 5191 5192 'HarbormasterDAO', 5192 5193 'PhabricatorPolicyInterface', 5193 5194 ), 5195 + 'HarbormasterBuildLogChunk' => 'HarbormasterDAO', 5194 5196 'HarbormasterBuildLogPHIDType' => 'PhabricatorPHIDType', 5195 5197 'HarbormasterBuildLogQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 5196 5198 'HarbormasterBuildMessage' => array(
-25
src/applications/harbormaster/storage/HarbormasterSchemaSpec.php
··· 21 21 ), 22 22 )); 23 23 24 - 25 - $this->buildRawSchema( 26 - id(new HarbormasterBuildable())->getApplicationName(), 27 - HarbormasterBuildLog::CHUNK_TABLE, 28 - array( 29 - 'id' => 'auto', 30 - 'logID' => 'id', 31 - 'encoding' => 'text32', 32 - 33 - // T6203/NULLABILITY 34 - // Both the type and nullability of this column are crazily wrong. 35 - 'size' => 'uint32?', 36 - 37 - 'chunk' => 'bytes', 38 - ), 39 - array( 40 - 'PRIMARY' => array( 41 - 'columns' => array('id'), 42 - 'unique' => true, 43 - ), 44 - 'key_log' => array( 45 - 'columns' => array('logID'), 46 - ), 47 - )); 48 - 49 24 } 50 25 51 26 }
+3 -3
src/applications/harbormaster/storage/build/HarbormasterBuildLog.php
··· 15 15 private $isOpen; 16 16 17 17 const CHUNK_BYTE_LIMIT = 102400; 18 - const CHUNK_TABLE = 'harbormaster_buildlogchunk'; 19 18 20 19 /** 21 20 * The log is encoded as plain text. ··· 128 127 // caller writes a single character over and over again, we'll currently 129 128 // spend a lot of time flushing that. 130 129 131 - $chunk_table = self::CHUNK_TABLE; 130 + $chunk_table = id(new HarbormasterBuildLogChunk())->getTableName(); 132 131 $chunk_limit = self::CHUNK_BYTE_LIMIT; 133 132 $rope = $this->rope; 134 133 ··· 198 197 $result = queryfx_all( 199 198 $conn, 200 199 'SELECT chunk '. 201 - 'FROM harbormaster_buildlogchunk '. 200 + 'FROM %T '. 202 201 'WHERE logID = %d '. 203 202 'ORDER BY id ASC', 203 + id(new HarbormasterBuildLogChunk())->getTableName(), 204 204 $this->getID()); 205 205 206 206 $content = '';
+32
src/applications/harbormaster/storage/build/HarbormasterBuildLogChunk.php
··· 1 + <?php 2 + 3 + final class HarbormasterBuildLogChunk 4 + extends HarbormasterDAO { 5 + 6 + protected $logID; 7 + protected $encoding; 8 + protected $size; 9 + protected $chunk; 10 + 11 + protected function getConfiguration() { 12 + return array( 13 + self::CONFIG_TIMESTAMPS => false, 14 + self::CONFIG_COLUMN_SCHEMA => array( 15 + 'logID' => 'id', 16 + 'encoding' => 'text32', 17 + 18 + // T6203/NULLABILITY 19 + // Both the type and nullability of this column are crazily wrong. 20 + 'size' => 'uint32?', 21 + 22 + 'chunk' => 'bytes', 23 + ), 24 + self::CONFIG_KEY_SCHEMA => array( 25 + 'key_log' => array( 26 + 'columns' => array('logID'), 27 + ), 28 + ), 29 + ) + parent::getConfiguration(); 30 + } 31 + 32 + }