HomePhabricator

Begin modularizing config options in a more modern way

Description

Begin modularizing config options in a more modern way

Summary:
Ref T12845. Config options are "modular", but the modularity is very old, half-implemented, and doesn't use modern patterns.

Half the types are hard-coded, while half the types are semi-modular but in a weird hacky way where you prefix the type with custom:....

The actual API is also weird and requires types to return a lot of array($stuff, $thing, $other_thing, $more_stuff) sorts of tuples.

Instead:

  • Add a new replacement layer which uses modern modularity patterns and overrides the older stuff if available, so we can migrate things one at a time.
  • New layer uses a more modern API -- no return array($thing, $other_thing, ...), and more modern building blocks (like AphrontHTTPParameterType).
  • New layer allows custom types to be deleted, which will ultimately let us deal with T12845.

Then, convert the 'int' type to use the new layer.

Test Plan:

  • Set, edited, tried-to-change-in-an-invalid-way, and deleted an 'int' option from the web UI.
  • Same from the CLI.
  • Edited config.json to have an invalid value, verified that the error was detected and config was repaired.

Reviewers: chad, amckinley

Reviewed By: amckinley

Maniphest Tasks: T12845

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