Store Almanac "service types" instead of "service classes"

Summary:
Ref T10449. Currently, we store classes (like "AlmanacClusterRepositoryServiceType") in the database.

Instead, store types (like "cluster.repository").

This is a small change, but types are a little more flexible (they let us freely reanme classes), a little cleaner (fewer magic strings in the codebase), and a little better for API usage (they're more human readable).

Make this minor usability change now, before we unprototype.

Also make services searchable by type.

Also remove old Almanac API endpoints.

Test Plan:
  - Ran migration, verified all data migrated properly.
  - Created, edited, rebound, and changed properties of services.
  - Searched for services by service type.
  - Reviewed available Conduit methods.

Reviewers: chad

Reviewed By: chad

Subscribers: yelirekim

Maniphest Tasks: T10449

Differential Revision: https://secure.phabricator.com/D15346
This commit is contained in:
epriestley
2016-02-25 05:05:36 -08:00
parent 4c97d88aa4
commit 7d4b323da2
23 changed files with 226 additions and 282 deletions

View File

@@ -47,9 +47,9 @@ final class DiffusionRepositoryCreateController
// allocations, we fail.
$services = id(new AlmanacServiceQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
->withServiceClasses(
->withServiceTypes(
array(
'AlmanacClusterRepositoryServiceType',
AlmanacClusterRepositoryServiceType::SERVICETYPE,
))
->needProperties(true)
->execute();