From cec8d1073150fcffe8719e34a15b8e70bedee44b Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 25 Mar 2014 16:09:51 -0700 Subject: [PATCH] Rename concrete Harbormaster step implementations Summary: Ref T1049. For consistency, rename these to "Harbormaster...". Test Plan: Ran migration, ran builds, everything still works fine. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T1049 Differential Revision: https://secure.phabricator.com/D8602 --- .../autopatches/20140323.harbor.1.renames.php | 35 +++++++++++++++++++ src/__phutil_library_map__.php | 24 ++++++------- ...rmasterCommandBuildStepImplementation.php} | 2 +- ...asterLeaseHostBuildStepImplementation.php} | 2 +- ...ublishFragmentBuildStepImplementation.php} | 2 +- ...bormasterSleepBuildStepImplementation.php} | 2 +- ...UploadArtifactBuildStepImplementation.php} | 2 +- ...aitForPreviousBuildStepImplementation.php} | 2 +- 8 files changed, 53 insertions(+), 18 deletions(-) create mode 100644 resources/sql/autopatches/20140323.harbor.1.renames.php rename src/applications/harbormaster/step/{CommandBuildStepImplementation.php => HarbormasterCommandBuildStepImplementation.php} (97%) rename src/applications/harbormaster/step/{LeaseHostBuildStepImplementation.php => HarbormasterLeaseHostBuildStepImplementation.php} (97%) rename src/applications/harbormaster/step/{PublishFragmentBuildStepImplementation.php => HarbormasterPublishFragmentBuildStepImplementation.php} (97%) rename src/applications/harbormaster/step/{SleepBuildStepImplementation.php => HarbormasterSleepBuildStepImplementation.php} (93%) rename src/applications/harbormaster/step/{UploadArtifactBuildStepImplementation.php => HarbormasterUploadArtifactBuildStepImplementation.php} (97%) rename src/applications/harbormaster/step/{WaitForPreviousBuildStepImplementation.php => HarbormasterWaitForPreviousBuildStepImplementation.php} (98%) diff --git a/resources/sql/autopatches/20140323.harbor.1.renames.php b/resources/sql/autopatches/20140323.harbor.1.renames.php new file mode 100644 index 0000000000..892402bf80 --- /dev/null +++ b/resources/sql/autopatches/20140323.harbor.1.renames.php @@ -0,0 +1,35 @@ +getTableName(), + id(new HarbormasterBuildTarget())->getTableName(), +); + +echo "Renaming Harbormaster classes...\n"; + +$conn_w = id(new HarbormasterBuildStep())->establishConnection('w'); +foreach ($names as $name) { + $old = $name; + $new = 'Harbormaster'.$name; + + echo "Renaming {$old} -> {$new}...\n"; + foreach ($tables as $table) { + queryfx( + $conn_w, + 'UPDATE %T SET className = %s WHERE className = %s', + $table, + $new, + $old); + } +} + +echo "Done.\n"; diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index fb73930ccc..86d4c90425 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -111,7 +111,6 @@ phutil_register_library_map(array( 'CelerityResourcesOnDisk' => 'infrastructure/celerity/resources/CelerityResourcesOnDisk.php', 'CeleritySpriteGenerator' => 'infrastructure/celerity/CeleritySpriteGenerator.php', 'CelerityStaticResourceResponse' => 'infrastructure/celerity/CelerityStaticResourceResponse.php', - 'CommandBuildStepImplementation' => 'applications/harbormaster/step/CommandBuildStepImplementation.php', 'ConduitAPIMethod' => 'applications/conduit/method/ConduitAPIMethod.php', 'ConduitAPIRequest' => 'applications/conduit/protocol/ConduitAPIRequest.php', 'ConduitAPIResponse' => 'applications/conduit/protocol/ConduitAPIResponse.php', @@ -730,9 +729,11 @@ phutil_register_library_map(array( 'HarbormasterBuildableSearchEngine' => 'applications/harbormaster/query/HarbormasterBuildableSearchEngine.php', 'HarbormasterBuildableViewController' => 'applications/harbormaster/controller/HarbormasterBuildableViewController.php', 'HarbormasterCapabilityManagePlans' => 'applications/harbormaster/capability/HarbormasterCapabilityManagePlans.php', + 'HarbormasterCommandBuildStepImplementation' => 'applications/harbormaster/step/HarbormasterCommandBuildStepImplementation.php', 'HarbormasterController' => 'applications/harbormaster/controller/HarbormasterController.php', 'HarbormasterDAO' => 'applications/harbormaster/storage/HarbormasterDAO.php', 'HarbormasterHTTPRequestBuildStepImplementation' => 'applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php', + 'HarbormasterLeaseHostBuildStepImplementation' => 'applications/harbormaster/step/HarbormasterLeaseHostBuildStepImplementation.php', 'HarbormasterManagementBuildWorkflow' => 'applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php', 'HarbormasterManagementWorkflow' => 'applications/harbormaster/management/HarbormasterManagementWorkflow.php', 'HarbormasterObject' => 'applications/harbormaster/storage/HarbormasterObject.php', @@ -750,14 +751,18 @@ phutil_register_library_map(array( 'HarbormasterPlanOrderController' => 'applications/harbormaster/controller/HarbormasterPlanOrderController.php', 'HarbormasterPlanRunController' => 'applications/harbormaster/controller/HarbormasterPlanRunController.php', 'HarbormasterPlanViewController' => 'applications/harbormaster/controller/HarbormasterPlanViewController.php', + 'HarbormasterPublishFragmentBuildStepImplementation' => 'applications/harbormaster/step/HarbormasterPublishFragmentBuildStepImplementation.php', 'HarbormasterRemarkupRule' => 'applications/harbormaster/remarkup/HarbormasterRemarkupRule.php', 'HarbormasterScratchTable' => 'applications/harbormaster/storage/HarbormasterScratchTable.php', + 'HarbormasterSleepBuildStepImplementation' => 'applications/harbormaster/step/HarbormasterSleepBuildStepImplementation.php', 'HarbormasterStepAddController' => 'applications/harbormaster/controller/HarbormasterStepAddController.php', 'HarbormasterStepDeleteController' => 'applications/harbormaster/controller/HarbormasterStepDeleteController.php', 'HarbormasterStepEditController' => 'applications/harbormaster/controller/HarbormasterStepEditController.php', 'HarbormasterTargetWorker' => 'applications/harbormaster/worker/HarbormasterTargetWorker.php', 'HarbormasterThrowExceptionBuildStep' => 'applications/harbormaster/step/HarbormasterThrowExceptionBuildStep.php', 'HarbormasterUIEventListener' => 'applications/harbormaster/event/HarbormasterUIEventListener.php', + 'HarbormasterUploadArtifactBuildStepImplementation' => 'applications/harbormaster/step/HarbormasterUploadArtifactBuildStepImplementation.php', + 'HarbormasterWaitForPreviousBuildStepImplementation' => 'applications/harbormaster/step/HarbormasterWaitForPreviousBuildStepImplementation.php', 'HarbormasterWorker' => 'applications/harbormaster/worker/HarbormasterWorker.php', 'HeraldAction' => 'applications/herald/storage/HeraldAction.php', 'HeraldAdapter' => 'applications/herald/adapter/HeraldAdapter.php', @@ -815,7 +820,6 @@ phutil_register_library_map(array( 'JavelinUIExample' => 'applications/uiexample/examples/JavelinUIExample.php', 'JavelinViewExample' => 'applications/uiexample/examples/JavelinViewExample.php', 'JavelinViewExampleServerView' => 'applications/uiexample/examples/JavelinViewExampleServerView.php', - 'LeaseHostBuildStepImplementation' => 'applications/harbormaster/step/LeaseHostBuildStepImplementation.php', 'LegalpadCapabilityDefaultEdit' => 'applications/legalpad/capability/LegalpadCapabilityDefaultEdit.php', 'LegalpadCapabilityDefaultView' => 'applications/legalpad/capability/LegalpadCapabilityDefaultView.php', 'LegalpadConstants' => 'applications/legalpad/constants/LegalpadConstants.php', @@ -2457,7 +2461,6 @@ phutil_register_library_map(array( 'ProjectBoardTaskCard' => 'applications/project/view/ProjectBoardTaskCard.php', 'ProjectCapabilityCreateProjects' => 'applications/project/capability/ProjectCapabilityCreateProjects.php', 'ProjectRemarkupRule' => 'applications/project/remarkup/ProjectRemarkupRule.php', - 'PublishFragmentBuildStepImplementation' => 'applications/harbormaster/step/PublishFragmentBuildStepImplementation.php', 'QueryFormattingTestCase' => 'infrastructure/storage/__tests__/QueryFormattingTestCase.php', 'ReleephAuthorFieldSpecification' => 'applications/releeph/field/specification/ReleephAuthorFieldSpecification.php', 'ReleephBranch' => 'applications/releeph/storage/ReleephBranch.php', @@ -2536,13 +2539,10 @@ phutil_register_library_map(array( 'ReleephSummaryFieldSpecification' => 'applications/releeph/field/specification/ReleephSummaryFieldSpecification.php', 'ReleephUserView' => 'applications/releeph/view/user/ReleephUserView.php', 'ShellLogView' => 'applications/harbormaster/view/ShellLogView.php', - 'SleepBuildStepImplementation' => 'applications/harbormaster/step/SleepBuildStepImplementation.php', 'SlowvoteEmbedView' => 'applications/slowvote/view/SlowvoteEmbedView.php', 'SlowvoteRemarkupRule' => 'applications/slowvote/remarkup/SlowvoteRemarkupRule.php', 'SubscriptionListDialogBuilder' => 'applications/subscriptions/view/SubscriptionListDialogBuilder.php', 'SubscriptionListStringBuilder' => 'applications/subscriptions/view/SubscriptionListStringBuilder.php', - 'UploadArtifactBuildStepImplementation' => 'applications/harbormaster/step/UploadArtifactBuildStepImplementation.php', - 'WaitForPreviousBuildStepImplementation' => 'applications/harbormaster/step/WaitForPreviousBuildStepImplementation.php', ), 'function' => array( @@ -2663,7 +2663,6 @@ phutil_register_library_map(array( 'CelerityResourceGraph' => 'AbstractDirectedGraph', 'CelerityResourceTransformerTestCase' => 'PhabricatorTestCase', 'CelerityResourcesOnDisk' => 'CelerityPhysicalResources', - 'CommandBuildStepImplementation' => 'HarbormasterBuildStepImplementation', 'ConduitAPIMethod' => array( 0 => 'Phobject', @@ -3351,9 +3350,11 @@ phutil_register_library_map(array( 'HarbormasterBuildableSearchEngine' => 'PhabricatorApplicationSearchEngine', 'HarbormasterBuildableViewController' => 'HarbormasterController', 'HarbormasterCapabilityManagePlans' => 'PhabricatorPolicyCapability', + 'HarbormasterCommandBuildStepImplementation' => 'HarbormasterBuildStepImplementation', 'HarbormasterController' => 'PhabricatorController', 'HarbormasterDAO' => 'PhabricatorLiskDAO', 'HarbormasterHTTPRequestBuildStepImplementation' => 'HarbormasterBuildStepImplementation', + 'HarbormasterLeaseHostBuildStepImplementation' => 'HarbormasterBuildStepImplementation', 'HarbormasterManagementBuildWorkflow' => 'HarbormasterManagementWorkflow', 'HarbormasterManagementWorkflow' => 'PhabricatorManagementWorkflow', 'HarbormasterObject' => 'HarbormasterDAO', @@ -3375,14 +3376,18 @@ phutil_register_library_map(array( 'HarbormasterPlanOrderController' => 'HarbormasterController', 'HarbormasterPlanRunController' => 'HarbormasterController', 'HarbormasterPlanViewController' => 'HarbormasterPlanController', + 'HarbormasterPublishFragmentBuildStepImplementation' => 'HarbormasterBuildStepImplementation', 'HarbormasterRemarkupRule' => 'PhabricatorRemarkupRuleObject', 'HarbormasterScratchTable' => 'HarbormasterDAO', + 'HarbormasterSleepBuildStepImplementation' => 'HarbormasterBuildStepImplementation', 'HarbormasterStepAddController' => 'HarbormasterController', 'HarbormasterStepDeleteController' => 'HarbormasterController', 'HarbormasterStepEditController' => 'HarbormasterController', 'HarbormasterTargetWorker' => 'HarbormasterWorker', 'HarbormasterThrowExceptionBuildStep' => 'HarbormasterBuildStepImplementation', 'HarbormasterUIEventListener' => 'PhabricatorEventListener', + 'HarbormasterUploadArtifactBuildStepImplementation' => 'HarbormasterBuildStepImplementation', + 'HarbormasterWaitForPreviousBuildStepImplementation' => 'HarbormasterBuildStepImplementation', 'HarbormasterWorker' => 'PhabricatorWorker', 'HeraldAction' => 'HeraldDAO', 'HeraldApplyTranscript' => 'HeraldDAO', @@ -3448,7 +3453,6 @@ phutil_register_library_map(array( 'JavelinUIExample' => 'PhabricatorUIExample', 'JavelinViewExample' => 'PhabricatorUIExample', 'JavelinViewExampleServerView' => 'AphrontView', - 'LeaseHostBuildStepImplementation' => 'HarbormasterBuildStepImplementation', 'LegalpadCapabilityDefaultEdit' => 'PhabricatorPolicyCapability', 'LegalpadCapabilityDefaultView' => 'PhabricatorPolicyCapability', 'LegalpadController' => 'PhabricatorController', @@ -5398,7 +5402,6 @@ phutil_register_library_map(array( 'PonderVoteSaveController' => 'PonderController', 'ProjectCapabilityCreateProjects' => 'PhabricatorPolicyCapability', 'ProjectRemarkupRule' => 'PhabricatorRemarkupRuleObject', - 'PublishFragmentBuildStepImplementation' => 'HarbormasterBuildStepImplementation', 'QueryFormattingTestCase' => 'PhabricatorTestCase', 'ReleephAuthorFieldSpecification' => 'ReleephFieldSpecification', 'ReleephBranch' => @@ -5502,10 +5505,7 @@ phutil_register_library_map(array( 'ReleephSummaryFieldSpecification' => 'ReleephFieldSpecification', 'ReleephUserView' => 'AphrontView', 'ShellLogView' => 'AphrontView', - 'SleepBuildStepImplementation' => 'HarbormasterBuildStepImplementation', 'SlowvoteEmbedView' => 'AphrontView', 'SlowvoteRemarkupRule' => 'PhabricatorRemarkupRuleObject', - 'UploadArtifactBuildStepImplementation' => 'HarbormasterBuildStepImplementation', - 'WaitForPreviousBuildStepImplementation' => 'HarbormasterBuildStepImplementation', ), )); diff --git a/src/applications/harbormaster/step/CommandBuildStepImplementation.php b/src/applications/harbormaster/step/HarbormasterCommandBuildStepImplementation.php similarity index 97% rename from src/applications/harbormaster/step/CommandBuildStepImplementation.php rename to src/applications/harbormaster/step/HarbormasterCommandBuildStepImplementation.php index d3b3af3b0b..d21ba09a1e 100644 --- a/src/applications/harbormaster/step/CommandBuildStepImplementation.php +++ b/src/applications/harbormaster/step/HarbormasterCommandBuildStepImplementation.php @@ -1,6 +1,6 @@