Commit aa6e788f authored by epriestley's avatar epriestley
Browse files

Mark "v3" API methods as stable; mark obsoleted methods as "Frozen"

Summary:
Ref T12074. The "v3" API methods (`*.search`, `*.edit`) are currently marked as "unstable", but they're pretty stable and essentially all new code should be using them.

Although these methods are seeing some changes, almost all changes are additive (support for new constraints or attachemnts) and do not break backward compatibility. We have no major, compatibility-breaking changes planned.

I don't want to mark the older methods "deprecated" yet since `arc` still uses a lot of them and there are some capabilities not yet available on the v3 methods, but introduce a new "frozen" status with pointers to the new methods.

Overall, this should gently push users toward the newer methods.

Test Plan: {F2325323}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12074

Differential Revision: https://secure.phabricator.com/D17158
parent 63bfa5cc
......@@ -128,6 +128,13 @@ final class PhabricatorConduitConsoleController
$stability_label = pht('Deprecated Method');
$stability_info = nonempty($reason, pht('This method is deprecated.'));
break;
case ConduitAPIMethod::METHOD_STATUS_FROZEN:
$stability_icon = 'fa-archive grey';
$stability_label = pht('Frozen Method');
$stability_info = nonempty(
$reason,
pht('This method is frozen and will eventually be deprecated.'));
break;
default:
$stability_label = null;
break;
......
......@@ -11,9 +11,10 @@ abstract class ConduitAPIMethod
private $viewer;
const METHOD_STATUS_STABLE = 'stable';
const METHOD_STATUS_UNSTABLE = 'unstable';
const METHOD_STATUS_DEPRECATED = 'deprecated';
const METHOD_STATUS_STABLE = 'stable';
const METHOD_STATUS_UNSTABLE = 'unstable';
const METHOD_STATUS_DEPRECATED = 'deprecated';
const METHOD_STATUS_FROZEN = 'frozen';
const SCOPE_NEVER = 'scope.never';
const SCOPE_ALWAYS = 'scope.always';
......
......@@ -66,7 +66,8 @@ final class PhabricatorConduitMethodQuery
}
$status = array(
ConduitAPIMethod::METHOD_STATUS_STABLE => $this->isStable,
ConduitAPIMethod::METHOD_STATUS_STABLE => $this->isStable,
ConduitAPIMethod::METHOD_STATUS_FROZEN => $this->isStable,
ConduitAPIMethod::METHOD_STATUS_DEPRECATED => $this->isDeprecated,
ConduitAPIMethod::METHOD_STATUS_UNSTABLE => $this->isUnstable,
);
......
......@@ -166,6 +166,10 @@ final class PhabricatorConduitSearchEngine
$item->addIcon('fa-warning', pht('Deprecated'));
$item->setStatusIcon('fa-warning red');
break;
case ConduitAPIMethod::METHOD_STATUS_FROZEN:
$item->addIcon('fa-archive', pht('Frozen'));
$item->setStatusIcon('fa-archive grey');
break;
}
$list->addItem($item);
......
......@@ -11,6 +11,16 @@ final class DifferentialCloseConduitAPIMethod
return pht('Close a Differential revision.');
}
public function getMethodStatus() {
return self::METHOD_STATUS_FROZEN;
}
public function getMethodStatusDescription() {
return pht(
'This method is frozen and will eventually be deprecated. New code '.
'should use "differential.revision.edit" instead.');
}
protected function defineParamTypes() {
return array(
'revisionID' => 'required int',
......
......@@ -11,6 +11,16 @@ final class DifferentialCreateCommentConduitAPIMethod
return pht('Add a comment to a Differential revision.');
}
public function getMethodStatus() {
return self::METHOD_STATUS_FROZEN;
}
public function getMethodStatusDescription() {
return pht(
'This method is frozen and will eventually be deprecated. New code '.
'should use "differential.revision.edit" instead.');
}
protected function defineParamTypes() {
return array(
'revision_id' => 'required revisionid',
......
......@@ -11,6 +11,16 @@ final class DifferentialCreateRevisionConduitAPIMethod
return pht('Create a new Differential revision.');
}
public function getMethodStatus() {
return self::METHOD_STATUS_FROZEN;
}
public function getMethodStatusDescription() {
return pht(
'This method is frozen and will eventually be deprecated. New code '.
'should use "differential.revision.edit" instead.');
}
protected function defineParamTypes() {
return array(
// TODO: Arcanist passes this; prevent fatals after D4191 until Conduit
......
......@@ -11,6 +11,16 @@ final class DifferentialQueryConduitAPIMethod
return pht('Query Differential revisions which match certain criteria.');
}
public function getMethodStatus() {
return self::METHOD_STATUS_FROZEN;
}
public function getMethodStatusDescription() {
return pht(
'This method is frozen and will eventually be deprecated. New code '.
'should use "differential.revision.search" instead.');
}
protected function defineParamTypes() {
$hash_types = ArcanistDifferentialRevisionHash::getTypes();
$hash_const = $this->formatStringConstants($hash_types);
......
......@@ -11,6 +11,16 @@ final class DifferentialUpdateRevisionConduitAPIMethod
return pht('Update a Differential revision.');
}
public function getMethodStatus() {
return self::METHOD_STATUS_FROZEN;
}
public function getMethodStatusDescription() {
return pht(
'This method is frozen and will eventually be deprecated. New code '.
'should use "differential.revision.edit" instead.');
}
protected function defineParamTypes() {
return array(
'id' => 'required revisionid',
......
......@@ -11,6 +11,16 @@ final class ManiphestCreateTaskConduitAPIMethod
return pht('Create a new Maniphest task.');
}
public function getMethodStatus() {
return self::METHOD_STATUS_FROZEN;
}
public function getMethodStatusDescription() {
return pht(
'This method is frozen and will eventually be deprecated. New code '.
'should use "maniphest.edit" instead.');
}
protected function defineParamTypes() {
return $this->getTaskFields($is_new = true);
}
......
......@@ -10,6 +10,16 @@ final class ManiphestInfoConduitAPIMethod extends ManiphestConduitAPIMethod {
return pht('Retrieve information about a Maniphest task, given its ID.');
}
public function getMethodStatus() {
return self::METHOD_STATUS_FROZEN;
}
public function getMethodStatusDescription() {
return pht(
'This method is frozen and will eventually be deprecated. New code '.
'should use "maniphest.search" instead.');
}
protected function defineParamTypes() {
return array(
'task_id' => 'required id',
......
......@@ -10,6 +10,16 @@ final class ManiphestQueryConduitAPIMethod extends ManiphestConduitAPIMethod {
return pht('Execute complex searches for Maniphest tasks.');
}
public function getMethodStatus() {
return self::METHOD_STATUS_FROZEN;
}
public function getMethodStatusDescription() {
return pht(
'This method is frozen and will eventually be deprecated. New code '.
'should use "maniphest.search" instead.');
}
protected function defineParamTypes() {
$statuses = array(
ManiphestTaskQuery::STATUS_ANY,
......
......@@ -10,6 +10,16 @@ final class ManiphestUpdateConduitAPIMethod extends ManiphestConduitAPIMethod {
return pht('Update an existing Maniphest task.');
}
public function getMethodStatus() {
return self::METHOD_STATUS_FROZEN;
}
public function getMethodStatusDescription() {
return pht(
'This method is frozen and will eventually be deprecated. New code '.
'should use "maniphest.edit" instead.');
}
protected function defineErrorTypes() {
return array(
'ERR-BAD-TASK' => pht('No such Maniphest task exists.'),
......
......@@ -10,6 +10,16 @@ final class PasteCreateConduitAPIMethod extends PasteConduitAPIMethod {
return pht('Create a new paste.');
}
public function getMethodStatus() {
return self::METHOD_STATUS_FROZEN;
}
public function getMethodStatusDescription() {
return pht(
'This method is frozen and will eventually be deprecated. New code '.
'should use "paste.edit" instead.');
}
protected function defineParamTypes() {
return array(
'content' => 'required string',
......
......@@ -10,6 +10,16 @@ final class PasteQueryConduitAPIMethod extends PasteConduitAPIMethod {
return pht('Query Pastes.');
}
public function getMethodStatus() {
return self::METHOD_STATUS_FROZEN;
}
public function getMethodStatusDescription() {
return pht(
'This method is frozen and will eventually be deprecated. New code '.
'should use "paste.search" instead.');
}
protected function defineParamTypes() {
return array(
'ids' => 'optional list<int>',
......
......@@ -10,6 +10,16 @@ final class UserQueryConduitAPIMethod extends UserConduitAPIMethod {
return pht('Query users.');
}
public function getMethodStatus() {
return self::METHOD_STATUS_FROZEN;
}
public function getMethodStatusDescription() {
return pht(
'This method is frozen and will eventually be deprecated. New code '.
'should use "user.search" instead.');
}
protected function defineParamTypes() {
return array(
'usernames' => 'optional list<string>',
......
......@@ -10,6 +10,16 @@ final class ProjectCreateConduitAPIMethod extends ProjectConduitAPIMethod {
return pht('Create a project.');
}
public function getMethodStatus() {
return self::METHOD_STATUS_FROZEN;
}
public function getMethodStatusDescription() {
return pht(
'This method is frozen and will eventually be deprecated. New code '.
'should use "project.edit" instead.');
}
protected function defineParamTypes() {
return array(
'name' => 'required string',
......
......@@ -10,6 +10,16 @@ final class ProjectQueryConduitAPIMethod extends ProjectConduitAPIMethod {
return pht('Execute searches for Projects.');
}
public function getMethodStatus() {
return self::METHOD_STATUS_FROZEN;
}
public function getMethodStatusDescription() {
return pht(
'This method is frozen and will eventually be deprecated. New code '.
'should use "project.search" instead.');
}
protected function defineParamTypes() {
$statuses = array(
......
......@@ -8,11 +8,13 @@ final class RepositoryQueryConduitAPIMethod
}
public function getMethodStatus() {
return self::METHOD_STATUS_UNSTABLE;
return self::METHOD_STATUS_FROZEN;
}
public function getMethodStatusDescription() {
return pht('Repository methods are new and subject to change.');
return pht(
'This method is frozen and will eventually be deprecated. New code '.
'should use "diffusion.repository.query" instead.');
}
public function getMethodDescription() {
......
......@@ -32,17 +32,6 @@ abstract class PhabricatorSearchEngineAPIMethod
return PhabricatorApplication::getByClass($class);
}
public function getMethodStatus() {
return self::METHOD_STATUS_UNSTABLE;
}
public function getMethodStatusDescription() {
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() {
return array(
'queryKey' => 'optional string',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment