1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 08:12:40 +01:00

Fix an issue where "arc" may fail on startup when trying to read older "default" config

Summary:
See PHI1663. If "phabricator.uri" is not configured, we try to fall back to "default", but doesn't have a modern config specification and fails.

Instead, read "default" as a raw config value to preserve compatible behavior. My intent is to eventually remove it.

Test Plan:
In a directory with no "phabricator.uri" config available, ran `echo {} | arc call-conduit conduit.ping`. After the patch, got a reasonable error instead of a fatal.

In a directory with "default" configured but not "phabricator.uri", ran the same command. After the patch, got a ping.

Maniphest Tasks: T13497

Differential Revision: https://secure.phabricator.com/D21039
This commit is contained in:
epriestley 2020-03-06 07:19:28 -08:00
parent 5451d28752
commit 31653f6b77

View file

@ -680,7 +680,13 @@ final class ArcanistRuntime {
$conduit_uri = $config->getConfig('phabricator.uri');
if ($conduit_uri === null) {
$conduit_uri = $config->getConfig('default');
// For now, read this older config from raw storage. There is currently
// no definition of this option in the "toolsets" config list, and it
// would be nice to get rid of it.
$default_list = $config->getStorageValueList('default');
if ($default_list) {
$conduit_uri = last($default_list)->getValue();
}
}
if ($conduit_uri) {