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

Remove support for "paths" parameter in "differential.query"

Summary: See T13639. This change simplifies providing a more modern approach to querying this data via "differential.revision.search".

Test Plan: Called "differential.query" with paths (got an error) and without paths (got a valid query result).

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

+6 -43
+6 -43
src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php
··· 38 38 'authors' => 'optional list<phid>', 39 39 'ccs' => 'optional list<phid>', 40 40 'reviewers' => 'optional list<phid>', 41 - 'paths' => 'optional list<pair<callsign, path>>', 41 + 'paths' => 'unsupported', 42 42 'commitHashes' => 'optional list<pair<'.$hash_const.', string>>', 43 43 'status' => 'optional '.$status_const, 44 44 'order' => 'optional '.$order_const, ··· 92 92 } 93 93 94 94 if ($path_pairs) { 95 - $paths = array(); 96 - foreach ($path_pairs as $pair) { 97 - list($callsign, $path) = $pair; 98 - $paths[] = $path; 99 - } 100 - 101 - $path_map = id(new DiffusionPathIDQuery($paths))->loadPathIDs(); 102 - if (count($path_map) != count($paths)) { 103 - $unknown_paths = array(); 104 - foreach ($paths as $p) { 105 - if (!idx($path_map, $p)) { 106 - $unknown_paths[] = $p; 107 - } 108 - } 109 - throw id(new ConduitException('ERR-INVALID-PARAMETER')) 110 - ->setErrorDescription( 111 - pht( 112 - 'Unknown paths: %s', 113 - implode(', ', $unknown_paths))); 114 - } 115 - 116 - $repos = array(); 117 - foreach ($path_pairs as $pair) { 118 - list($callsign, $path) = $pair; 119 - if (!idx($repos, $callsign)) { 120 - $repos[$callsign] = id(new PhabricatorRepositoryQuery()) 121 - ->setViewer($request->getUser()) 122 - ->withCallsigns(array($callsign)) 123 - ->executeOne(); 124 - 125 - if (!$repos[$callsign]) { 126 - throw id(new ConduitException('ERR-INVALID-PARAMETER')) 127 - ->setErrorDescription( 128 - pht( 129 - 'Unknown repo callsign: %s', 130 - $callsign)); 131 - } 132 - } 133 - $repo = $repos[$callsign]; 134 - 135 - $query->withPath($repo->getID(), idx($path_map, $path)); 136 - } 95 + throw new Exception( 96 + pht( 97 + 'Parameter "paths" to Conduit API method "differential.query" is '. 98 + 'no longer supported. Use the "paths" constraint to '. 99 + '"differential.revision.search" instead. See T13639.')); 137 100 } 138 101 139 102 if ($commit_hashes) {