Page MenuHomePhabricator

D15769.diff
No OneTemporary

D15769.diff

diff --git a/src/applications/conduit/controller/PhabricatorConduitConsoleController.php b/src/applications/conduit/controller/PhabricatorConduitConsoleController.php
--- a/src/applications/conduit/controller/PhabricatorConduitConsoleController.php
+++ b/src/applications/conduit/controller/PhabricatorConduitConsoleController.php
@@ -23,25 +23,8 @@
$call_uri = '/api/'.$method->getAPIMethodName();
- $status = $method->getMethodStatus();
- $reason = $method->getMethodStatusDescription();
$errors = array();
- switch ($status) {
- case ConduitAPIMethod::METHOD_STATUS_DEPRECATED:
- $reason = nonempty($reason, pht('This method is deprecated.'));
- $errors[] = pht('Deprecated Method: %s', $reason);
- break;
- case ConduitAPIMethod::METHOD_STATUS_UNSTABLE:
- $reason = nonempty(
- $reason,
- pht(
- 'This method is new and unstable. Its interface is subject '.
- 'to change.'));
- $errors[] = pht('Unstable Method: %s', $reason);
- break;
- }
-
$form = id(new AphrontFormView())
->setAction($call_uri)
->setUser($request->getUser())
@@ -127,6 +110,41 @@
$view = id(new PHUIPropertyListView());
+ $status = $method->getMethodStatus();
+ $reason = $method->getMethodStatusDescription();
+
+ switch ($status) {
+ case ConduitAPIMethod::METHOD_STATUS_UNSTABLE:
+ $stability_icon = 'fa-exclamation-triangle yellow';
+ $stability_label = pht('Unstable Method');
+ $stability_info = nonempty(
+ $reason,
+ pht(
+ 'This method is new and unstable. Its interface is subject '.
+ 'to change.'));
+ break;
+ case ConduitAPIMethod::METHOD_STATUS_DEPRECATED:
+ $stability_icon = 'fa-exclamation-triangle red';
+ $stability_label = pht('Deprecated Method');
+ $stability_info = nonempty($reason, pht('This method is deprecated.'));
+ break;
+ default:
+ $stability_label = null;
+ break;
+ }
+
+ if ($stability_label) {
+ $view->addProperty(
+ pht('Stability'),
+ array(
+ id(new PHUIIconView())->setIcon($stability_icon),
+ ' ',
+ phutil_tag('strong', array(), $stability_label.':'),
+ ' ',
+ $stability_info,
+ ));
+ }
+
$view->addProperty(
pht('Returns'),
$method->getReturnType());
diff --git a/src/applications/owners/conduit/OwnersQueryConduitAPIMethod.php b/src/applications/owners/conduit/OwnersQueryConduitAPIMethod.php
--- a/src/applications/owners/conduit/OwnersQueryConduitAPIMethod.php
+++ b/src/applications/owners/conduit/OwnersQueryConduitAPIMethod.php
@@ -6,12 +6,17 @@
return 'owners.query';
}
+ public function getMethodStatus() {
+ return self::METHOD_STATUS_DEPRECATED;
+ }
+
+ public function getMethodStatusDescription() {
+ return pht('Obsolete; use "owners.search" instead.');
+ }
+
+
public function getMethodDescription() {
- return pht(
- 'Query for packages by one of the following: repository/path, '.
- 'packages with a given user or project owner, or packages affiliated '.
- 'with a user (owned by either the user or a project they are a member '.
- 'of.) You should only provide at most one search query.');
+ return pht('Query for Owners packages. Obsoleted by "owners.search".');
}
protected function defineParamTypes() {
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
@@ -37,7 +37,10 @@
}
public function getMethodStatusDescription() {
- return pht('ApplicationSearch methods are highly unstable.');
+ return pht(
+ 'ApplicationSearch methods are fairly stable, but were introduced '.
+ 'relatively recently and may continue to evolve as more applications '.
+ 'adopt them.');
}
final protected function defineParamTypes() {
diff --git a/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php b/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php
--- a/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php
+++ b/src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php
@@ -16,7 +16,10 @@
}
public function getMethodStatusDescription() {
- return pht('ApplicationEditor methods are highly unstable.');
+ return pht(
+ 'ApplicationEditor methods are fairly stable, but were introduced '.
+ 'relativelyr cently and may continue to evolve as more applications '.
+ 'adopt them.');
}
final protected function defineParamTypes() {

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 1:14 PM (18 h, 33 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6914098
Default Alt Text
D15769.diff (4 KB)

Event Timeline