Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 386286

Summary: Enable Gerrit for ECF project
Product: Community Reporter: Markus Kuppe <bugs.eclipse.org>
Component: GitAssignee: Eclipse Webmaster <webmaster>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: remy.suen, sebastian.schmidt2, slewis, thanh.ha, wim.jongman
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Markus Kuppe CLA 2012-07-31 04:06:15 EDT
Hi Webmasters,

as per discussion [1], the ECF project would want to make use of the EF's hosted Gerrit installation for code reviews. However - to make things complicated - ECF does not use the EF's Hudson builder but an externally (OSUOSL) hosted Jenkins box. Is it possible to still integrate the EF Gerrit with our build box?

Thanks
Markus

[1] http://dev.eclipse.org/mhonarc/lists/ecf-dev/msg06016.html
Comment 1 Denis Roy CLA 2012-07-31 11:10:52 EDT
You'd have to give us the public key for a user on your end who would be authorized to log into Gerrit on our end and do stuff.  Since Gerrit would essentially "own" your Git repos, you understand that if your remote build box gets pwn3d nasty stuff may happen to humanity.


[ ] I agree with the terms.  Let me in.
Comment 2 Markus Kuppe CLA 2012-07-31 15:15:30 EDT
Isn't Gerrit also supposed to trigger builds on our build box when a new patch comes in? I don't understand how this works with us giving you a pub key.
Comment 3 Denis Roy CLA 2012-08-01 13:21:12 EDT
Your CI system can also log into Gerrit to vote on a changeset after it's been built, but if that's not what you're looking to do, then great.

Our Gerrit cannot talk to the outside world, so I'm not sure how it would trigger a build on a remote system.
Comment 4 Markus Kuppe CLA 2012-08-01 15:11:45 EDT
(In reply to comment #3)

> Our Gerrit cannot talk to the outside world, so I'm not sure how it would
> trigger a build on a remote system.

No exception to that (our build machine is managed by the OSU admins)? If no, we would problably have to pull Gerrit to kick off a build (and report afterwards).
Comment 5 Denis Roy CLA 2012-08-01 15:17:17 EDT
It can make a web call through the proxy, but for everything else, it's on a private, non-routable IP subnet  :/
Comment 6 Markus Kuppe CLA 2012-08-01 15:26:46 EDT
A web call, which includes the git branch name containing the patch, should be sufficient to trigger a Jenkins build. :)

Generally though, interfacing Gerrit and our Jenkins builder can be done later. First, ECF has to find out if Gerrit is the right hammer.
Comment 7 Denis Roy CLA 2012-08-01 15:31:13 EDT
> First, ECF has to find out if Gerrit is the right hammer.

That is funny  :-)


Keep me posted.
Comment 8 Markus Kuppe CLA 2013-01-07 05:27:33 EST
(In reply to comment #1)
> You'd have to give us the public key for a user on your end who would be
> authorized to log into Gerrit on our end and do stuff.

Where do you want me to send the pubkey? Attach it here or by email to webmasters? How do we compare fingerprints?

Thanks
Markus
Comment 9 Denis Roy CLA 2013-01-08 14:33:05 EST
scp it to your home directory on eclipse.org servers.
Comment 10 Markus Kuppe CLA 2013-01-09 03:41:10 EST
(In reply to comment #9)
> scp it to your home directory on eclipse.org servers.

It's in /home/data/users/mkuppe/.ssh/authorized_keys 

Thanks
Markus
Comment 11 Markus Kuppe CLA 2013-03-05 00:49:22 EST
Any word on when ECF can use Gerrit?
Comment 12 Denis Roy CLA 2013-03-12 15:46:37 EDT
As it turns out, You can manage your own keys in gerrit.

Log into Gerrit and go to https://git.eclipse.org/r/#/settings/ssh-keys

You'll be able to add all your keys there, then log in as yourself from a remote system.
Comment 13 Markus Kuppe CLA 2013-04-06 09:11:31 EDT
What is our Gerrit URL? ssh://userid@git.eclipse.org:29418/ecf/org.eclipse.ecf.git/ doesn't work nor does ECF show up as a project on https://git.eclipse.org/r/
Comment 14 Eclipse Webmaster CLA 2013-04-09 10:50:21 EDT
I don't think Gerrit was actually enabled for ECF as comment 6 implied we should wait for the project to decide.  Since it sounds like you've decided I've enabled Gerrit for /gitroot/ecf/org.eclipse.ecf.git, which you should be able to access via:

ssh://userid@git.eclipse.org:29418/ecf/org.eclipse.ecf.git/ https://git.eclipse.org/r/p/ecf/org.eclipse.ecf.git.  

-M.
Comment 15 Sebastian Schmidt CLA 2013-04-14 10:02:03 EDT
When trying to push to gerrit I get:

sebs@lxsebs:~/ecf$ git push gerrit
Enter passphrase for key '/home/sebs/.ssh/id_rsa': 
fatal: One or more refs/for/ names blocks change upload
fatal: The remote end hung up unexpectedly

I used the following remote config:

[remote "gerrit"]
  url = ssh://sschmidt@git.eclipse.org:29418/ecf/org.eclipse.ecf.git
  fetch = +refs/heads/master:refs/remotes/gerrit/master
  push = HEAD:refs/for/master

Is there maybe something wrong with my config? Or some problems with the repository? The Code Recommenders project apparently had the same issue before: 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=372131#c3
Comment 16 Eclipse Webmaster CLA 2013-04-16 10:42:57 EDT
This sounds like 372131 and 377415.  I've run the fix from those bugs, so let me know if you're still having issues.

org.eclipse.ecf.git # git for-each-ref refs/for
b6aa593a73526e1f5c40c088f158b30535453278 commit refs/for/master
org.eclipse.ecf.git # for n in $(git for-each-ref --format='%(refname)' refs/for); do git update-ref -d $n; done
org.eclipse.ecf.git # git for-each-ref refs/for
org.eclipse.ecf.git #


-M.
Comment 17 Wim Jongman CLA 2013-04-19 12:00:26 EDT
(In reply to comment #16)
> This sounds like 372131 and 377415.  I've run the fix from those bugs, so
> let me know if you're still having issues.
> 

We are still having issues:

If I push with ssh I get:  ssh://wxxxxn@git.eclipse.org:29418/ecf/org.eclipse.ecf.git: java.net.ConnectException: Connection refused: connect

with https:  https://git.eclipse.org/r/p/ecf/org.eclipse.ecf.git: not authorized
Comment 18 Eclipse Webmaster CLA 2013-04-19 14:21:08 EDT
If I look in the Gerrit error logs I see things that indicate you're using your gmail address rather than the email we have on file.  Have you recently updated your gerrit account?

It's also possible there is a block on your IP if you send it to me I'll go digging.

-M.
Comment 19 Wim Jongman CLA 2013-04-21 13:00:57 EDT
(In reply to comment #18)
> If I look in the Gerrit error logs I see things that indicate you're using
> your gmail address rather than the email we have on file.  Have you recently
> updated your gerrit account?
> 
> It's also possible there is a block on your IP if you send it to me I'll go
> digging.

Hi Matt,

I have changed my account recently but I can push to e4 Gerrit fine. I cannot push to ECF Gerrit. I have no idea why the gmail email pops up. 

I can still not push to ECF gerrit also not from home. I keep on getting the not authorized message.

Home ip: 62.194.239.173
Comment 20 Eclipse Webmaster CLA 2013-04-22 11:29:43 EDT
(In reply to comment #19)

> I have changed my account recently but I can push to e4 Gerrit fine. I
> cannot push to ECF Gerrit. 

I reset your password so I could add my key to Gerrit and try pushing using your account and had no issues committing a 1 line change to org.eclipse.ecf/examples/bundles/org.eclipse.ecf.examples.webinar/urls.txt.

This is the URL I used for checkout and commit: 

ssh://wjongman@git.eclipse.org:29418/ecf/org.eclipse.ecf.git

This post(http://stackoverflow.com/questions/14320817/how-to-push-change-to-gerrit-server-via-http) implies that you'll need to generate a password to push via HTTPS ( I suspect this is the cause of the 'not authorized' message)
 
> Home ip: 62.194.239.173

I checked and there isn't a block on that IP or the class C subnet.  

-M.
Comment 21 Wim Jongman CLA 2013-04-22 12:09:47 EDT
(In reply to comment #20)

I understand the https push problems now and the ssh push is probably caused by a company policy on the port. Thanks for sticking with me Matt. I appreciate that. I will try again from home tonight.
Comment 22 Wim Jongman CLA 2013-04-23 08:12:42 EDT
I have changed my pw in gerrit and pushed with wjongman and the gerrit password:

I now get:

 https://git.eclipse.org/r/p/ecf/org.eclipse.ecf.git: 500 com.google.inject.ProvisionException: Guice provision errors:  1) Error in custom provider, java.lang.IllegalStateException: Request has already been cleaned up  ==== Cleanup Calling Thread: HTTP-98987 java.lang.Thread.getStackTraceImpl(Native Method) java.lang.Thread.getStackTrace(Thread.java:1042) com.google.gerrit.server.RequestCleanup.collectCleanupThreadInfo(RequestCleanup.java:73) com.google.gerrit.server.RequestCleanup.run(RequestCleanup.java:54) com.google.gerrit.httpd.RequestContextFilter.doFilter(RequestContextFilter.java:91) com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163) com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58) com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118) com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113) org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322) org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java
Comment 23 Wim Jongman CLA 2013-04-23 08:16:27 EDT
(In reply to comment #22)

If I try to push with ssh, user wjongman password: my eclipse password

ssh://wjongman@git.eclipse.org:29418/ecf/org.eclipse.ecf.git: Auth fail
Comment 24 Eclipse Webmaster CLA 2013-04-23 10:01:24 EDT
(In reply to comment #23)
> If I try to push with ssh, user wjongman password: my eclipse password

Not sure I have an explanation for this as I uploaded my ssh key to the Gerrit key manager(Settings -> SSH Public keys) to do the testing.  Since the sshd service gerrit provides is different than the system ssh service, perhaps the password you generated for HTTPS access could be used? Or you could try public key authentication.


(In reply to comment #22)
> I have changed my pw in gerrit and pushed with wjongman and the gerrit
> password:
> 

I see the following in the logs:

'wjongman' failed to sign in: No such user:wjongman

A little digging on Google and staring at the config file makes me think you should be using the email address associated with your committer account rather than your committer id for this service.

-M.
Comment 25 Thanh Ha CLA 2013-04-23 10:06:30 EDT
I use my username that Gerrit tells me in Settings > Profile. In my case it's actually the same username ass my committer id.

As for password, Gerrit SSH does not allow password authentication. You MUST upload a SSH Public Key to authenticate if you want to use SSH.

If this is an issue for you and you want to use a password, you can also use the https url which will allow you to use a password. In this case however Gerrit will generate a http password for you Settings > HTTP Password.

Hope this helps.
Comment 26 Wim Jongman CLA 2013-04-23 11:34:15 EDT
(In reply to comment #25)

If I use my gerrit user: wjongman and the gerrit password together with push uri

https:// ...

I get the error as shown in comment 22.
Comment 27 Wim Jongman CLA 2013-04-23 11:35:05 EDT
I can pull and clone from the https uri just fine.
Comment 28 Thanh Ha CLA 2013-04-23 11:45:24 EDT
(In reply to comment #26)
> (In reply to comment #25)
> 
> If I use my gerrit user: wjongman and the gerrit password together with push
> uri
> 
> https:// ...
> 
> I get the error as shown in comment 22.

I found a Gerrit post about a similar issue: https://groups.google.com/forum/?fromgroups=#!topic/repo-discuss/OP6hg1KYah8

Can you try without the /p/ part in the URL?
Comment 29 Wim Jongman CLA 2013-04-23 11:53:28 EDT
(In reply to comment #28)

You are the greatest Thanh! Thanks! That worked.
Comment 30 Scott Lewis CLA 2013-04-23 11:57:34 EDT
I've just tried to configure my own use with gerrit, and have gotten some of the way, but not all the way to push :)

I changed my ssh url to be:

ssh://slewis@git.eclipse.org:29418/gitroot/ecf/org.eclipse.ecf.git

I then tried to push and got Auth fail.

I logged into gerrit and uploaded my public key...but now when I attempt to push it says:

ssh://slewis@git.eclipse.org:29418/gitroot/ecf/org.eclipse.ecf.git: not a Gerrit project

Do I have the incorrect path or something?  When I look in the list of projects (in Gerrit) I do not see rt/org.eclipse.ecf listed at all.

BTW...ECF has two git repos...i.e. one for source and one for website.  Are these both going to be moved to gerrit? ...or only the source one?  (my current assumption).
Comment 31 Markus Kuppe CLA 2013-04-23 11:59:33 EDT
(In reply to comment #30)
> ssh://slewis@git.eclipse.org:29418/gitroot/ecf/org.eclipse.ecf.git: not a
> Gerrit project
> 
> Do I have the incorrect path or something?  When I look in the list of
> projects (in Gerrit) I do not see rt/org.eclipse.ecf listed at all.

Yes, remove the "gitroot/" part.

 ssh://git.eclipse.org:29418/ecf/org.eclipse.ecf.git
Comment 32 Scott Lewis CLA 2013-04-23 12:06:31 EDT
(In reply to comment #31)
> (In reply to comment #30)
> > ssh://slewis@git.eclipse.org:29418/gitroot/ecf/org.eclipse.ecf.git: not a
> > Gerrit project
> > 
> > Do I have the incorrect path or something?  When I look in the list of
> > projects (in Gerrit) I do not see rt/org.eclipse.ecf listed at all.
> 
> Yes, remove the "gitroot/" part.
> 
>  ssh://git.eclipse.org:29418/ecf/org.eclipse.ecf.git

Ok...thanks Markus.  That does it.   

Markus...would you be willing to send a note to ecf-dev?...for current committers to do the changeover?   And at least point them to this bug...wrt https and ssh changes (if you could summarize them that would be great).   Hopefully the experience of the three of us (Markus, Wim, and myself) can help simplify the transition for other committers.