From 448cd31fff917da1302f77fae9bbbdde82b382f7 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 23 Jun 2011 13:10:51 -0700 Subject: [PATCH] Automatically use the correct path for Conduit URIs in arc Summary: Right now, if you specify "/api" instead of "/api/" the entire world breaks in a horrible way. Generally, this whole thing is silly. Just use the right path. Test Plan: Edited .arcconfig to use the "wrong" path, so this diff demonstrates the change works. Reviewed By: llorca Reviewers: jungejason, llorca, aran, tuomaspelkonen CC: aran, llorca, epriestley Differential Revision: 506 --- .arcconfig | 2 +- scripts/arcanist.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.arcconfig b/.arcconfig index de02caaa..cc74a857 100644 --- a/.arcconfig +++ b/.arcconfig @@ -1,6 +1,6 @@ { "project_id" : "arcanist", - "conduit_uri" : "https://secure.phabricator.com/api/", + "conduit_uri" : "https://secure.phabricator.com/", "lint_engine" : "PhutilLintEngine", "unit_engine" : "PhutilUnitTestEngine", "remote_hooks_installed" : true, diff --git a/scripts/arcanist.php b/scripts/arcanist.php index 76f56638..5612b749 100755 --- a/scripts/arcanist.php +++ b/scripts/arcanist.php @@ -173,6 +173,15 @@ try { throw new ArcanistUsageException( "No Conduit URI is specified in the .arcconfig file for this project. ". "Specify the Conduit URI for the host Differential is running on."); + } else { + // Set the URI path to '/api/'. TODO: Originally, I contemplated letting + // you deploy Phabricator somewhere other than the domain root, but ended + // up never pursuing that. We should get rid of all "/api/" silliness + // in things users are expected to configure. This is already happening + // to some degree, e.g. "arc install-certificate" does it for you. + $conduit_uri = new PhutilURI($conduit_uri); + $conduit_uri->setPath('/api/'); + $conduit_uri = (string)$conduit_uri; } $conduit = new ConduitClient($conduit_uri); $workflow->setConduit($conduit); -- 2.43.0