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

Bug 487132

Summary: Unable to push to GitHub via git publisher plugin
Product: Community Reporter: Hiroshi Ito <itohiro73>
Component: CI-JenkinsAssignee: CI Admin Inbox <ci.admin-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: frederic.gurr, mikael.barbero, webmaster
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
cli-git-clone none

Description Hiroshi Ito CLA 2016-02-03 09:56:42 EST
For Eclipse Collections project (using HIPP), we want to create a release build that pushes version # changes in pom files & tag the commit in GitHub repo. We're making use of git publisher plugin for this purpose, however it's not able to push to GitHub.

If we use ssh GitHub URL (git@github.com:eclipse/eclipse-collections.git), hudson fails to clone the repo (timeout) to begin with.
build log: https://hudson.eclipse.org/collections/job/service-release/8/console

If we use https GitHub URL (https://github.com/eclipse/eclipse-collections.git), hudson fails at push.
build log: https://hudson.eclipse.org/collections/job/service-release/6/console

Please advise what's the correct methodology to use git publisher in Hudson to push to GitHub.

Thanks,
Hiroshi
Comment 1 Mikaël Barbero CLA 2016-02-03 10:12:50 EST
Your Hudson user is not a committer on the project, so it can't access out of the box to the git repo through ssh.

However, we can setup a ssh deploy key (https://developer.github.com/guides/managing-deploy-keys/) for Hudson. This way you will be able to push through the ssh URL. 

Is it ok with you?
Comment 2 Hiroshi Ito CLA 2016-02-03 10:50:20 EST
Thanks, it sounds reasonable to me. Could you please set it up?

One another question. Later on, we are looking to set-up another build that publishes a website sourcing from GitHub repo (https://github.com/itohro/www.eclipse.org-collections currently blank), build a static web from source files and push the outcome to eclipse git repo (git.eclipse.org/www.eclipse.org/collections). Can we configure hudson user to be able to commit/push to this repo, too? For this build, hudson only requires write access to the latter eclipse git repo.
Comment 3 Mikaël Barbero CLA 2016-02-03 11:46:47 EST
I've configured your HIPP to be able to push to GitHub (over ssh).

I've also configured your HIPP to be able to write to www.eclipse.org/collections. However you will need to use the local filesystem URI for this one on the HIPP, i.e. /gitroot/www.eclipse.org/collections.git. 

Note that by writing to the repo's filesystem, the HIPP bypasses Gerrit. It can interfere with Gerrit's operation (e.g., if someone pushes to refs/for/master on the filesystem, Gerrit for that project will break). Not very common, it's still something to be careful about ;)

Please reopen if you face issues.
Comment 4 Hiroshi Ito CLA 2016-02-03 20:48:54 EST
Thanks for taking care of this.

However the hudson build still cannot clone the repo via ssh (connection timeout). The problem is at clone, not yet at push.

Please find the error from a build that I created for test.

https://hudson.eclipse.org/collections/job/test/4/console

I tried with URLs "git@github.com:eclipse/eclipse-collections.git" and "ssh://git@github.com/eclipse/eclipse-collections.git", neither worked (same error).

Wondering if this is related: https://help.github.com/articles/using-ssh-over-the-https-port/

Please kindly take a look.
Comment 5 Mikaël Barbero CLA 2016-02-04 04:01:30 EST
Created attachment 259557 [details]
cli-git-clone

It is a known issue with the Hudson Git plugin. When using it with Github repo, you need to check the "Use Command line git to clone" (you need to click on the second "Advanced" button in the git section to reveal this option). See attached screenshot

I've activated it for your test job, and it worked (https://hudson.eclipse.org/collections/job/test/5/console).
Comment 6 Hiroshi Ito CLA 2016-02-04 12:17:49 EST
The build went successful! Thanks a lot for your help.
Comment 7 Frederic Gurr CLA 2016-07-28 04:09:11 EDT
Seems to be fixed. Please reopen if anything is missing.