Download of latest build?

190 views
Skip to first unread message

Matthew Webber

unread,
Jun 23, 2014, 5:05:51 AM6/23/14
to repo-d...@googlegroups.com
I'm very interested in testing/using the new "GitHub OAuth login for Gerrit" functionality (changeset), and I just see "This patchset was cherry picked to branch stable-2.9".

Is there a download link for the latest build? I see that 2.9-rc2 is available, but the snapshot (or whatever) builds don't seem to be available anywhere. Obviously I could download the source and build it myself, but if the CI server has already done that ...
Yes I understand the limitations of a snapshot build.

Thanks

Luca Milanesio

unread,
Jun 23, 2014, 5:12:32 AM6/23/14
to Matthew Webber, repo-d...@googlegroups.com
Hi Matthew,

the Gerrit 2.9-RC on the CI build is:

That Gerrit 2.9 RC does not include anyway the GitHub OAuth login as the change has been cherry-picked but *NOT* merged yet.

I can create an extra Job to pull the GitHub OAuth and get that build and downloadable as a unique WAR. 
You'll see that popping up in a few hours on http://ci.gerritforge.com.

Luca.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matthew Webber

unread,
Jun 23, 2014, 5:41:19 AM6/23/14
to Luca Milanesio, repo-d...@googlegroups.com
Fantastic, thanks! I see that Jenkins job Gerrit-stable-2.9-github-oauth is running now. I'll grab the .war when it's done ad take it for a spin.
Matthew

Luca Milanesio

unread,
Jun 23, 2014, 6:18:42 AM6/23/14
to Matthew Webber, repo-d...@googlegroups.com
There you go:

I will do a smoke-test locally so that you have more confidence that it is working :-)

Luca.

lucamilanesio

unread,
Jun 23, 2014, 6:30:39 AM6/23/14
to repo-d...@googlegroups.com, mat...@unsolvable.org
Works fine for me :-)

A couple of extra warnings:

W1: At the moment after the initial set-up you'll be forced to login via GitHub, even when you'll logout from Gerrit explicitly.
W2: The automatic e-mail / full name provisioning from GitHub is not integrated yet: you'll need to enter them manually through the Gerrit registration screen when the account is created the first time

With regards to W1, it is not really a limitation of the GitHub authentication implemented by a known mechanism of the Gerrit HTTP authentication. If you want to allow anonymous users to access Gerrit without necessarily logging in to GitHub, you can enable auth.loginUrl = /login on your gerrit.config (see https://gerrit-review.googlesource.com/Documentation/config-gerrit.html#auth).

With regards to W2, it is not supported yet: once the change will be merged we could easily make an extra patch to enable it as well.

Let me know if you managed to get it working on 2.9.

Luca.

Matthew Webber

unread,
Jun 24, 2014, 10:16:59 AM6/24/14
to lucamilanesio, repo-d...@googlegroups.com
It's not working for me, but I suspect that's something to do with my configuration:
* This is a fresh Gerrit install, and I'm using the embedded servlet container (Jetty?), not behind a reverse proxy, and using http not https.
* The GitHub OAuth setup has been done, with a client secret and key generated, and the Authorization callback URL set to http://<mygerrit>:8080/oauth

When I browse to my new Gerrit install, I am taken the GitHub to authorize ("public data only", although I should probably have set it to "user:email").
I "authorize application". The browser waits for some time and then displays "Request for access token not authorised".

Is that configuration expected to work, or does my Gerrit need to be running https? (Note: our Gerrit instance is not publicly visible, so lack of https is not a security concern).

I can open a ticket if you prefer. I dumped the stack track from error_log at http://pastebin.com/6SbBb9eK. Does Gerrit use the proxy defined by my ${https_proxy} environment variable?

Thanks
Matthew

Luca Milanesio

unread,
Jun 24, 2014, 10:32:52 AM6/24/14
to Matthew Webber, repo-d...@googlegroups.com
In reality, the GitHub OAuth handshake completed successfully *BUT* the final phase where Gerrit needs to fetch your GitHub profile using GitHub API failed:
  1. [2014-06-24 11:20:21,683] ERROR com.google.gerrit.httpd.auth.github.OAuthProtocol : GET https://api.github.com/user with authToken https://github.com/login/oauth/access_token request failed
  2. org.apache.http.conn.HttpHostConnectException: Connection to https://api.github.com refused
  3.         at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190)
  4.         at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
  5.         at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:643)
  6.         at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
  7.         at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
  8.         at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
  9.         at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
  10.         at com.google.gerrit.httpd.auth.github.OAuthProtocol.httpGetGitHubUserInfo(OAuthProtocol.java:124)
  11.         at com.google.gerrit.httpd.auth.github.OAuthProtocol.retrieveUser(OAuthProtocol.java:114)
  12.         at com.google.gerrit.httpd.auth.github.GitHubLogin.retrieveUser(GitHubLogin.java:100)
  13.         at com.google.gerrit.httpd.auth.github.GitHubLogin.login(GitHubLogin.java:62)


Do you have connectivity to the internet and to https://api.github.com from your Gerrit machine?
(not from your browser but from Gerrit backend)

Can you try to execute:

and send out the output ?

Luca.

Matthew Webber

unread,
Jun 24, 2014, 10:59:35 AM6/24/14
to Luca Milanesio, repo-d...@googlegroups.com
The connectivity should be ok. I put the output at http://pastebin.com/Brw1XLuM (that's from the Gerrit machine)
You will notice it is being routed through a proxy.

Luca Milanesio

unread,
Jun 24, 2014, 11:12:09 AM6/24/14
to Matthew Webber, repo-d...@googlegroups.com
OK, that's the thing: the current patch uses an HTTP Client without setting up proxy settings.

An extra patch-set would be required to set up proxy settings read from gerrit.config.
According to HTTP Client documentation:

Shouldn't be difficult, you can make yourself the changes, put the extra patch-set and I'll modify the CI job to put to the amended patch.

Luca.

Luca Milanesio

unread,
Jun 24, 2014, 11:48:28 AM6/24/14
to Matthew Webber, repo-discuss
Yes, it makes sense to reuse them completely.

Luca.

On 24 Jun 2014, at 16:37, Matthew Webber <mat...@unsolvable.org> wrote:

That makes sense ... it always felt like a proxy issue of some sort.

I'm not actually a Java programmer at all, but I'll take a look at making the change to use a proxy (should be straightforward I imagine).

Gerrit actually has an existing properties called http.proxy, http.proxyUsername, http.proxyPassword, but the documentation specifies that they are used "when making outgoing HTTP connections for OpenID login transactions". Are they the appropriate properties to (re)use? Should there be a parallel set for https?

Thanks for your help.
Matthew

Andre Saddler

unread,
Jun 29, 2014, 5:46:21 AM6/29/14
to repo-d...@googlegroups.com, mat...@unsolvable.org
currently receiving this error: http://pastebin.com/4RABCMmY

Andre Saddler

unread,
Jun 29, 2014, 6:26:33 AM6/29/14
to repo-d...@googlegroups.com, mat...@unsolvable.org
http://pastebin.com/RijY0uui
^ script i made for downloading latest sources from you guys jenkins. i get everything to finish but gerrit.sh wont start

lucamilanesio

unread,
Jun 29, 2014, 8:14:47 PM6/29/14
to repo-d...@googlegroups.com, mat...@unsolvable.org
Try building https://gerrit-review.googlesource.com/#/c/58150 and installing on top of Gerrit master.
I've found that seems that  Gerrit-PluginName is kind of mandatory now.

The init step was successful for me.

HTH.

Luca.

Andre Saddler

unread,
Jun 29, 2014, 11:15:56 PM6/29/14
to repo-d...@googlegroups.com, mat...@unsolvable.org
whats the build process tut lol, the only i linked seem to be a bit dated

Luca Milanesio

unread,
Jun 30, 2014, 8:30:04 AM6/30/14
to Andre Saddler, repo-d...@googlegroups.com, mat...@unsolvable.org
For building the GitHub plugin, just read the README.md at:

For building Gerrit, just refer to the Gerrit Development documentation at:

What is the link you were using?

Luca.

Matthew Webber

unread,
Jul 4, 2014, 12:52:48 PM7/4/14
to repo-d...@googlegroups.com, mat...@unsolvable.org
With just a small change to PooledHttpClientProvider, I managed to get the GitHub authentication working through a proxy.

I didn't submit a patch, since I am not a Java programmer and I don't understand how it should actually be coded (considering threading, pools etc). So I opened a ticket with the details, I hope that's ok. Maybe you or someone will be able to pick this up. The ticket is: http://code.google.com/p/gerrit/issues/detail?id=2757

Will the GitHub authentication be in 2.9 final? I'd really like to see it there; I notice that recently a number of new Gerrit sites, not just us, have been caught out by Google's removal of their support for OpenID.

We'll continue to test the GitHub authentication and I'll open tickets or start a new group topic as I come across issues. Meantime, thank you very much for you work on this, it's really valuable.

Matthew

Andre Saddler

unread,
Jul 11, 2014, 9:15:30 AM7/11/14
to repo-d...@googlegroups.com, dresad...@gmail.com, mat...@unsolvable.org
still having issues getting this up and running...
do you have 2.9 oauth plugins.. all i see is either 2.8 or 2.10

Luca Milanesio

unread,
Jul 11, 2014, 9:47:33 AM7/11/14
to Andre Saddler, repo-d...@googlegroups.com, mat...@unsolvable.org
You've got now a patch on 2.9 that builds and works (even if it was abandoned):
git fetch https://gerrit.googlesource.com/gerrit refs/changes/10/58010/2 && git checkout FETCH_HEAD

That works out of the box :-)

Luca.

Andre Saddler

unread,
Jul 11, 2014, 5:47:45 PM7/11/14
to repo-d...@googlegroups.com, dresad...@gmail.com, mat...@unsolvable.org
tried the commit: 

http://pastebin.com/5Sycd2Ae

1 error
        at com.google.gerrit.lucene.LuceneVersionManager.start(LuceneVersionManager.java:118)
        at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:74)
        at com.google.gerrit.pgm.Daemon.start(Daemon.java:290)
        at com.google.gerrit.pgm.Daemon.run(Daemon.java:202)
        at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:64)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:166)
        at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:93)
        at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:50)
        at Main.main(Main.java:25)

Andre Saddler

unread,
Jul 11, 2014, 5:49:44 PM7/11/14
to repo-d...@googlegroups.com, dresad...@gmail.com, mat...@unsolvable.org
http://pastebin.com/GxFG1JAh


On Friday, July 11, 2014 9:47:33 AM UTC-4, lucamilanesio wrote:

Andre Saddler

unread,
Jul 11, 2014, 6:16:41 PM7/11/14
to repo-d...@googlegroups.com
got it to work but receiving this: Request for access token not authorised

L Waver

unread,
Jul 15, 2014, 10:11:39 PM7/15/14
to repo-d...@googlegroups.com
Andre & Lucu, any news on this working with Google Authentication yet?  Or even a confirmed GitHub authentication method?
Reply all
Reply to author
Forward
0 new messages