Github integtation

37 views
Skip to first unread message

Jungho Ahn

unread,
Sep 12, 2016, 2:35:31 AM9/12/16
to Repo and Gerrit Discussion
Hello,

I'm trying to setup a Gerrit review server with integrating with a private organization repositories on Github.
Is there any tutorial or document on this?

Thanks,

Magnus Bäck

unread,
Sep 12, 2016, 2:45:52 AM9/12/16
to Jungho Ahn, Repo and Gerrit Discussion
On Friday, September 09, 2016 at 22:25 CEST,
"Integrate Gerrit with GitHub" can mean many different things. What,
exactly, are you trying to accomplish?

--
Magnus Bäck | Software Engineer, Firmware Platform Tools
magnu...@axis.com | Axis Communications

Jungho Ahn

unread,
Sep 12, 2016, 3:02:26 AM9/12/16
to Repo and Gerrit Discussion, jungh...@snapchat.com
We have private repositories on GitHub. I'd like to use Gerrit-review process with the existing GitHub repositories.

Jungho Ahn

unread,
Sep 12, 2016, 4:21:49 AM9/12/16
to Repo and Gerrit Discussion, jungh...@snapchat.com
I'm trying to use github-plugin. (I'm not sure whether this is the best way to do this.)
But I got the following error with gerrit 2.12.4. 

[2016-09-12 00:41:22,120] [main] WARN  com.google.gerrit.server.plugins.PluginLoader : Cannot load plugin github-plugin
java.lang.NoClassDefFoundError: com/google/gerrit/extensions/client/MenuItem
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
        at java.lang.Class.getDeclaredMethods(Class.java:1975)
        at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:688)
        at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:380)
        at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:164)
        at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:613)
        at com.google.inject.internal.InjectorImpl.cleanup(InjectorImpl.java:569)
        at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:555)
        at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:884)
        at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:805)
        at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:789)
        at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:282)
        at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:214)
        at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:890)
        at com.google.inject.internal.FactoryProxy.notify(FactoryProxy.java:46)
        at com.google.inject.internal.ProcessedBindingData.runCreationListeners(ProcessedBindingData.java:50)
        at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:134)
        at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
        at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:226)
        at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:233)
        at com.google.gerrit.server.plugins.ServerPlugin.startPlugin(ServerPlugin.java:190)
        at com.google.gerrit.server.plugins.ServerPlugin.start(ServerPlugin.java:173)
        at com.google.gerrit.server.plugins.PluginLoader.runPlugin(PluginLoader.java:480)
        at com.google.gerrit.server.plugins.PluginLoader.rescan(PluginLoader.java:407)
        at com.google.gerrit.server.plugins.PluginLoader.start(PluginLoader.java:311)
        at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:74)
        at com.google.gerrit.pgm.Daemon.start(Daemon.java:302)
        at com.google.gerrit.pgm.Daemon.run(Daemon.java:203)
        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:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:159)
        at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:100)
        at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:56)
        at Main.main(Main.java:25)
Caused by: java.lang.ClassNotFoundException: com.google.gerrit.extensions.client.MenuItem
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

Luca Milanesio

unread,
Sep 12, 2016, 9:27:59 AM9/12/16
to Jungho Ahn, Repo and Gerrit Discussion, Magnus Bäck
Hi Jungho,
one of the deepest way to integrate is through GerritHub.io (see [1]) which includes:

a) OAuth integration
b) GitHub Orgs / Teams as Gerrit group backend
c) GitHub Profile lookup
d) Replication

... but the minimum would be only d) using the replication plugin.

As Magnus said ... what are you trying to achieve?

Luca.

[1] https://www.youtube.com/watch?v=jeWTvDad6VM
> --
> --
> 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.

Jungho Ahn

unread,
Sep 12, 2016, 11:26:59 AM9/12/16
to Repo and Gerrit Discussion, jungh...@snapchat.com, magnu...@axis.com


On Monday, September 12, 2016 at 6:27:59 AM UTC-7, lucamilanesio wrote:
Hi Jungho,
one of the deepest way to integrate is through GerritHub.io (see [1]) which includes:

a) OAuth integration
b) GitHub Orgs / Teams as Gerrit group backend
c) GitHub Profile lookup
d) Replication

... but the minimum would be only d) using the replication plugin.

As Magnus said ... what are you trying to achieve?

I just want
  1) my team members use Gerrit review again our private GitHub repositories
  2) Gerrit pushes reviewed/verfied changes to the GitHub on behalf of individuals.

Then, I guess I need a) and b) ? Can I achieve this with just d)?

Luca Milanesio

unread,
Sep 12, 2016, 11:17:31 PM9/12/16
to Jungho Ahn, Repo and Gerrit Discussion, Magnus Bäck
See my feedback inline.

On 12 Sep 2016, at 08:26, 'Jungho Ahn' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:



On Monday, September 12, 2016 at 6:27:59 AM UTC-7, lucamilanesio wrote:
Hi Jungho,
one of the deepest way to integrate is through GerritHub.io (see [1]) which includes:

a) OAuth integration
b) GitHub Orgs / Teams as Gerrit group backend
c) GitHub Profile lookup
d) Replication

... but the minimum would be only d) using the replication plugin.

As Magnus said ... what are you trying to achieve?

I just want
  1) my team members use Gerrit review again our private GitHub repositories

d) would suffice for that.

  2) Gerrit pushes reviewed/verfied changes to the GitHub on behalf of individuals.

This isn't actually possible: Gerrit will push to GitHub using the Gerrit's identity. Gerrit cannot push on behalf of the individuals as it does't have the SSH keys (or HTTP passwords) of the people.

Isn't enough for you to get the commits pushed to GitHub? What do you need the identity of the individuals? They are already the Authors and Committers of the changes, the GitHub identity at push time shouldn't really matter  isn't it?

Jungho Ahn

unread,
Sep 12, 2016, 11:34:24 PM9/12/16
to Luca Milanesio, Repo and Gerrit Discussion, Magnus Bäck
Thanks a lot Luca! 
A few more questions inlined.

On Mon, Sep 12, 2016 at 8:17 PM, Luca Milanesio <luca.mi...@gmail.com> wrote:
See my feedback inline.

On 12 Sep 2016, at 08:26, 'Jungho Ahn' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:



On Monday, September 12, 2016 at 6:27:59 AM UTC-7, lucamilanesio wrote:
Hi Jungho,
one of the deepest way to integrate is through GerritHub.io (see [1]) which includes:

a) OAuth integration
b) GitHub Orgs / Teams as Gerrit group backend
c) GitHub Profile lookup
d) Replication

... but the minimum would be only d) using the replication plugin.

As Magnus said ... what are you trying to achieve?

I just want
  1) my team members use Gerrit review again our private GitHub repositories

d) would suffice for that.

  2) Gerrit pushes reviewed/verfied changes to the GitHub on behalf of individuals.

This isn't actually possible: Gerrit will push to GitHub using the Gerrit's identity. Gerrit cannot push on behalf of the individuals as it does't have the SSH keys (or HTTP passwords) of the people.

Isn't enough for you to get the commits pushed to GitHub? What do you need the identity of the individuals? They are already the Authors and Committers of the changes, the GitHub identity at push time shouldn't really matter  isn't it?

Oh, I just want to see original authors/committers in the GitHub repository. I thought gerrit need to push on behalf of the individuals.

Then, it looks like I just need a) and d) since I'd like to provide SSO with GitHub account.
I also want to use GitHub teams as gerrit groups if it's not that difficult.

What plugin should I use for this? Is github-plugin the best and simple way?



Then, I guess I need a) and b) ? Can I achieve this with just d)?

 

Luca.

[1] https://www.youtube.com/watch?v=jeWTvDad6VM

> On 11 Sep 2016, at 23:45, Magnus Bäck <magnu...@axis.com> wrote:
>
> On Friday, September 09, 2016 at 22:25 CEST,
>     'Jungho Ahn' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:
>
>> I'm trying to setup a Gerrit review server with integrating with a
>> private organization repositories on Github.
>> Is there any tutorial or document on this?
>
> "Integrate Gerrit with GitHub" can mean many different things. What,
> exactly, are you trying to accomplish?
>
> --
> Magnus Bäck          | Software Engineer, Firmware Platform Tools
> magnu...@axis.com | Axis Communications
>
> --
> --
> 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.


--
--

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+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.




--
Jungho Ahn
Reply all
Reply to author
Forward
0 new messages