diff --git a/resources/sql/autopatches/20150211.renamefeedstory.php b/resources/sql/autopatches/20150211.renamefeedstory.php new file mode 100644 --- /dev/null +++ b/resources/sql/autopatches/20150211.renamefeedstory.php @@ -0,0 +1,30 @@ + 'PhabricatorAggregateFeedStory', + 'PhabricatorFeedStoryAudit' => 'PhabricatorAuditFeedStory', + 'PhabricatorFeedStoryCommit' => 'PhabricatorCommitFeedStory', + 'PhabricatorFeedStoryDifferentialAggregate' + => 'PhabricatorDifferentialAggregateFeedStory', + 'PhabricatorFeedStoryDifferential' => 'PhabricatorDifferentialFeedStory', + 'PhabricatorFeedStoryManiphestAggregate' + => 'PhabricatorManiphestAggregateFeedStory', + 'PhabricatorFeedStoryPhriction' => 'PhabricatorPhrictionFeedStory', + 'PhabricatorNotificationAdHocFeedStory' + => 'PhabricatorAdHocNotificationFeedStory', +); + +echo "Migrating feed stories...\n"; +$table = new PhabricatorFeedStoryData(); +$conn_w = $table->establishConnection('w'); + +foreach (new LiskMigrationIterator($table) as $story_data) { + $story_type = $story_data->getStoryType(); + + queryfx( + $conn_w, + 'UPDATE %T SET storyType = %s WHERE id = %d', + $story_data->getTableName(), + idx($map, $story_type, $story_type), + $story_data->getID()); +} diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1244,7 +1244,9 @@ 'PhabricatorActionListView' => 'view/layout/PhabricatorActionListView.php', 'PhabricatorActionView' => 'view/layout/PhabricatorActionView.php', 'PhabricatorActivitySettingsPanel' => 'applications/settings/panel/PhabricatorActivitySettingsPanel.php', + 'PhabricatorAdHocNotificationFeedStory' => 'applications/notification/feed/PhabricatorAdHocNotificationFeedStory.php', 'PhabricatorAdministratorsPolicyRule' => 'applications/policy/rule/PhabricatorAdministratorsPolicyRule.php', + 'PhabricatorAggregateFeedStory' => 'applications/feed/story/PhabricatorAggregateFeedStory.php', 'PhabricatorAllCapsTranslation' => 'infrastructure/internationalization/translation/PhabricatorAllCapsTranslation.php', 'PhabricatorAlmanacApplication' => 'applications/almanac/application/PhabricatorAlmanacApplication.php', 'PhabricatorAmazonAuthProvider' => 'applications/auth/provider/PhabricatorAmazonAuthProvider.php', @@ -1316,6 +1318,7 @@ 'PhabricatorAuditController' => 'applications/audit/controller/PhabricatorAuditController.php', 'PhabricatorAuditDAO' => 'applications/audit/storage/PhabricatorAuditDAO.php', 'PhabricatorAuditEditor' => 'applications/audit/editor/PhabricatorAuditEditor.php', + 'PhabricatorAuditFeedStory' => 'applications/feed/story/PhabricatorAuditFeedStory.php', 'PhabricatorAuditInlineComment' => 'applications/audit/storage/PhabricatorAuditInlineComment.php', 'PhabricatorAuditListController' => 'applications/audit/controller/PhabricatorAuditListController.php', 'PhabricatorAuditListView' => 'applications/audit/view/PhabricatorAuditListView.php', @@ -1472,6 +1475,7 @@ 'PhabricatorClusterConfigOptions' => 'applications/config/option/PhabricatorClusterConfigOptions.php', 'PhabricatorCommitBranchesField' => 'applications/repository/customfield/PhabricatorCommitBranchesField.php', 'PhabricatorCommitCustomField' => 'applications/repository/customfield/PhabricatorCommitCustomField.php', + 'PhabricatorCommitFeedStory' => 'applications/feed/story/PhabricatorCommitFeedStory.php', 'PhabricatorCommitSearchEngine' => 'applications/audit/query/PhabricatorCommitSearchEngine.php', 'PhabricatorCommitTagsField' => 'applications/repository/customfield/PhabricatorCommitTagsField.php', 'PhabricatorCommonPasswords' => 'applications/auth/constants/PhabricatorCommonPasswords.php', @@ -1679,8 +1683,10 @@ 'PhabricatorDeveloperPreferencesSettingsPanel' => 'applications/settings/panel/PhabricatorDeveloperPreferencesSettingsPanel.php', 'PhabricatorDiffPreferencesSettingsPanel' => 'applications/settings/panel/PhabricatorDiffPreferencesSettingsPanel.php', 'PhabricatorDifferenceEngine' => 'infrastructure/diff/PhabricatorDifferenceEngine.php', + 'PhabricatorDifferentialAggregateFeedStory' => 'applications/feed/story/PhabricatorDifferentialAggregateFeedStory.php', 'PhabricatorDifferentialApplication' => 'applications/differential/application/PhabricatorDifferentialApplication.php', 'PhabricatorDifferentialConfigOptions' => 'applications/differential/config/PhabricatorDifferentialConfigOptions.php', + 'PhabricatorDifferentialFeedStory' => 'applications/feed/story/PhabricatorDifferentialFeedStory.php', 'PhabricatorDifferentialRevisionTestDataGenerator' => 'applications/differential/lipsum/PhabricatorDifferentialRevisionTestDataGenerator.php', 'PhabricatorDiffusionApplication' => 'applications/diffusion/application/PhabricatorDiffusionApplication.php', 'PhabricatorDiffusionConfigOptions' => 'applications/diffusion/config/PhabricatorDiffusionConfigOptions.php', @@ -1760,15 +1766,8 @@ 'PhabricatorFeedQuery' => 'applications/feed/query/PhabricatorFeedQuery.php', 'PhabricatorFeedSearchEngine' => 'applications/feed/query/PhabricatorFeedSearchEngine.php', 'PhabricatorFeedStory' => 'applications/feed/story/PhabricatorFeedStory.php', - 'PhabricatorFeedStoryAggregate' => 'applications/feed/story/PhabricatorFeedStoryAggregate.php', - 'PhabricatorFeedStoryAudit' => 'applications/feed/story/PhabricatorFeedStoryAudit.php', - 'PhabricatorFeedStoryCommit' => 'applications/feed/story/PhabricatorFeedStoryCommit.php', 'PhabricatorFeedStoryData' => 'applications/feed/storage/PhabricatorFeedStoryData.php', - 'PhabricatorFeedStoryDifferential' => 'applications/feed/story/PhabricatorFeedStoryDifferential.php', - 'PhabricatorFeedStoryDifferentialAggregate' => 'applications/feed/story/PhabricatorFeedStoryDifferentialAggregate.php', - 'PhabricatorFeedStoryManiphestAggregate' => 'applications/feed/story/PhabricatorFeedStoryManiphestAggregate.php', 'PhabricatorFeedStoryNotification' => 'applications/notification/storage/PhabricatorFeedStoryNotification.php', - 'PhabricatorFeedStoryPhriction' => 'applications/feed/story/PhabricatorFeedStoryPhriction.php', 'PhabricatorFeedStoryPublisher' => 'applications/feed/PhabricatorFeedStoryPublisher.php', 'PhabricatorFeedStoryReference' => 'applications/feed/storage/PhabricatorFeedStoryReference.php', 'PhabricatorFile' => 'applications/files/storage/PhabricatorFile.php', @@ -1953,6 +1952,7 @@ 'PhabricatorMainMenuSearchView' => 'view/page/menu/PhabricatorMainMenuSearchView.php', 'PhabricatorMainMenuView' => 'view/page/menu/PhabricatorMainMenuView.php', 'PhabricatorManagementWorkflow' => 'infrastructure/management/PhabricatorManagementWorkflow.php', + 'PhabricatorManiphestAggregateFeedStory' => 'applications/feed/story/PhabricatorManiphestAggregateFeedStory.php', 'PhabricatorManiphestApplication' => 'applications/maniphest/application/PhabricatorManiphestApplication.php', 'PhabricatorManiphestConfigOptions' => 'applications/maniphest/config/PhabricatorManiphestConfigOptions.php', 'PhabricatorManiphestTaskTestDataGenerator' => 'applications/maniphest/lipsum/PhabricatorManiphestTaskTestDataGenerator.php', @@ -2006,7 +2006,6 @@ 'PhabricatorNamedQueryQuery' => 'applications/search/query/PhabricatorNamedQueryQuery.php', 'PhabricatorNavigationRemarkupRule' => 'infrastructure/markup/rule/PhabricatorNavigationRemarkupRule.php', 'PhabricatorNeverTriggerClock' => 'infrastructure/daemon/workers/clock/PhabricatorNeverTriggerClock.php', - 'PhabricatorNotificationAdHocFeedStory' => 'applications/notification/feed/PhabricatorNotificationAdHocFeedStory.php', 'PhabricatorNotificationBuilder' => 'applications/notification/builder/PhabricatorNotificationBuilder.php', 'PhabricatorNotificationClearController' => 'applications/notification/controller/PhabricatorNotificationClearController.php', 'PhabricatorNotificationClient' => 'applications/notification/client/PhabricatorNotificationClient.php', @@ -2175,6 +2174,7 @@ 'PhabricatorPhrequentConfigOptions' => 'applications/phrequent/config/PhabricatorPhrequentConfigOptions.php', 'PhabricatorPhrictionApplication' => 'applications/phriction/application/PhabricatorPhrictionApplication.php', 'PhabricatorPhrictionConfigOptions' => 'applications/phriction/config/PhabricatorPhrictionConfigOptions.php', + 'PhabricatorPhrictionFeedStory' => 'applications/feed/story/PhabricatorPhrictionFeedStory.php', 'PhabricatorPolicies' => 'applications/policy/constants/PhabricatorPolicies.php', 'PhabricatorPolicy' => 'applications/policy/storage/PhabricatorPolicy.php', 'PhabricatorPolicyApplication' => 'applications/policy/application/PhabricatorPolicyApplication.php', @@ -4461,7 +4461,9 @@ 'PhabricatorActionListView' => 'AphrontView', 'PhabricatorActionView' => 'AphrontView', 'PhabricatorActivitySettingsPanel' => 'PhabricatorSettingsPanel', + 'PhabricatorAdHocNotificationFeedStory' => 'PhabricatorFeedStory', 'PhabricatorAdministratorsPolicyRule' => 'PhabricatorPolicyRule', + 'PhabricatorAggregateFeedStory' => 'PhabricatorFeedStory', 'PhabricatorAllCapsTranslation' => 'PhabricatorTranslation', 'PhabricatorAlmanacApplication' => 'PhabricatorApplication', 'PhabricatorAmazonAuthProvider' => 'PhabricatorOAuth2AuthProvider', @@ -4537,6 +4539,7 @@ 'PhabricatorAuditController' => 'PhabricatorController', 'PhabricatorAuditDAO' => 'PhabricatorLiskDAO', 'PhabricatorAuditEditor' => 'PhabricatorApplicationTransactionEditor', + 'PhabricatorAuditFeedStory' => 'PhabricatorFeedStory', 'PhabricatorAuditInlineComment' => 'PhabricatorInlineCommentInterface', 'PhabricatorAuditListController' => 'PhabricatorAuditController', 'PhabricatorAuditListView' => 'AphrontView', @@ -4707,6 +4710,7 @@ 'PhabricatorClusterConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorCommitBranchesField' => 'PhabricatorCommitCustomField', 'PhabricatorCommitCustomField' => 'PhabricatorCustomField', + 'PhabricatorCommitFeedStory' => 'PhabricatorFeedStory', 'PhabricatorCommitSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhabricatorCommitTagsField' => 'PhabricatorCommitCustomField', 'PhabricatorCommonPasswords' => 'Phobject', @@ -4936,8 +4940,10 @@ 'PhabricatorDeveloperConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorDeveloperPreferencesSettingsPanel' => 'PhabricatorSettingsPanel', 'PhabricatorDiffPreferencesSettingsPanel' => 'PhabricatorSettingsPanel', + 'PhabricatorDifferentialAggregateFeedStory' => 'PhabricatorAggregateFeedStory', 'PhabricatorDifferentialApplication' => 'PhabricatorApplication', 'PhabricatorDifferentialConfigOptions' => 'PhabricatorApplicationConfigOptions', + 'PhabricatorDifferentialFeedStory' => 'PhabricatorFeedStory', 'PhabricatorDifferentialRevisionTestDataGenerator' => 'PhabricatorTestDataGenerator', 'PhabricatorDiffusionApplication' => 'PhabricatorApplication', 'PhabricatorDiffusionConfigOptions' => 'PhabricatorApplicationConfigOptions', @@ -5017,15 +5023,8 @@ 'PhabricatorPolicyInterface', 'PhabricatorMarkupInterface', ), - 'PhabricatorFeedStoryAggregate' => 'PhabricatorFeedStory', - 'PhabricatorFeedStoryAudit' => 'PhabricatorFeedStory', - 'PhabricatorFeedStoryCommit' => 'PhabricatorFeedStory', 'PhabricatorFeedStoryData' => 'PhabricatorFeedDAO', - 'PhabricatorFeedStoryDifferential' => 'PhabricatorFeedStory', - 'PhabricatorFeedStoryDifferentialAggregate' => 'PhabricatorFeedStoryAggregate', - 'PhabricatorFeedStoryManiphestAggregate' => 'PhabricatorFeedStoryAggregate', 'PhabricatorFeedStoryNotification' => 'PhabricatorFeedDAO', - 'PhabricatorFeedStoryPhriction' => 'PhabricatorFeedStory', 'PhabricatorFeedStoryReference' => 'PhabricatorFeedDAO', 'PhabricatorFile' => array( 'PhabricatorFileDAO', @@ -5211,6 +5210,7 @@ 'PhabricatorMainMenuSearchView' => 'AphrontView', 'PhabricatorMainMenuView' => 'AphrontView', 'PhabricatorManagementWorkflow' => 'PhutilArgumentWorkflow', + 'PhabricatorManiphestAggregateFeedStory' => 'PhabricatorAggregateFeedStory', 'PhabricatorManiphestApplication' => 'PhabricatorApplication', 'PhabricatorManiphestConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorManiphestTaskTestDataGenerator' => 'PhabricatorTestDataGenerator', @@ -5266,7 +5266,6 @@ 'PhabricatorNamedQueryQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorNavigationRemarkupRule' => 'PhutilRemarkupRule', 'PhabricatorNeverTriggerClock' => 'PhabricatorTriggerClock', - 'PhabricatorNotificationAdHocFeedStory' => 'PhabricatorFeedStory', 'PhabricatorNotificationClearController' => 'PhabricatorNotificationController', 'PhabricatorNotificationConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorNotificationController' => 'PhabricatorController', @@ -5442,6 +5441,7 @@ 'PhabricatorPhrequentConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorPhrictionApplication' => 'PhabricatorApplication', 'PhabricatorPhrictionConfigOptions' => 'PhabricatorApplicationConfigOptions', + 'PhabricatorPhrictionFeedStory' => 'PhabricatorFeedStory', 'PhabricatorPolicies' => 'PhabricatorPolicyConstants', 'PhabricatorPolicy' => array( 'PhabricatorPolicyDAO', diff --git a/src/applications/feed/story/PhabricatorFeedStoryAggregate.php b/src/applications/feed/story/PhabricatorAggregateFeedStory.php rename from src/applications/feed/story/PhabricatorFeedStoryAggregate.php rename to src/applications/feed/story/PhabricatorAggregateFeedStory.php --- a/src/applications/feed/story/PhabricatorFeedStoryAggregate.php +++ b/src/applications/feed/story/PhabricatorAggregateFeedStory.php @@ -1,6 +1,6 @@ getStoryData()->getValue('commitPHID'); diff --git a/src/applications/feed/story/PhabricatorFeedStoryCommit.php b/src/applications/feed/story/PhabricatorCommitFeedStory.php rename from src/applications/feed/story/PhabricatorFeedStoryCommit.php rename to src/applications/feed/story/PhabricatorCommitFeedStory.php --- a/src/applications/feed/story/PhabricatorFeedStoryCommit.php +++ b/src/applications/feed/story/PhabricatorCommitFeedStory.php @@ -1,6 +1,6 @@ getValue('commitPHID'); diff --git a/src/applications/feed/story/PhabricatorFeedStoryDifferentialAggregate.php b/src/applications/feed/story/PhabricatorDifferentialAggregateFeedStory.php rename from src/applications/feed/story/PhabricatorFeedStoryDifferentialAggregate.php rename to src/applications/feed/story/PhabricatorDifferentialAggregateFeedStory.php --- a/src/applications/feed/story/PhabricatorFeedStoryDifferentialAggregate.php +++ b/src/applications/feed/story/PhabricatorDifferentialAggregateFeedStory.php @@ -1,7 +1,7 @@ getStoryData(); diff --git a/src/applications/feed/story/PhabricatorFeedStoryDifferential.php b/src/applications/feed/story/PhabricatorDifferentialFeedStory.php rename from src/applications/feed/story/PhabricatorFeedStoryDifferential.php rename to src/applications/feed/story/PhabricatorDifferentialFeedStory.php --- a/src/applications/feed/story/PhabricatorFeedStoryDifferential.php +++ b/src/applications/feed/story/PhabricatorDifferentialFeedStory.php @@ -1,6 +1,6 @@ getValue('revision_phid'); @@ -230,7 +230,7 @@ return array( "{$class}:{$phid}:{$read}:{$block}" - => 'PhabricatorFeedStoryDifferentialAggregate', + => 'PhabricatorDifferentialAggregateFeedStory', ); } diff --git a/src/applications/feed/story/PhabricatorFeedStoryManiphestAggregate.php b/src/applications/feed/story/PhabricatorManiphestAggregateFeedStory.php rename from src/applications/feed/story/PhabricatorFeedStoryManiphestAggregate.php rename to src/applications/feed/story/PhabricatorManiphestAggregateFeedStory.php --- a/src/applications/feed/story/PhabricatorFeedStoryManiphestAggregate.php +++ b/src/applications/feed/story/PhabricatorManiphestAggregateFeedStory.php @@ -1,7 +1,7 @@ getStoryData(); diff --git a/src/applications/feed/story/PhabricatorFeedStoryPhriction.php b/src/applications/feed/story/PhabricatorPhrictionFeedStory.php rename from src/applications/feed/story/PhabricatorFeedStoryPhriction.php rename to src/applications/feed/story/PhabricatorPhrictionFeedStory.php --- a/src/applications/feed/story/PhabricatorFeedStoryPhriction.php +++ b/src/applications/feed/story/PhabricatorPhrictionFeedStory.php @@ -1,6 +1,6 @@ getValue('phid'); diff --git a/src/applications/notification/builder/PhabricatorNotificationBuilder.php b/src/applications/notification/builder/PhabricatorNotificationBuilder.php --- a/src/applications/notification/builder/PhabricatorNotificationBuilder.php +++ b/src/applications/notification/builder/PhabricatorNotificationBuilder.php @@ -29,7 +29,7 @@ // Each notification emits keys it can aggregate on. For instance, if this // story is "a updated T123", it might emit a key like this: // - // task:phid123:unread => PhabricatorFeedStoryManiphestAggregate + // task:phid123:unread => PhabricatorManiphestAggregateFeedStory // // All the unread notifications about the task with PHID "phid123" will // emit the same key, telling us we can aggregate them into a single @@ -40,8 +40,8 @@ // unlikely for stories in a notification context, stories in a feed context // can also aggregate by actor: // - // task:phid123 => PhabricatorFeedStoryManiphestAggregate - // actor:user123 => PhabricatorFeedStoryActorAggregate + // task:phid123 => PhabricatorManiphestAggregateFeedStory + // actor:user123 => PhabricatorActorAggregateFeedStory // // This means the story can either become "a and b updated T123" or // "a updated T123 and T456". When faced with multiple possibilities, it's diff --git a/src/applications/notification/controller/PhabricatorNotificationTestController.php b/src/applications/notification/controller/PhabricatorNotificationTestController.php --- a/src/applications/notification/controller/PhabricatorNotificationTestController.php +++ b/src/applications/notification/controller/PhabricatorNotificationTestController.php @@ -7,7 +7,7 @@ $request = $this->getRequest(); $viewer = $request->getUser(); - $story_type = 'PhabricatorNotificationAdHocFeedStory'; + $story_type = 'PhabricatorAdHocNotificationFeedStory'; $story_data = array( 'title' => pht( 'This is a test notification, sent at %s.', diff --git a/src/applications/notification/feed/PhabricatorNotificationAdHocFeedStory.php b/src/applications/notification/feed/PhabricatorAdHocNotificationFeedStory.php rename from src/applications/notification/feed/PhabricatorNotificationAdHocFeedStory.php rename to src/applications/notification/feed/PhabricatorAdHocNotificationFeedStory.php --- a/src/applications/notification/feed/PhabricatorNotificationAdHocFeedStory.php +++ b/src/applications/notification/feed/PhabricatorAdHocNotificationFeedStory.php @@ -1,6 +1,6 @@ getAuthorPHID();