Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14835775
D14766.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
17 KB
Referenced Files
None
Subscribers
None
D14766.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -223,6 +223,7 @@
'ConduitAPIRequest' => 'applications/conduit/protocol/ConduitAPIRequest.php',
'ConduitAPIResponse' => 'applications/conduit/protocol/ConduitAPIResponse.php',
'ConduitApplicationNotInstalledException' => 'applications/conduit/protocol/exception/ConduitApplicationNotInstalledException.php',
+ 'ConduitBoolParameterType' => 'applications/conduit/parametertype/ConduitBoolParameterType.php',
'ConduitCall' => 'applications/conduit/call/ConduitCall.php',
'ConduitCallTestCase' => 'applications/conduit/call/__tests__/ConduitCallTestCase.php',
'ConduitConnectConduitAPIMethod' => 'applications/conduit/method/ConduitConnectConduitAPIMethod.php',
@@ -232,6 +233,7 @@
'ConduitException' => 'applications/conduit/protocol/exception/ConduitException.php',
'ConduitGetCapabilitiesConduitAPIMethod' => 'applications/conduit/method/ConduitGetCapabilitiesConduitAPIMethod.php',
'ConduitGetCertificateConduitAPIMethod' => 'applications/conduit/method/ConduitGetCertificateConduitAPIMethod.php',
+ 'ConduitIntParameterType' => 'applications/conduit/parametertype/ConduitIntParameterType.php',
'ConduitListParameterType' => 'applications/conduit/parametertype/ConduitListParameterType.php',
'ConduitLogGarbageCollector' => 'applications/conduit/garbagecollector/ConduitLogGarbageCollector.php',
'ConduitMethodDoesNotExistException' => 'applications/conduit/protocol/exception/ConduitMethodDoesNotExistException.php',
@@ -244,6 +246,7 @@
'ConduitResultSearchEngineExtension' => 'applications/conduit/query/ConduitResultSearchEngineExtension.php',
'ConduitSSHWorkflow' => 'applications/conduit/ssh/ConduitSSHWorkflow.php',
'ConduitStringListParameterType' => 'applications/conduit/parametertype/ConduitStringListParameterType.php',
+ 'ConduitStringParameterType' => 'applications/conduit/parametertype/ConduitStringParameterType.php',
'ConduitTokenGarbageCollector' => 'applications/conduit/garbagecollector/ConduitTokenGarbageCollector.php',
'ConduitUserListParameterType' => 'applications/conduit/parametertype/ConduitUserListParameterType.php',
'ConpherenceColumnViewController' => 'applications/conpherence/controller/ConpherenceColumnViewController.php',
@@ -4072,6 +4075,7 @@
'ConduitAPIRequest' => 'Phobject',
'ConduitAPIResponse' => 'Phobject',
'ConduitApplicationNotInstalledException' => 'ConduitMethodNotFoundException',
+ 'ConduitBoolParameterType' => 'ConduitListParameterType',
'ConduitCall' => 'Phobject',
'ConduitCallTestCase' => 'PhabricatorTestCase',
'ConduitConnectConduitAPIMethod' => 'ConduitAPIMethod',
@@ -4081,6 +4085,7 @@
'ConduitException' => 'Exception',
'ConduitGetCapabilitiesConduitAPIMethod' => 'ConduitAPIMethod',
'ConduitGetCertificateConduitAPIMethod' => 'ConduitAPIMethod',
+ 'ConduitIntParameterType' => 'ConduitListParameterType',
'ConduitListParameterType' => 'ConduitParameterType',
'ConduitLogGarbageCollector' => 'PhabricatorGarbageCollector',
'ConduitMethodDoesNotExistException' => 'ConduitMethodNotFoundException',
@@ -4093,6 +4098,7 @@
'ConduitResultSearchEngineExtension' => 'PhabricatorSearchEngineExtension',
'ConduitSSHWorkflow' => 'PhabricatorSSHWorkflow',
'ConduitStringListParameterType' => 'ConduitListParameterType',
+ 'ConduitStringParameterType' => 'ConduitListParameterType',
'ConduitTokenGarbageCollector' => 'PhabricatorGarbageCollector',
'ConduitUserListParameterType' => 'ConduitListParameterType',
'ConpherenceColumnViewController' => 'ConpherenceController',
diff --git a/src/applications/conduit/parametertype/ConduitEpochParameterType.php b/src/applications/conduit/parametertype/ConduitBoolParameterType.php
copy from src/applications/conduit/parametertype/ConduitEpochParameterType.php
copy to src/applications/conduit/parametertype/ConduitBoolParameterType.php
--- a/src/applications/conduit/parametertype/ConduitEpochParameterType.php
+++ b/src/applications/conduit/parametertype/ConduitBoolParameterType.php
@@ -1,36 +1,35 @@
<?php
-final class ConduitEpochParameterType
+final class ConduitBoolParameterType
extends ConduitListParameterType {
protected function getParameterValue(array $request, $key) {
$value = parent::getParameterValue($request, $key);
- if (!is_int($value)) {
+ if (!is_bool($value)) {
$this->raiseValidationException(
$request,
$key,
- pht('Expected integer, got something else.'));
+ pht('Expected boolean (true or false), got something else.'));
}
return $value;
}
protected function getParameterTypeName() {
- return 'epoch';
+ return 'bool';
}
protected function getParameterFormatDescriptions() {
return array(
- pht('Epoch timestamp, as an integer.'),
+ pht('A boolean.'),
);
}
protected function getParameterExamples() {
return array(
- '["PHID-PROJ-1111"]',
- '["backend"]',
- '["PHID-PROJ-2222", "frontend"]',
+ 'true',
+ 'false',
);
}
diff --git a/src/applications/conduit/parametertype/ConduitEpochParameterType.php b/src/applications/conduit/parametertype/ConduitEpochParameterType.php
--- a/src/applications/conduit/parametertype/ConduitEpochParameterType.php
+++ b/src/applications/conduit/parametertype/ConduitEpochParameterType.php
@@ -10,7 +10,14 @@
$this->raiseValidationException(
$request,
$key,
- pht('Expected integer, got something else.'));
+ pht('Expected epoch timestamp as integer, got something else.'));
+ }
+
+ if ($value <= 0) {
+ $this->raiseValidationException(
+ $request,
+ $key,
+ pht('Epoch timestamp must be larger than 0, got %d.', $value));
}
return $value;
@@ -28,9 +35,7 @@
protected function getParameterExamples() {
return array(
- '["PHID-PROJ-1111"]',
- '["backend"]',
- '["PHID-PROJ-2222", "frontend"]',
+ '1450019509',
);
}
diff --git a/src/applications/conduit/parametertype/ConduitEpochParameterType.php b/src/applications/conduit/parametertype/ConduitIntParameterType.php
copy from src/applications/conduit/parametertype/ConduitEpochParameterType.php
copy to src/applications/conduit/parametertype/ConduitIntParameterType.php
--- a/src/applications/conduit/parametertype/ConduitEpochParameterType.php
+++ b/src/applications/conduit/parametertype/ConduitIntParameterType.php
@@ -1,6 +1,6 @@
<?php
-final class ConduitEpochParameterType
+final class ConduitIntParameterType
extends ConduitListParameterType {
protected function getParameterValue(array $request, $key) {
@@ -17,20 +17,20 @@
}
protected function getParameterTypeName() {
- return 'epoch';
+ return 'int';
}
protected function getParameterFormatDescriptions() {
return array(
- pht('Epoch timestamp, as an integer.'),
+ pht('An integer.'),
);
}
protected function getParameterExamples() {
return array(
- '["PHID-PROJ-1111"]',
- '["backend"]',
- '["PHID-PROJ-2222", "frontend"]',
+ '123',
+ '0',
+ '-345',
);
}
diff --git a/src/applications/conduit/parametertype/ConduitEpochParameterType.php b/src/applications/conduit/parametertype/ConduitStringParameterType.php
copy from src/applications/conduit/parametertype/ConduitEpochParameterType.php
copy to src/applications/conduit/parametertype/ConduitStringParameterType.php
--- a/src/applications/conduit/parametertype/ConduitEpochParameterType.php
+++ b/src/applications/conduit/parametertype/ConduitStringParameterType.php
@@ -1,36 +1,34 @@
<?php
-final class ConduitEpochParameterType
+final class ConduitStringParameterType
extends ConduitListParameterType {
protected function getParameterValue(array $request, $key) {
$value = parent::getParameterValue($request, $key);
- if (!is_int($value)) {
+ if (!is_string($value)) {
$this->raiseValidationException(
$request,
$key,
- pht('Expected integer, got something else.'));
+ pht('Expected string, got something else.'));
}
return $value;
}
protected function getParameterTypeName() {
- return 'epoch';
+ return 'string';
}
protected function getParameterFormatDescriptions() {
return array(
- pht('Epoch timestamp, as an integer.'),
+ pht('A string.'),
);
}
protected function getParameterExamples() {
return array(
- '["PHID-PROJ-1111"]',
- '["backend"]',
- '["PHID-PROJ-2222", "frontend"]',
+ '"papaya"',
);
}
diff --git a/src/applications/owners/query/PhabricatorOwnersPackageSearchEngine.php b/src/applications/owners/query/PhabricatorOwnersPackageSearchEngine.php
--- a/src/applications/owners/query/PhabricatorOwnersPackageSearchEngine.php
+++ b/src/applications/owners/query/PhabricatorOwnersPackageSearchEngine.php
@@ -21,19 +21,29 @@
->setLabel(pht('Authority'))
->setKey('authorityPHIDs')
->setAliases(array('authority', 'authorities'))
+ ->setConduitKey('owners')
+ ->setDescription(
+ pht('Search for packages with specific owners.'))
->setDatasource(new PhabricatorProjectOrUserDatasource()),
id(new PhabricatorSearchDatasourceField())
->setLabel(pht('Repositories'))
->setKey('repositoryPHIDs')
+ ->setConduitKey('repositories')
->setAliases(array('repository', 'repositories'))
+ ->setDescription(
+ pht('Search for packages by included repositories.'))
->setDatasource(new DiffusionRepositoryDatasource()),
id(new PhabricatorSearchStringListField())
->setLabel(pht('Paths'))
->setKey('paths')
- ->setAliases(array('path')),
+ ->setAliases(array('path'))
+ ->setDescription(
+ pht('Search for packages affecting specific paths.')),
id(new PhabricatorSearchCheckboxesField())
->setKey('statuses')
->setLabel(pht('Status'))
+ ->setDescription(
+ pht('Search for active or archived packages.'))
->setOptions(
id(new PhabricatorOwnersPackage())
->getStatusNameMap()),
diff --git a/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php b/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php
--- a/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php
+++ b/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php
@@ -196,13 +196,13 @@
);
$head_builtin = pht('Builtin Order');
- $head_description = pht('Description');
+ $head_label = pht('Label');
$head_columns = pht('Columns');
$orders = $query->getBuiltinOrders();
$table = array();
- $table[] = "| {$head_builtin} | {$head_description} | {$head_columns} |";
+ $table[] = "| {$head_builtin} | {$head_label} | {$head_columns} |";
$table[] = '|-----------------|---------------------|-----------------|';
foreach ($orders as $key => $order) {
$name = $order['name'];
@@ -310,6 +310,10 @@
EOTEXT
);
+ $head_key = pht('Key');
+ $head_type = pht('Type');
+ $head_description = pht('Description');
+
$specs = $engine->getAllConduitFieldSpecifications();
$table = array();
diff --git a/src/applications/search/field/PhabricatorSearchCustomFieldProxyField.php b/src/applications/search/field/PhabricatorSearchCustomFieldProxyField.php
--- a/src/applications/search/field/PhabricatorSearchCustomFieldProxyField.php
+++ b/src/applications/search/field/PhabricatorSearchCustomFieldProxyField.php
@@ -63,4 +63,12 @@
$this->getValue());
}
+ public function getDescription() {
+ return $this->getCustomField()->getFieldDescription();
+ }
+
+ protected function newConduitParameterType() {
+ return $this->getCustomField()->getConduitSearchParameterType();
+ }
+
}
diff --git a/src/applications/search/field/PhabricatorSearchDatasourceField.php b/src/applications/search/field/PhabricatorSearchDatasourceField.php
--- a/src/applications/search/field/PhabricatorSearchDatasourceField.php
+++ b/src/applications/search/field/PhabricatorSearchDatasourceField.php
@@ -14,4 +14,8 @@
return $this;
}
+ protected function newConduitParameterType() {
+ return new ConduitStringListParameterType();
+ }
+
}
diff --git a/src/infrastructure/customfield/field/PhabricatorCustomField.php b/src/infrastructure/customfield/field/PhabricatorCustomField.php
--- a/src/infrastructure/customfield/field/PhabricatorCustomField.php
+++ b/src/infrastructure/customfield/field/PhabricatorCustomField.php
@@ -1337,6 +1337,17 @@
return false;
}
+ public function getConduitSearchParameterType() {
+ return $this->newConduitSearchParameterType();
+ }
+
+ protected function newConduitSearchParameterType() {
+ if ($this->proxy) {
+ return $this->proxy->newConduitSearchParameterType();
+ }
+ return null;
+ }
+
/* -( Herald )------------------------------------------------------------- */
diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php
--- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php
+++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php
@@ -463,4 +463,5 @@
return $this->getFieldValue();
}
+
}
diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldBool.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldBool.php
--- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldBool.php
+++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldBool.php
@@ -133,4 +133,7 @@
return new AphrontBoolHTTPParameterType();
}
+ protected function newConduitSearchParameterType() {
+ return new ConduitBoolParameterType();
+ }
}
diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php
--- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php
+++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php
@@ -197,4 +197,9 @@
return false;
}
+ protected function newConduitSearchParameterType() {
+ // TODO: Build a new "pair<epoch|null, epoch|null>" type or similar.
+ return null;
+ }
+
}
diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldHeader.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldHeader.php
--- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldHeader.php
+++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldHeader.php
@@ -30,4 +30,8 @@
return $this->getFieldName();
}
+ public function shouldAppearInApplicationSearch() {
+ return false;
+ }
+
}
diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php
--- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php
+++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php
@@ -116,5 +116,8 @@
return new AphrontIntHTTPParameterType();
}
+ protected function newConduitSearchParameterType() {
+ return new ConduitIntParameterType();
+ }
}
diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldLink.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldLink.php
--- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldLink.php
+++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldLink.php
@@ -84,4 +84,7 @@
return new AphrontStringHTTPParameterType();
}
+ protected function newConduitSearchParameterType() {
+ return new ConduitStringListParameterType();
+ }
}
diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldRemarkup.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldRemarkup.php
--- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldRemarkup.php
+++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldRemarkup.php
@@ -99,5 +99,8 @@
return new AphrontStringHTTPParameterType();
}
+ public function shouldAppearInApplicationSearch() {
+ return false;
+ }
}
diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldSelect.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldSelect.php
--- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldSelect.php
+++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldSelect.php
@@ -140,4 +140,7 @@
return new AphrontSelectHTTPParameterType();
}
+ protected function newConduitSearchParameterType() {
+ return new ConduitStringListParameterType();
+ }
}
diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldText.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldText.php
--- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldText.php
+++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldText.php
@@ -67,4 +67,8 @@
return new AphrontStringHTTPParameterType();
}
+ public function shouldAppearInApplicationSearch() {
+ return false;
+ }
+
}
diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldUsers.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldUsers.php
--- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldUsers.php
+++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldUsers.php
@@ -15,4 +15,8 @@
return new AphrontUserListHTTPParameterType();
}
+ protected function newConduitSearchParameterType() {
+ return new ConduitUserListParameterType();
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 31, 10:50 PM (12 h, 11 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7079993
Default Alt Text
D14766.diff (17 KB)
Attached To
Mode
D14766: Flesh out Conduit parameter types for Owners + CustomFields
Attached
Detach File
Event Timeline
Log In to Comment