1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 12:00:55 +01:00

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
This commit is contained in:
epriestley 2016-01-02 12:03:08 -08:00
parent be5b89687e
commit 9febfb26a0
4 changed files with 15 additions and 9 deletions

View file

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

View file

@ -24,7 +24,8 @@ final class DiffusionLookSoonConduitAPIMethod
protected function defineParamTypes() {
return array(
'callsigns' => 'required list<string>',
'callsigns' => 'optional list<string> (deprecated)',
'repositories' => 'optional list<string>',
'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) {

View file

@ -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);

View file

@ -25,8 +25,8 @@ final class DiffusionRepositoryEditUpdateController
if ($request->isFormPost()) {
$params = array(
'callsigns' => array(
$repository->getCallsign(),
'repositories' => array(
$repository->getPHID(),
),
);