mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Remove path.getowners
method
Summary: This has been deprecated for quite a while and I'm pretty sure there are no callsites in the wild since this tool doesn't get much use outside of Facebook. Test Plan: grep Reviewers: vrana, btrahan, meitros Reviewed By: vrana CC: aran Maniphest Tasks: T603 Differential Revision: https://secure.phabricator.com/D3195
This commit is contained in:
parent
c865b24e11
commit
51a5dacd6d
3 changed files with 1 additions and 91 deletions
|
@ -161,7 +161,6 @@ phutil_register_library_map(array(
|
||||||
'ConduitAPI_paste_Method' => 'applications/conduit/method/paste/ConduitAPI_paste_Method.php',
|
'ConduitAPI_paste_Method' => 'applications/conduit/method/paste/ConduitAPI_paste_Method.php',
|
||||||
'ConduitAPI_paste_create_Method' => 'applications/conduit/method/paste/ConduitAPI_paste_create_Method.php',
|
'ConduitAPI_paste_create_Method' => 'applications/conduit/method/paste/ConduitAPI_paste_create_Method.php',
|
||||||
'ConduitAPI_paste_info_Method' => 'applications/conduit/method/paste/ConduitAPI_paste_info_Method.php',
|
'ConduitAPI_paste_info_Method' => 'applications/conduit/method/paste/ConduitAPI_paste_info_Method.php',
|
||||||
'ConduitAPI_path_getowners_Method' => 'applications/conduit/method/path/ConduitAPI_path_getowners_Method.php',
|
|
||||||
'ConduitAPI_phid_Method' => 'applications/conduit/method/phid/ConduitAPI_phid_Method.php',
|
'ConduitAPI_phid_Method' => 'applications/conduit/method/phid/ConduitAPI_phid_Method.php',
|
||||||
'ConduitAPI_phid_info_Method' => 'applications/conduit/method/phid/ConduitAPI_phid_info_Method.php',
|
'ConduitAPI_phid_info_Method' => 'applications/conduit/method/phid/ConduitAPI_phid_info_Method.php',
|
||||||
'ConduitAPI_phid_lookup_Method' => 'applications/conduit/method/phid/ConduitAPI_phid_lookup_Method.php',
|
'ConduitAPI_phid_lookup_Method' => 'applications/conduit/method/phid/ConduitAPI_phid_lookup_Method.php',
|
||||||
|
@ -1350,7 +1349,6 @@ phutil_register_library_map(array(
|
||||||
'ConduitAPI_paste_Method' => 'ConduitAPIMethod',
|
'ConduitAPI_paste_Method' => 'ConduitAPIMethod',
|
||||||
'ConduitAPI_paste_create_Method' => 'ConduitAPI_paste_Method',
|
'ConduitAPI_paste_create_Method' => 'ConduitAPI_paste_Method',
|
||||||
'ConduitAPI_paste_info_Method' => 'ConduitAPI_paste_Method',
|
'ConduitAPI_paste_info_Method' => 'ConduitAPI_paste_Method',
|
||||||
'ConduitAPI_path_getowners_Method' => 'ConduitAPIMethod',
|
|
||||||
'ConduitAPI_phid_Method' => 'ConduitAPIMethod',
|
'ConduitAPI_phid_Method' => 'ConduitAPIMethod',
|
||||||
'ConduitAPI_phid_info_Method' => 'ConduitAPI_phid_Method',
|
'ConduitAPI_phid_info_Method' => 'ConduitAPI_phid_Method',
|
||||||
'ConduitAPI_phid_lookup_Method' => 'ConduitAPI_phid_Method',
|
'ConduitAPI_phid_lookup_Method' => 'ConduitAPI_phid_Method',
|
||||||
|
|
|
@ -81,9 +81,7 @@ final class ConduitAPI_owners_query_Method
|
||||||
return $packages;
|
return $packages;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function queryByPath($repo_callsign, $path) {
|
private static function queryByPath($repo_callsign, $path) {
|
||||||
// note: we call this from the deprecated path.getowners conduit call.
|
|
||||||
|
|
||||||
$repository = id(new PhabricatorRepository())->loadOneWhere('callsign = %s',
|
$repository = id(new PhabricatorRepository())->loadOneWhere('callsign = %s',
|
||||||
$repo_callsign);
|
$repo_callsign);
|
||||||
|
|
||||||
|
|
|
@ -1,86 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright 2012 Facebook, Inc.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @group conduit
|
|
||||||
*/
|
|
||||||
final class ConduitAPI_path_getowners_Method extends ConduitAPIMethod {
|
|
||||||
|
|
||||||
// This conduit call is deprecated
|
|
||||||
public function getMethodStatus() {
|
|
||||||
return self::METHOD_STATUS_DEPRECATED;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMethodStatusDescription() {
|
|
||||||
return "Replaced by 'owners.query'.";
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMethodDescription() {
|
|
||||||
return "Find the Owners package that contains a given path.";
|
|
||||||
}
|
|
||||||
|
|
||||||
public function defineParamTypes() {
|
|
||||||
return array(
|
|
||||||
'repositoryCallsign' => 'required nonempty string',
|
|
||||||
'path' => 'required nonempty string'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function defineReturnType() {
|
|
||||||
return
|
|
||||||
"array(".
|
|
||||||
"array(".
|
|
||||||
"'phid' => phid, ".
|
|
||||||
"'name' => string, ".
|
|
||||||
"'primaryOwner' => phid, ".
|
|
||||||
"'owners' => array(phid)))";
|
|
||||||
}
|
|
||||||
|
|
||||||
public function defineErrorTypes() {
|
|
||||||
return array(
|
|
||||||
'ERR_REP_NOT_FOUND' => 'The repository callsign is not recognized',
|
|
||||||
'ERR_PATH_NOT_FOUND' => 'The specified path is not in any package',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function execute(ConduitAPIRequest $request) {
|
|
||||||
$packages = ConduitAPI_owners_query_Method::queryByPath(
|
|
||||||
$request->getValue('repositoryCallsign'),
|
|
||||||
$request->getValue('path')
|
|
||||||
);
|
|
||||||
|
|
||||||
if (empty($packages)) {
|
|
||||||
throw new ConduitException('ERR_PATH_NOT_FOUND');
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = array();
|
|
||||||
foreach ($packages as $package) {
|
|
||||||
$p_owners =
|
|
||||||
id(new PhabricatorOwnersOwner())->loadAllForPackages(array($package));
|
|
||||||
|
|
||||||
$result[] = array(
|
|
||||||
'phid' => $package->getPHID(),
|
|
||||||
'name' => $package->getName(),
|
|
||||||
'primaryOwner' => $package->getPrimaryOwnerPHID(),
|
|
||||||
'owners' => array_values(mpull($p_owners, 'getUserPHID')),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue