HomePhabricator

Allow Almanac properties to be set and deleted via Conduit

Description

Allow Almanac properties to be set and deleted via Conduit

Summary:
Depends on D19342. Ref T12414. Ref T13120. This adds an EditEngine extension for editing Almanac properties.

The actual wire format is a little weird. Normally, we'd have a transaction for each property, but since you can pick any property names you want we can't really do that (we'd have to generate infinite transactions).

The transaction wire format anticipates that transactions may eventually get some kind of metadata -- each transaction looks like this:

{
  "type": "title",
  "value": "Example title"
}

...and we can add more keys there. For example, I could have made this transaction look like this:

{
  "type": "property.set",
  "almanac.property.key": "some-key",
  "value": "some-value"
}

However, I don't want to just accept any possible key freely, and it might be a decent chunk of work to formalize this better. It also doesn't feel great.

I just built special transaction types intead, so you:

{
  "type": "property.set",
  "value": {
   "some-key": "some-value",
   ...
  }
}

Internally, we may generate more than one transaction as a result (if the "value" has more than one key).

This feels a bit more natural and is probably easier for clients to use anyway.

Test Plan: Set and deleted Service, Device and Binding properties via the API.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13120, T12414

Differential Revision: https://secure.phabricator.com/D19343