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

Add more options to `repository.query`

Summary: Expose more options on `repository.query`. My broad goal here is to move forward on suppressing Arcanist Projects.

Test Plan: Used Conduit console to execute queries.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

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

+39 -9
+30 -8
src/applications/repository/conduit/ConduitAPI_repository_query_Method.php
··· 1 1 <?php 2 2 3 - /** 4 - * @group conduit 5 - */ 6 3 final class ConduitAPI_repository_query_Method 7 4 extends ConduitAPI_repository_Method { 8 5 ··· 11 8 } 12 9 13 10 public function getMethodStatusDescription() { 14 - return "Repository methods are new and subject to change."; 11 + return pht("Repository methods are new and subject to change."); 15 12 } 16 13 17 14 public function getMethodDescription() { 18 - return "Query repositories."; 15 + return pht("Query repositories."); 19 16 } 20 17 21 18 public function defineParamTypes() { 22 19 return array( 20 + 'ids' => 'optional list<int>', 21 + 'phids' => 'optional list<phid>', 22 + 'callsigns' => 'optional list<string>', 23 + 'vcsTypes' => 'optional list<string>', 23 24 ); 24 25 } 25 26 ··· 33 34 } 34 35 35 36 protected function execute(ConduitAPIRequest $request) { 36 - $repositories = id(new PhabricatorRepositoryQuery()) 37 - ->setViewer($request->getUser()) 38 - ->execute(); 37 + $query = id(new PhabricatorRepositoryQuery()) 38 + ->setViewer($request->getUser()); 39 + 40 + $ids = $request->getValue('ids', array()); 41 + if ($ids) { 42 + $query->withIDs($ids); 43 + } 44 + 45 + $phids = $request->getValue('phids', array()); 46 + if ($phids) { 47 + $query->withPHIDs($phids); 48 + } 49 + 50 + $callsigns = $request->getValue('callsigns', array()); 51 + if ($callsigns) { 52 + $query->withCallsigns($callsigns); 53 + } 54 + 55 + $vcs_types = $request->getValue('vcsTypes', array()); 56 + if ($vcs_types) { 57 + $query->withTypes($vcs_types); 58 + } 59 + 60 + $repositories = $query->execute(); 39 61 40 62 $results = array(); 41 63 foreach ($repositories as $repository) {
+9 -1
src/applications/repository/storage/PhabricatorRepository.php
··· 77 77 78 78 public function toDictionary() { 79 79 return array( 80 + 'id' => $this->getID(), 80 81 'name' => $this->getName(), 81 82 'phid' => $this->getPHID(), 82 83 'callsign' => $this->getCallsign(), 84 + 'monogram' => $this->getMonogram(), 83 85 'vcs' => $this->getVersionControlSystem(), 84 86 'uri' => PhabricatorEnv::getProductionURI($this->getURI()), 85 87 'remoteURI' => (string)$this->getRemoteURI(), 86 - 'tracking' => $this->getDetail('tracking-enabled'), 87 88 'description' => $this->getDetail('description'), 89 + 'isActive' => $this->isTracked(), 90 + 'isHosted' => $this->isHosted(), 91 + 'isImporting' => $this->isImporting(), 88 92 ); 93 + } 94 + 95 + public function getMonogram() { 96 + return 'r'.$this->getCallsign(); 89 97 } 90 98 91 99 public function getDetail($key, $default = null) {