1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-21 22:32:41 +01:00

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
This commit is contained in:
epriestley 2011-06-23 13:10:51 -07:00
parent 051ef2c695
commit 448cd31fff
2 changed files with 10 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{ {
"project_id" : "arcanist", "project_id" : "arcanist",
"conduit_uri" : "https://secure.phabricator.com/api/", "conduit_uri" : "https://secure.phabricator.com/",
"lint_engine" : "PhutilLintEngine", "lint_engine" : "PhutilLintEngine",
"unit_engine" : "PhutilUnitTestEngine", "unit_engine" : "PhutilUnitTestEngine",
"remote_hooks_installed" : true, "remote_hooks_installed" : true,

View file

@ -173,6 +173,15 @@ try {
throw new ArcanistUsageException( throw new ArcanistUsageException(
"No Conduit URI is specified in the .arcconfig file for this project. ". "No Conduit URI is specified in the .arcconfig file for this project. ".
"Specify the Conduit URI for the host Differential is running on."); "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); $conduit = new ConduitClient($conduit_uri);
$workflow->setConduit($conduit); $workflow->setConduit($conduit);