@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Completely remove "differential.find" Conduit API method

Summary:
Ref T2543. I believe there have been no upstream callsites of this method since D1646, in February 2012.

The method works, and we can revert this if needbe, but this seems like a good time to remove support.

Test Plan: Grepped for `differential.find`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T2543

Differential Revision: https://secure.phabricator.com/D18397

-101
-2
src/__phutil_library_map__.php
··· 445 445 'DifferentialExactUserFunctionDatasource' => 'applications/differential/typeahead/DifferentialExactUserFunctionDatasource.php', 446 446 'DifferentialFieldParseException' => 'applications/differential/exception/DifferentialFieldParseException.php', 447 447 'DifferentialFieldValidationException' => 'applications/differential/exception/DifferentialFieldValidationException.php', 448 - 'DifferentialFindConduitAPIMethod' => 'applications/differential/conduit/DifferentialFindConduitAPIMethod.php', 449 448 'DifferentialGetAllDiffsConduitAPIMethod' => 'applications/differential/conduit/DifferentialGetAllDiffsConduitAPIMethod.php', 450 449 'DifferentialGetCommitMessageConduitAPIMethod' => 'applications/differential/conduit/DifferentialGetCommitMessageConduitAPIMethod.php', 451 450 'DifferentialGetCommitPathsConduitAPIMethod' => 'applications/differential/conduit/DifferentialGetCommitPathsConduitAPIMethod.php', ··· 5419 5418 'DifferentialExactUserFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource', 5420 5419 'DifferentialFieldParseException' => 'Exception', 5421 5420 'DifferentialFieldValidationException' => 'Exception', 5422 - 'DifferentialFindConduitAPIMethod' => 'DifferentialConduitAPIMethod', 5423 5421 'DifferentialGetAllDiffsConduitAPIMethod' => 'DifferentialConduitAPIMethod', 5424 5422 'DifferentialGetCommitMessageConduitAPIMethod' => 'DifferentialConduitAPIMethod', 5425 5423 'DifferentialGetCommitPathsConduitAPIMethod' => 'DifferentialConduitAPIMethod',
-99
src/applications/differential/conduit/DifferentialFindConduitAPIMethod.php
··· 1 - <?php 2 - 3 - final class DifferentialFindConduitAPIMethod 4 - extends DifferentialConduitAPIMethod { 5 - 6 - public function getAPIMethodName() { 7 - return 'differential.find'; 8 - } 9 - 10 - public function getMethodStatus() { 11 - return self::METHOD_STATUS_DEPRECATED; 12 - } 13 - 14 - public function getMethodStatusDescription() { 15 - return pht("Replaced by '%s'.", 'differential.query'); 16 - } 17 - 18 - public function getMethodDescription() { 19 - return pht('Query Differential revisions which match certain criteria.'); 20 - } 21 - 22 - protected function defineParamTypes() { 23 - $types = array( 24 - 'open', 25 - 'committable', 26 - 'revision-ids', 27 - 'phids', 28 - ); 29 - 30 - return array( 31 - 'query' => 'required '.$this->formatStringConstants($types), 32 - 'guids' => 'required nonempty list<guids>', 33 - ); 34 - } 35 - 36 - protected function defineReturnType() { 37 - return 'nonempty list<dict>'; 38 - } 39 - 40 - protected function execute(ConduitAPIRequest $request) { 41 - $type = $request->getValue('query'); 42 - $guids = $request->getValue('guids'); 43 - 44 - $results = array(); 45 - if (!$guids) { 46 - return $results; 47 - } 48 - 49 - $query = id(new DifferentialRevisionQuery()) 50 - ->setViewer($request->getUser()); 51 - 52 - switch ($type) { 53 - case 'open': 54 - $query 55 - ->withIsOpen(true) 56 - ->withAuthors($guids); 57 - break; 58 - case 'committable': 59 - $query 60 - ->withStatuses(DifferentialRevisionStatus::ACCEPTED) 61 - ->withAuthors($guids); 62 - break; 63 - case 'revision-ids': 64 - $query 65 - ->withIDs($guids); 66 - break; 67 - case 'owned': 68 - $query->withAuthors($guids); 69 - break; 70 - case 'phids': 71 - $query 72 - ->withPHIDs($guids); 73 - break; 74 - } 75 - 76 - $revisions = $query->execute(); 77 - 78 - foreach ($revisions as $revision) { 79 - $diff = $revision->loadActiveDiff(); 80 - if (!$diff) { 81 - continue; 82 - } 83 - $id = $revision->getID(); 84 - $results[] = array( 85 - 'id' => $id, 86 - 'phid' => $revision->getPHID(), 87 - 'name' => $revision->getTitle(), 88 - 'uri' => PhabricatorEnv::getProductionURI('/D'.$id), 89 - 'dateCreated' => $revision->getDateCreated(), 90 - 'authorPHID' => $revision->getAuthorPHID(), 91 - 'statusName' => $revision->getStatusDisplayName(), 92 - 'sourcePath' => $diff->getSourcePath(), 93 - ); 94 - } 95 - 96 - return $results; 97 - } 98 - 99 - }