From 31653f6b7749242ab5f6fd528afe55adb3599e40 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 6 Mar 2020 07:19:28 -0800 Subject: [PATCH] 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 --- src/runtime/ArcanistRuntime.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/runtime/ArcanistRuntime.php b/src/runtime/ArcanistRuntime.php index d9473dbc..91742aea 100644 --- a/src/runtime/ArcanistRuntime.php +++ b/src/runtime/ArcanistRuntime.php @@ -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) {