Page MenuHomePhabricator

Read arc aliases from all available configuration files
ClosedPublic

Authored by epriestley on Feb 24 2016, 9:17 AM.

Details

Summary

Fixes T10431. Updates the getAliases() method to read every arc configuration file.

Test Plan

Added an arc duck alias to /etc/arcconfig, ran arc duck, saw "quack".

Added an arc pig alias to ~/.arcrc via arc alias, ran arc pig, saw "oink oink".

Diff Detail

Repository
rARC Arcanist
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

nevogd retitled this revision from to Read arc aliases from system configuration file.
nevogd updated this object.
nevogd edited the test plan for this revision. (Show Details)
eadler added a project: Restricted Project.
eadler added a subscriber: eadler.
epriestley added a reviewer: nevogd.
  • Allow aliases to be defined in any recognized configuration file.
epriestley retitled this revision from Read arc aliases from system configuration file to Read arc aliases from all available configuration files.Jun 6 2016, 7:36 PM
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.

Historically, the initial version of "aliases" was intended to be user specific, so it wasn't a "config" key.

D2191 changed this so that .arcconfig could also define them, but they remained defined in a nonstandard way in .arcrc.

Later changes added more configuration sources and D7271 consolidated configuration management, but since this one was weird it never got expanded to work with other sources.

This makes "aliases" definable in any source using standard precedence rules (runtime, local, project, user, system) by working around the weirdness of the "aliases" key in the ConfigurationManager itself. This isn't especially pretty but makes the behavior correct.

chad edited edge metadata.
This revision is now accepted and ready to land.Jun 6 2016, 7:46 PM
This revision was automatically updated to reflect the committed changes.