From 9febfb26a08d8ba78003dc5e370d92e419b4acab Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 2 Jan 2016 12:03:08 -0800 Subject: [PATCH] Convert `diffusion.looksoon` to use repository identifiers instead of callsigns Summary: Ref T4245. Like everything else, accept more identifiers. This needs a change in `arc`, which I've made a note about elsewhere. Test Plan: Used "Update Now" from web UI, saw update get scheduled. Reviewers: chad Reviewed By: chad Maniphest Tasks: T4245 Differential Revision: https://secure.phabricator.com/D14932 --- .../DifferentialRevisionLandController.php | 4 ++-- .../conduit/DiffusionLookSoonConduitAPIMethod.php | 14 ++++++++++---- .../diffusion/controller/DiffusionController.php | 2 +- .../DiffusionRepositoryEditUpdateController.php | 4 ++-- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/applications/differential/controller/DifferentialRevisionLandController.php b/src/applications/differential/controller/DifferentialRevisionLandController.php index 4f8787956f..f2d2497a42 100644 --- a/src/applications/differential/controller/DifferentialRevisionLandController.php +++ b/src/applications/differential/controller/DifferentialRevisionLandController.php @@ -146,7 +146,7 @@ final class DifferentialRevisionLandController extends DifferentialController { $looksoon = new ConduitCall( 'diffusion.looksoon', array( - 'callsigns' => array($repository->getCallsign()), + 'repositories' => array($repository->getPHID()), )); $looksoon->setUser($request->getUser()); $looksoon->execute(); @@ -155,7 +155,7 @@ final class DifferentialRevisionLandController extends DifferentialController { } private function lockRepository($repository) { - $lock_name = __CLASS__.':'.($repository->getCallsign()); + $lock_name = __CLASS__.':'.($repository->getPHID()); $lock = PhabricatorGlobalLock::newLock($lock_name); $lock->lock(); return $lock; diff --git a/src/applications/diffusion/conduit/DiffusionLookSoonConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionLookSoonConduitAPIMethod.php index 49dd5dc117..88d216e4a1 100644 --- a/src/applications/diffusion/conduit/DiffusionLookSoonConduitAPIMethod.php +++ b/src/applications/diffusion/conduit/DiffusionLookSoonConduitAPIMethod.php @@ -24,7 +24,8 @@ final class DiffusionLookSoonConduitAPIMethod protected function defineParamTypes() { return array( - 'callsigns' => 'required list', + 'callsigns' => 'optional list (deprecated)', + 'repositories' => 'optional list', 'urgency' => 'optional string', ); } @@ -33,14 +34,19 @@ final class DiffusionLookSoonConduitAPIMethod // NOTE: The "urgency" parameter does nothing, it is just a hilarious joke // which exemplifies the boundless clever wit of this project. - $callsigns = $request->getValue('callsigns'); - if (!$callsigns) { + $identifiers = $request->getValue('repositories'); + + if (!$identifiers) { + $identifiers = $request->getValue('callsigns'); + } + + if (!$identifiers) { return null; } $repositories = id(new PhabricatorRepositoryQuery()) ->setViewer($request->getUser()) - ->withCallsigns($callsigns) + ->withIdentifiers($identifiers) ->execute(); foreach ($repositories as $repository) { diff --git a/src/applications/diffusion/controller/DiffusionController.php b/src/applications/diffusion/controller/DiffusionController.php index 810286176b..1d0d27216b 100644 --- a/src/applications/diffusion/controller/DiffusionController.php +++ b/src/applications/diffusion/controller/DiffusionController.php @@ -212,7 +212,7 @@ abstract class DiffusionController extends PhabricatorController { 'path' => '', )), ), - 'r'.$drequest->getRepository()->getCallsign()); + $drequest->getRepository()->getDisplayName()); $links[] = $divider; $accum = ''; $last_key = last_key($path_parts); diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditUpdateController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditUpdateController.php index e50d297586..74df9c488b 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditUpdateController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditUpdateController.php @@ -25,8 +25,8 @@ final class DiffusionRepositoryEditUpdateController if ($request->isFormPost()) { $params = array( - 'callsigns' => array( - $repository->getCallsign(), + 'repositories' => array( + $repository->getPHID(), ), );