@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 PHIDs to DifferentialComments

Summary:
Ref T2222. This adds PHIDs to all Differential comments so I can migrate the inlinecommment table to transaction_comment in the next diff.

@wez, this will issue a few million queries for Facebook (roughly, one for each Differential comment ever made). It's safe to skip the `.php` half of the patch, bring Phabricator up normally, and then apply this patch with Phabricator running if that eases the migration, although the next few diffs will probably be downtime-required migrations so maybe it's easier to just schedule some downtime.

Test Plan: Ran migration locally. Verified existing comments and new comments received PHIDs.

Reviewers: btrahan

Reviewed By: btrahan

CC: wez, aran

Maniphest Tasks: T2222

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

+88 -45
+5
resources/sql/patches/20130621.diffcommentphid.sql
··· 1 + ALTER TABLE {$NAMESPACE}_differential.differential_comment 2 + ADD phid VARCHAR(64) NOT NULL COLLATE utf8_bin; 3 + 4 + ALTER TABLE {$NAMESPACE}_differential.differential_comment 5 + ADD KEY `key_phid` (phid);
+23
resources/sql/patches/20130621.diffcommentphidmig.php
··· 1 + <?php 2 + 3 + $conn = id(new DifferentialRevision())->establishConnection('r'); 4 + 5 + echo "Assigning transaction PHIDs to DifferentialComments.\n"; 6 + foreach (new LiskRawMigrationIterator($conn, 'differential_comment') as $row) { 7 + $id = $row['id']; 8 + echo "Migrating comment #{$id}...\n"; 9 + if ($row['phid']) { 10 + continue; 11 + } 12 + 13 + queryfx( 14 + $conn, 15 + 'UPDATE %T SET phid = %s WHERE id = %d', 16 + 'differential_comment', 17 + PhabricatorPHID::generateNewPHID( 18 + PhabricatorPHIDConstants::PHID_TYPE_XACT, 19 + PhabricatorPHIDConstants::PHID_TYPE_DREV), 20 + $id); 21 + } 22 + 23 + echo "Done.\n";
+45 -45
src/__celerity_resource_map__.php
··· 3723 3723 ), 3724 3724 'phui-form-css' => 3725 3725 array( 3726 - 'uri' => '/res/eb478e83/rsrc/css/phui/phui-form.css', 3726 + 'uri' => '/res/c02b6db7/rsrc/css/phui/phui-form.css', 3727 3727 'type' => 'css', 3728 3728 'requires' => 3729 3729 array( ··· 4057 4057 ), array( 4058 4058 'packages' => 4059 4059 array( 4060 - '695153c6' => 4060 + 'e8febb7b' => 4061 4061 array( 4062 4062 'name' => 'core.pkg.css', 4063 4063 'symbols' => ··· 4105 4105 40 => 'phabricator-property-list-view-css', 4106 4106 41 => 'phabricator-tag-view-css', 4107 4107 ), 4108 - 'uri' => '/res/pkg/695153c6/core.pkg.css', 4108 + 'uri' => '/res/pkg/e8febb7b/core.pkg.css', 4109 4109 'type' => 'css', 4110 4110 ), 4111 4111 'f2ad0683' => ··· 4299 4299 'reverse' => 4300 4300 array( 4301 4301 'aphront-attached-file-view-css' => 'adc3c36d', 4302 - 'aphront-dialog-view-css' => '695153c6', 4303 - 'aphront-error-view-css' => '695153c6', 4304 - 'aphront-form-view-css' => '695153c6', 4305 - 'aphront-list-filter-view-css' => '695153c6', 4306 - 'aphront-pager-view-css' => '695153c6', 4307 - 'aphront-panel-view-css' => '695153c6', 4308 - 'aphront-table-view-css' => '695153c6', 4309 - 'aphront-tokenizer-control-css' => '695153c6', 4310 - 'aphront-tooltip-css' => '695153c6', 4311 - 'aphront-typeahead-control-css' => '695153c6', 4302 + 'aphront-dialog-view-css' => 'e8febb7b', 4303 + 'aphront-error-view-css' => 'e8febb7b', 4304 + 'aphront-form-view-css' => 'e8febb7b', 4305 + 'aphront-list-filter-view-css' => 'e8febb7b', 4306 + 'aphront-pager-view-css' => 'e8febb7b', 4307 + 'aphront-panel-view-css' => 'e8febb7b', 4308 + 'aphront-table-view-css' => 'e8febb7b', 4309 + 'aphront-tokenizer-control-css' => 'e8febb7b', 4310 + 'aphront-tooltip-css' => 'e8febb7b', 4311 + 'aphront-typeahead-control-css' => 'e8febb7b', 4312 4312 'differential-changeset-view-css' => 'dd27a69b', 4313 4313 'differential-core-view-css' => 'dd27a69b', 4314 4314 'differential-inline-comment-editor' => '9488bb69', ··· 4322 4322 'differential-table-of-contents-css' => 'dd27a69b', 4323 4323 'diffusion-commit-view-css' => 'c8ce2d88', 4324 4324 'diffusion-icons-css' => 'c8ce2d88', 4325 - 'global-drag-and-drop-css' => '695153c6', 4325 + 'global-drag-and-drop-css' => 'e8febb7b', 4326 4326 'inline-comment-summary-css' => 'dd27a69b', 4327 4327 'javelin-aphlict' => 'f2ad0683', 4328 4328 'javelin-behavior' => 'a9f14d76', ··· 4396 4396 'javelin-util' => 'a9f14d76', 4397 4397 'javelin-vector' => 'a9f14d76', 4398 4398 'javelin-workflow' => 'a9f14d76', 4399 - 'lightbox-attachment-css' => '695153c6', 4399 + 'lightbox-attachment-css' => 'e8febb7b', 4400 4400 'maniphest-task-summary-css' => 'adc3c36d', 4401 4401 'maniphest-transaction-detail-css' => 'adc3c36d', 4402 - 'phabricator-action-list-view-css' => '695153c6', 4403 - 'phabricator-application-launch-view-css' => '695153c6', 4402 + 'phabricator-action-list-view-css' => 'e8febb7b', 4403 + 'phabricator-application-launch-view-css' => 'e8febb7b', 4404 4404 'phabricator-busy' => 'f2ad0683', 4405 4405 'phabricator-content-source-view-css' => 'dd27a69b', 4406 - 'phabricator-core-css' => '695153c6', 4407 - 'phabricator-crumbs-view-css' => '695153c6', 4406 + 'phabricator-core-css' => 'e8febb7b', 4407 + 'phabricator-crumbs-view-css' => 'e8febb7b', 4408 4408 'phabricator-drag-and-drop-file-upload' => '9488bb69', 4409 4409 'phabricator-dropdown-menu' => 'f2ad0683', 4410 4410 'phabricator-file-upload' => 'f2ad0683', 4411 - 'phabricator-filetree-view-css' => '695153c6', 4412 - 'phabricator-flag-css' => '695153c6', 4413 - 'phabricator-form-view-css' => '695153c6', 4414 - 'phabricator-header-view-css' => '695153c6', 4411 + 'phabricator-filetree-view-css' => 'e8febb7b', 4412 + 'phabricator-flag-css' => 'e8febb7b', 4413 + 'phabricator-form-view-css' => 'e8febb7b', 4414 + 'phabricator-header-view-css' => 'e8febb7b', 4415 4415 'phabricator-hovercard' => 'f2ad0683', 4416 - 'phabricator-jump-nav' => '695153c6', 4416 + 'phabricator-jump-nav' => 'e8febb7b', 4417 4417 'phabricator-keyboard-shortcut' => 'f2ad0683', 4418 4418 'phabricator-keyboard-shortcut-manager' => 'f2ad0683', 4419 - 'phabricator-main-menu-view' => '695153c6', 4419 + 'phabricator-main-menu-view' => 'e8febb7b', 4420 4420 'phabricator-menu-item' => 'f2ad0683', 4421 - 'phabricator-nav-view-css' => '695153c6', 4421 + 'phabricator-nav-view-css' => 'e8febb7b', 4422 4422 'phabricator-notification' => 'f2ad0683', 4423 - 'phabricator-notification-css' => '695153c6', 4424 - 'phabricator-notification-menu-css' => '695153c6', 4425 - 'phabricator-object-item-list-view-css' => '695153c6', 4423 + 'phabricator-notification-css' => 'e8febb7b', 4424 + 'phabricator-notification-menu-css' => 'e8febb7b', 4425 + 'phabricator-object-item-list-view-css' => 'e8febb7b', 4426 4426 'phabricator-object-selector-css' => 'dd27a69b', 4427 4427 'phabricator-phtize' => 'f2ad0683', 4428 4428 'phabricator-prefab' => 'f2ad0683', 4429 4429 'phabricator-project-tag-css' => 'adc3c36d', 4430 - 'phabricator-property-list-view-css' => '695153c6', 4431 - 'phabricator-remarkup-css' => '695153c6', 4430 + 'phabricator-property-list-view-css' => 'e8febb7b', 4431 + 'phabricator-remarkup-css' => 'e8febb7b', 4432 4432 'phabricator-shaped-request' => '9488bb69', 4433 - 'phabricator-side-menu-view-css' => '695153c6', 4434 - 'phabricator-standard-page-view' => '695153c6', 4435 - 'phabricator-tag-view-css' => '695153c6', 4433 + 'phabricator-side-menu-view-css' => 'e8febb7b', 4434 + 'phabricator-standard-page-view' => 'e8febb7b', 4435 + 'phabricator-tag-view-css' => 'e8febb7b', 4436 4436 'phabricator-textareautils' => 'f2ad0683', 4437 4437 'phabricator-tooltip' => 'f2ad0683', 4438 - 'phabricator-transaction-view-css' => '695153c6', 4439 - 'phabricator-zindex-css' => '695153c6', 4440 - 'phui-button-css' => '695153c6', 4441 - 'phui-form-css' => '695153c6', 4442 - 'phui-icon-view-css' => '695153c6', 4443 - 'phui-spacing-css' => '695153c6', 4444 - 'sprite-apps-large-css' => '695153c6', 4445 - 'sprite-gradient-css' => '695153c6', 4446 - 'sprite-icons-css' => '695153c6', 4447 - 'sprite-menu-css' => '695153c6', 4448 - 'syntax-highlighting-css' => '695153c6', 4438 + 'phabricator-transaction-view-css' => 'e8febb7b', 4439 + 'phabricator-zindex-css' => 'e8febb7b', 4440 + 'phui-button-css' => 'e8febb7b', 4441 + 'phui-form-css' => 'e8febb7b', 4442 + 'phui-icon-view-css' => 'e8febb7b', 4443 + 'phui-spacing-css' => 'e8febb7b', 4444 + 'sprite-apps-large-css' => 'e8febb7b', 4445 + 'sprite-gradient-css' => 'e8febb7b', 4446 + 'sprite-icons-css' => 'e8febb7b', 4447 + 'sprite-menu-css' => 'e8febb7b', 4448 + 'syntax-highlighting-css' => 'e8febb7b', 4449 4449 ), 4450 4450 ));
+7
src/applications/differential/storage/DifferentialComment.php
··· 20 20 21 21 private $arbitraryDiffForFacebook; 22 22 23 + public function generatePHID() { 24 + return PhabricatorPHID::generateNewPHID( 25 + PhabricatorPHIDConstants::PHID_TYPE_XACT, 26 + PhabricatorPHIDConstants::PHID_TYPE_DREV); 27 + } 28 + 23 29 public function giveFacebookSomeArbitraryDiff(DifferentialDiff $diff) { 24 30 $this->arbitraryDiffForFacebook = $diff; 25 31 return $this; ··· 27 33 28 34 public function getConfiguration() { 29 35 return array( 36 + self::CONFIG_AUX_PHID => true, 30 37 self::CONFIG_SERIALIZATION => array( 31 38 'metadata' => self::SERIALIZATION_JSON, 32 39 ),
+8
src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
··· 1382 1382 'type' => 'sql', 1383 1383 'name' => $this->getPatchPath('20130620.diffxactions.sql'), 1384 1384 ), 1385 + '20130621.diffcommentphid.sql' => array( 1386 + 'type' => 'sql', 1387 + 'name' => $this->getPatchPath('20130621.diffcommentphid.sql'), 1388 + ), 1389 + '20130621.diffcommentphidmig.php' => array( 1390 + 'type' => 'php', 1391 + 'name' => $this->getPatchPath('20130621.diffcommentphidmig.php'), 1392 + ), 1385 1393 ); 1386 1394 } 1387 1395 }