Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepository.php
Show First 20 Lines • Show All 2,828 Lines • ▼ Show 20 Lines | return array( | ||||
'True if the repository is importing initial commits.')), | 'True if the repository is importing initial commits.')), | ||||
id(new PhabricatorConduitSearchFieldSpecification()) | id(new PhabricatorConduitSearchFieldSpecification()) | ||||
->setKey('almanacServicePHID') | ->setKey('almanacServicePHID') | ||||
->setType('phid?') | ->setType('phid?') | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'The Almanac Service that hosts this repository, if the '. | 'The Almanac Service that hosts this repository, if the '. | ||||
'repository is clustered.')), | 'repository is clustered.')), | ||||
id(new PhabricatorConduitSearchFieldSpecification()) | |||||
->setKey('refRules') | |||||
->setType('map<string, list<string>>') | |||||
->setDescription( | |||||
pht( | |||||
'The "Fetch" and "Permanent Ref" rules for this repository.')), | |||||
amckinley: Should be "Fetch, track, and permanent ref rules", right? | |||||
Done Inline ActionsI'm being sneaky about "track" since I'm trying to get rid of it. epriestley: I'm being sneaky about "track" since I'm trying to get rid of it. | |||||
); | ); | ||||
} | } | ||||
public function getFieldValuesForConduit() { | public function getFieldValuesForConduit() { | ||||
$fetch_rules = $this->getFetchRules(); | |||||
$track_rules = $this->getTrackOnlyRules(); | |||||
$permanent_rules = $this->getAutocloseOnlyRules(); | |||||
$fetch_rules = $this->getStringListForConduit($fetch_rules); | |||||
$track_rules = $this->getStringListForConduit($track_rules); | |||||
$permanent_rules = $this->getStringListForConduit($permanent_rules); | |||||
return array( | return array( | ||||
'name' => $this->getName(), | 'name' => $this->getName(), | ||||
'vcs' => $this->getVersionControlSystem(), | 'vcs' => $this->getVersionControlSystem(), | ||||
'callsign' => $this->getCallsign(), | 'callsign' => $this->getCallsign(), | ||||
'shortName' => $this->getRepositorySlug(), | 'shortName' => $this->getRepositorySlug(), | ||||
'status' => $this->getStatus(), | 'status' => $this->getStatus(), | ||||
'isImporting' => (bool)$this->isImporting(), | 'isImporting' => (bool)$this->isImporting(), | ||||
'almanacServicePHID' => $this->getAlmanacServicePHID(), | 'almanacServicePHID' => $this->getAlmanacServicePHID(), | ||||
'refRules' => array( | |||||
'fetchRules' => $fetch_rules, | |||||
'trackRules' => $track_rules, | |||||
'permanentRefRules' => $permanent_rules, | |||||
), | |||||
); | ); | ||||
} | } | ||||
private function getStringListForConduit($list) { | |||||
if (!is_array($list)) { | |||||
$list = array(); | |||||
} | |||||
foreach ($list as $key => $value) { | |||||
$value = (string)$value; | |||||
if (!strlen($value)) { | |||||
unset($list[$key]); | |||||
} | |||||
} | |||||
return array_values($list); | |||||
} | |||||
public function getConduitSearchAttachments() { | public function getConduitSearchAttachments() { | ||||
return array( | return array( | ||||
id(new DiffusionRepositoryURIsSearchEngineAttachment()) | id(new DiffusionRepositoryURIsSearchEngineAttachment()) | ||||
->setAttachmentKey('uris'), | ->setAttachmentKey('uris'), | ||||
); | ); | ||||
} | } | ||||
/* -( PhabricatorFulltextInterface )--------------------------------------- */ | /* -( PhabricatorFulltextInterface )--------------------------------------- */ | ||||
Show All 15 Lines |
Should be "Fetch, track, and permanent ref rules", right?