From 5ece2d93b1474f00c035e67639a0f6cf08824567 Mon Sep 17 00:00:00 2001 From: Pppery Date: Tue, 16 Dec 2025 12:54:00 -0500 Subject: [PATCH] bin/config set: mention database possibly overriding local settings Summary: Fixes T16399 Test Plan: - Run the command with various settings defined in the database and see an error - Run the command with settings not defined in the database and don't see an error - Run the command with borked database settings and see it work Reviewers: O1 Blessed Committers, mainframe98 Reviewed By: O1 Blessed Committers, mainframe98 Subscribers: mainframe98, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T16399 Differential Revision: https://we.phorge.it/D26596 --- .../PhabricatorConfigManagementSetWorkflow.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php index d69e903bcc..a6b31941ff 100644 --- a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php +++ b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php @@ -154,6 +154,24 @@ final class PhabricatorConfigManagementSetWorkflow Filesystem::readablePath($local_path))); } + try { + $dbstore = new PhabricatorConfigDatabaseSource('default'); + $dbval = $dbstore->getKeys(array($key)); + if (!empty($dbval)) { + echo tsprintf( + "** %s ** %s\n", + pht('OVERRIDDEN'), + pht( + 'The configuration key "%s" is already defined in the '. + 'database. The value from the database will override the '. + 'value in local storage.', + $key)); + } + } catch (Throwable $ex) { + // The database config is hosed (or we're doing initial setup and + // don't have a database yet), just ignore + } + $write_message = pht( 'Wrote configuration key "%s" to local storage (in file "%s").', $key, -- 2.51.2