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

Add a generic object for unit tests

Summary:
A later diff adds unit tests against edges, but we need real objects to connect with edges. Add some trivial objects to the Harbormaster database to compliment the similar HarbormasterScratchTable.
On its own, this does nothing interesting.

Test Plan: Built unit tests on this in a followup.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1162

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

+66
+23
resources/sql/patches/harbormasterobject.sql
··· 1 + CREATE TABLE {$NAMESPACE}_harbormaster.harbormaster_object ( 2 + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, 3 + phid VARCHAR(64) NOT NULL COLLATE utf8_bin, 4 + name VARCHAR(255) COLLATE utf8_general_ci, 5 + dateCreated INT UNSIGNED NOT NULL, 6 + dateModified INT UNSIGNED NOT NULL 7 + ); 8 + 9 + CREATE TABLE {$NAMESPACE}_harbormaster.edge ( 10 + src VARCHAR(64) NOT NULL COLLATE utf8_bin, 11 + type VARCHAR(64) NOT NULL COLLATE utf8_bin, 12 + dst VARCHAR(64) NOT NULL COLLATE utf8_bin, 13 + dateCreated INT UNSIGNED NOT NULL, 14 + seq INT UNSIGNED NOT NULL, 15 + dataID INT UNSIGNED, 16 + PRIMARY KEY (src, type, dst), 17 + KEY (src, type, dateCreated, seq) 18 + ) ENGINE=InnoDB, COLLATE utf8_general_ci; 19 + 20 + CREATE TABLE {$NAMESPACE}_harbormaster.edgedata ( 21 + id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, 22 + data LONGTEXT NOT NULL COLLATE utf8_bin 23 + ) ENGINE=InnoDB, COLLATE utf8_general_ci;
+2
src/__phutil_library_map__.php
··· 439 439 'DrydockSSHCommandInterface' => 'applications/drydock/interface/command/DrydockSSHCommandInterface.php', 440 440 'DrydockWebrootInterface' => 'applications/drydock/interface/webroot/DrydockWebrootInterface.php', 441 441 'HarbormasterDAO' => 'applications/harbormaster/storage/HarbormasterDAO.php', 442 + 'HarbormasterObject' => 'applications/harbormaster/storage/HarbormasterObject.php', 442 443 'HarbormasterScratchTable' => 'applications/harbormaster/storage/HarbormasterScratchTable.php', 443 444 'HeraldAction' => 'applications/herald/storage/HeraldAction.php', 444 445 'HeraldActionConfig' => 'applications/herald/config/HeraldActionConfig.php', ··· 1488 1489 'DrydockSSHCommandInterface' => 'DrydockCommandInterface', 1489 1490 'DrydockWebrootInterface' => 'DrydockInterface', 1490 1491 'HarbormasterDAO' => 'PhabricatorLiskDAO', 1492 + 'HarbormasterObject' => 'HarbormasterDAO', 1491 1493 'HarbormasterScratchTable' => 'HarbormasterDAO', 1492 1494 'HeraldAction' => 'HeraldDAO', 1493 1495 'HeraldApplyTranscript' => 'HeraldDAO',
+35
src/applications/harbormaster/storage/HarbormasterObject.php
··· 1 + <?php 2 + 3 + /* 4 + * Copyright 2012 Facebook, Inc. 5 + * 6 + * Licensed under the Apache License, Version 2.0 (the "License"); 7 + * you may not use this file except in compliance with the License. 8 + * You may obtain a copy of the License at 9 + * 10 + * http://www.apache.org/licenses/LICENSE-2.0 11 + * 12 + * Unless required by applicable law or agreed to in writing, software 13 + * distributed under the License is distributed on an "AS IS" BASIS, 14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 + * See the License for the specific language governing permissions and 16 + * limitations under the License. 17 + */ 18 + 19 + final class HarbormasterObject extends HarbormasterDAO { 20 + 21 + protected $phid; 22 + protected $name; 23 + 24 + public function getConfiguration() { 25 + return array( 26 + self::CONFIG_AUX_PHID => true, 27 + ) + parent::getConfiguration(); 28 + } 29 + 30 + public function generatePHID() { 31 + return PhabricatorPHID::generateNewPHID( 32 + PhabricatorPHIDConstants::PHID_TYPE_TOBJ); 33 + } 34 + 35 + }
+2
src/applications/phid/PhabricatorPHIDConstants.php
··· 40 40 const PHID_TYPE_OASC = 'OASC'; 41 41 const PHID_TYPE_OASA = 'OASA'; 42 42 const PHID_TYPE_POST = 'POST'; 43 + const PHID_TYPE_TOBJ = 'TOBJ'; 44 + 43 45 }
+4
src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
··· 899 899 'type' => 'sql', 900 900 'name' => $this->getPatchPath('differentialbookmarks.sql'), 901 901 ), 902 + 'harbormasterobject.sql' => array( 903 + 'type' => 'sql', 904 + 'name' => $this->getPatchPath('harbormasterobject.sql'), 905 + ), 902 906 ); 903 907 } 904 908