Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Arc location in Jenkins UI #19

Closed
lavahot opened this issue Jun 5, 2015 · 15 comments · Fixed by #23
Closed

Set Arc location in Jenkins UI #19

lavahot opened this issue Jun 5, 2015 · 15 comments · Fixed by #23

Comments

@lavahot
Copy link

lavahot commented Jun 5, 2015

Currently the plugin does not allow to set the location of arcanist (or install it). Please allow Jenkins UI to set the location of (and possibly install) arcanist.

@ascandella
Copy link
Contributor

Yes, currently it assumes that arc is in the path. I don't think the plugin should be installing binaries from other locations, but this should definitely be configurable.

@ascandella
Copy link
Contributor

I'm not a Java developer or a jenkins expert. Is there prior art around installing required tools? The idea of providing a self-contained arcanist/phutil sounds nice in theory, but messy in practice. What do you think?

@lavahot
Copy link
Author

lavahot commented Jun 6, 2015

Technically, the way to do this is to get the end-user to install arcanist themselves, but that is so messy at the moment that there could be any installation config, hence the arc path specification. If you use the Doxygen plugin, for example, you can specify the path or it will just use the PATH env variable to find the executable. This is great for Doxygen, which has it's own package installers, but terrible for arcanist, because it requires manual installation. There are plugins, like the Git plugin, which has an option to install automatically. I have no idea how this is set up or performed (PM, reserved installation, ?), and I've never tried it, because I can just do sudo apt-get install git. So there's precedence for installation, but I don't know the exact execution. Something to keep in mind is that Jenkins slaves are often set up by script, and will have programs installed on them as such, but adding an installation method makes it a little easier on Jenkins instance administrators. I guess what I'm saying is that there's no single right way, but maximizing ease of use goes a long way. If you haven't already, I'd strongly recommend reading the Jenkins Developer's Guide, which also talks about managing tools.

@ascandella
Copy link
Contributor

I think it's relatively easy to install (see #21) -- basically just cloning two repos, but that has prerequisites on PHP etc... I thought this was 2015? Isn't this the year of Linux on the desktop? Or is it google glass now. My memory is very poor.

@lavahot
Copy link
Author

lavahot commented Jun 6, 2015

Well, you could write a script that detects the package manager, installs the pre-reqs, and then pulls the git, but I think that may be outside of the bounds of the reasonable expectation of the plugin. Most plugins assume that the tools are installed, but most tools have packages where Arcanist does not (Oh dang, I just saw that there are packages, just not for LTS yet). I think you could say that some features have requirements and then let things fail gracefully when the requirements aren't met.

Year of Linux on the Desktop was about 2012-ish and the year of Google Glass was about two months in 2014. My memory is probably worse. ;)

@ascandella
Copy link
Contributor

OK, I'll wait for a code review on #23 and merge and release version 1.2 and let y'all try it out and report the results. I'd love to figure out a sane way to install/letup arcanist/libphutil by default but I am shockingly low on free time these days.

@lavahot
Copy link
Author

lavahot commented Jun 6, 2015

Thanks for all your hard work. I'm trying to get a Phab/Jenkins/Github combo setup for my startup and it would be impossible without this plugin and your improvements. You rock!

@ascandella
Copy link
Contributor

Just released 1.2 version of the plugin. LMK how this works for you, and how we can improve it for future users. Sounds like the biggest win will be autodetecting/installing arcanist/libphutil if they're not available. Opened #24 to track.

@lavahot
Copy link
Author

lavahot commented Jun 7, 2015

This is not quite working on my setup:

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'.

[phabricator] Unable to parse JSON from response:
FATAL: Invalid JSON String
net.sf.json.JSONException: Invalid JSON String
at net.sf.json.JSONSerializer.toJSON(JSONSerializer.java:143)
at net.sf.json.JSONSerializer.toJSON(JSONSerializer.java:103)
at net.sf.json.groovy.JsonSlurper.parseText(JsonSlurper.java:80)
at com.uber.jenkins.phabricator.conduit.ArcanistClient.callConduit(ArcanistClient.java:70)
at com.uber.jenkins.phabricator.conduit.Differential.callConduit(Differential.java:85)
at com.uber.jenkins.phabricator.conduit.Differential.(Differential.java:49)
at >com.uber.jenkins.phabricator.PhabricatorBuildWrapper.setUp(PhabricatorBuildWrapper.java:87)
at hudson.model.Build$BuildExecution.doRun(Build.java:156)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
at hudson.model.Run.execute(Run.java:1744)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)

I'm running this on a slave with arc in the path (you gave me the idea for a symlink) and added the conduit token to the entry in settings in Jenkins. My first guess from this is that I've now been able to setup arc and the plugin calls it, but the plugin is not passing the token correctly, maybe not at all.

@ascandella
Copy link
Contributor

Does the project have a .arcconfig in it with a phabricator.uri setting? I'm fairly certain the token is being passed correctly, but it looks like maybe it doesn't no phabricator URI is configured. See the error message:

This command requires arc to connect to a Phabricator install, but no
Phabricator installation is configured. To configure a Phabricator URI:

@ascandella
Copy link
Contributor

Definitely one thing that we're not currently doing, but should be doing, is passing the --conduit-uri param, but at least at Uber that's never been necessary because all projects have a .arcconfig which has a phabricator.uri pointing at the proper server.

@lavahot
Copy link
Author

lavahot commented Jun 7, 2015

Oh. Then I think I'm confused about something: Do I have to get Jenkins to pull the source code, or should the plugin pull the differential and the master for me? This is not clear in the documentation.

@ascandella
Copy link
Contributor

Yes, jenkins needs to gave git configured to point at your repo (otherwise how does it know which repo to apply the patch to?). I'll make a note to add it to the documentation.

@lavahot
Copy link
Author

lavahot commented Jun 7, 2015

Yeah, I thought about that after I wrote that last part. It's the only thing that makes sense. I'll fix that and get back to you.

@lavahot
Copy link
Author

lavahot commented Jun 7, 2015

Seems to be working now. Thanks!

ascandella added a commit to jenkinsci/phabricator-plugin that referenced this issue Jun 7, 2015
Problems like uber-archive#19 are misleading because it looks like a JSON parsing
error, when we know there is no JSON to parse. Make the callers deal
with the errors and print a useful error message as to why things are
failing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants