Page MenuHomePhabricator

set custom arcrc file earlier
ClosedPublic

Authored by epriestley on May 22 2014, 10:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 3, 6:26 PM
Unknown Object (File)
Mon, Apr 1, 2:39 AM
Unknown Object (File)
Fri, Mar 29, 5:45 PM
Unknown Object (File)
Mar 11 2024, 5:48 PM
Unknown Object (File)
Feb 15 2024, 12:06 PM
Unknown Object (File)
Feb 15 2024, 12:06 PM
Unknown Object (File)
Feb 15 2024, 12:06 PM
Unknown Object (File)
Feb 15 2024, 12:06 PM
Subscribers

Details

Summary

It appears to have never really work? At least as far as phabricator.uri (empirically).

Test Plan

removed ~/.arcrc, run call-conduit user.whoami with --arcrc-file and --trace.
set-config, get-config and alias also read and write to the right place now.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

avivey retitled this revision from to set custom arcrc file earlier.
avivey updated this object.
avivey edited the test plan for this revision. (Show Details)
avivey added a reviewer: epriestley.

Is it possible you updated, picked up rARC85b6c58, and that fixed it? I don't immediately see why this would fix anything...

No...

With this change (And no ~/.arcrc):

avive@vm:~/tmp$ echo {} | arc --trace  --arcrc-file=./jenkins-arcrc  call-conduit user.whoami
libphutil loaded from '/home/avive/devtools/libphutil/src'.
arcanist loaded from '/home/avive/devtools/arcanist/src'.
Config: Reading user configuration file "./jenkins-arcrc"...
Config: Did not find system configuration at "/etc/arcconfig".
Working Copy: No candidate locations for .arcconfig from this working directory.
Working Copy: Path "/tmp" is not in any working copy.
>>> [0] <conduit> conduit.connect() <bytes = 507>
>>> [1] <http> http://phabricator-app1-uat.snc1/api/conduit.connect
<<< [1] <http> 178,642 us
<<< [0] <conduit> 178,990 us
Waiting for JSON parameters on stdin...
>>> [2] <conduit> user.whoami() <bytes = 159>
>>> [3] <http> http://phabricator-app1-uat.snc1/api/user.whoami
<<< [3] <http> 167,431 us
<<< [2] <conduit> 167,734 us
{"error":null,"errorMessage":null,"response":{"userName":"Jenkins",......

reset arcanist to f64dee0

avive@vm:~/tmp$ echo {} | arc --trace  --arcrc-file=./jenkins-arcrc  call-conduit user.whoami
libphutil loaded from '/home/avive/devtools/libphutil/src'.
arcanist loaded from '/home/avive/devtools/arcanist/src'.
Config: Did not find user configuration at "/home/avive/.arcrc".
Config: Did not find system configuration at "/etc/arcconfig".
Working Copy: No candidate locations for .arcconfig from this working directory.
Working Copy: Path "/tmp" is not in any working copy.
Usage Exception: This command requires arc to connect to a Phabricator install, but no
Phabricator installation is configured. To configure a Phabricator URI:

  - set a default location with `arc set-config default <uri>`; or
  - specify '--conduit-uri=uri' explicitly; or
  - run 'arc' in a working copy with an '.arcconfig'.


[2014-05-22 23:09:34] EXCEPTION: (ArcanistUsageException) This command requires arc to connect to a Phabricator install, but no
Phabricator installation is configured. To configure a Phabricator URI:

  - set a default location with `arc set-config default <uri>`; or
  - specify '--conduit-uri=uri' explicitly; or
  - run 'arc' in a working copy with an '.arcconfig'.
 at [/home/avive/devtools/arcanist/scripts/arcanist.php:253]

I'm not exactly sure what's going on. The code doesn't look like this should change anything.

epriestley edited reviewers, added: avivey; removed: epriestley.

Oh, 104219d added caching. Let me fix that...

epriestley edited edge metadata.
  • Also make the cache per-path.
scripts/arcanist.php
133–137

This is changed in any case (global_config is arcrc here).

I never used it, but I think it's better to load from the provided arcrc than from the user's home.

src/configuration/ArcanistConfigurationManager.php
167

Why not just clear this when setCustom... is called?

src/configuration/ArcanistConfigurationManager.php
168

Oh, I thought get/set were static because of this callsite. I'll fix that.

  • Get rid of a bunch of self:: calls to nonstatic functions.
avivey edited edge metadata.

Looks right to me...

Do you still want the change in scripts/arcanist.php?

Yeah -- see inline.

scripts/arcanist.php
87

I think it's good to leave it in, since it affects this, which give us a better value for load.

134

That is, this will now respect --arcrc-file.

This revision is now accepted and ready to land.May 23 2014, 9:06 PM
epriestley updated this revision to Diff 22025.

Closed by commit rARC0d0b8abcdd71 (authored by @epriestley).