gerrit and gitlab integration

3,541 views
Skip to first unread message

jo...@norricorp.f9.co.uk

unread,
Apr 6, 2017, 10:05:43 AM4/6/17
to Repo and Gerrit Discussion
Hi,
I have been asked to look at integrating gerrit with gitlab where gitlab would be used for issues and planning and gerrit for code review and integrating with Jenkins.
I was hoping I could share a single repository between gerrit and gitlab but I can't see how to do that. I had an existing gerrit repo and I can import that into gitlab but it simply takes a clone without any of the remote information, though I could add that manually.
Gerrit has its replication plugin so could I use that to update the gitlab repo?

My current "ideas" were to have a workflow of
create issue in gitlab,
  • create feature branch in gitlab
  • clone local repo from gerrit
  • add extra remote info for gitlab
  • pull feature to local repo from gitlab and do work, commit locally with gerrit change id
  • push to gerrit
  • do review actions and merge (which will update feature from magic)
  • replicate to gitlab
  • merge to integration on gitlab
When I see this written out, I do wonder if that is too complicated. And if it will even technically work. For instance, the gerrit repo would be updated indirectly via the local repos.

So, is the above doable? Should the above be done? is there a better way? For the moment, lets assume that gerrit and gitlab have to be there.

Regards,

Luca Milanesio

unread,
Apr 6, 2017, 10:08:46 AM4/6/17
to jo...@norricorp.f9.co.uk, Repo and Gerrit Discussion
Hi John,
I had in my pipeline exactly the same workstream: integrating Gerrit with GitLab pretty much we do currently with GitHub.

See the GerritHub video (Gerrit + GitLab) here:

Do you believe a similar integration with GitLab would work for you?
Shall we work together on it?

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.

tech....@gmail.com

unread,
Aug 2, 2023, 8:07:55 AM8/2/23
to Repo and Gerrit Discussion
Hi All,

Just needed some information.
Is Gerrithub available for enterprise use as a binary ? or is it a saas only? 

Fabio Ponciroli

unread,
Aug 2, 2023, 8:28:40 AM8/2/23
to tech....@gmail.com, Repo and Gerrit Discussion
Hi Shad,

On Wed, 2 Aug 2023 at 14:08, tech....@gmail.com <tech....@gmail.com> wrote:
Hi All,

Just needed some information.
Is Gerrithub available for enterprise use as a binary ? or is it a saas only? 

Gerrithub architecture is composed of 5 Gerrit nodes in different geographical locations, using multi-site [1] and pull-replication plugin [2] to keep them in sync.
The Git repositories are pushed, via the replication plugin, to Github as well, which is just used as a readonly version of the repositories.

All the components, Gerrit and the plugins, are opensource.

HTH,
Ponch

P.S.: Please avoid top posting on this list, instead use interleaved posting style [3] which is easier to follow a conversation



tech....@gmail.com

unread,
Aug 2, 2023, 8:38:04 AM8/2/23
to Repo and Gerrit Discussion
On Wednesday, 2 August 2023 at 17:58:40 UTC+5:30 Fabio Ponciroli wrote:
Hi Shad,

On Wed, 2 Aug 2023 at 14:08, tech....@gmail.com <tech....@gmail.com> wrote:
Hi All,

Just needed some information.
Is Gerrithub available for enterprise use as a binary ? or is it a saas only? 

Gerrithub architecture is composed of 5 Gerrit nodes in different geographical locations, using multi-site [1] and pull-replication plugin [2] to keep them in sync.
Thanks for the info, 
The Git repositories are pushed, via the replication plugin, to Github as well, which is just used as a readonly version of the repositories.
If I have a gerrit with ldap auth, and want to integrate with github/gitlab  which will work as just read only version.
what should be the replication config, I mean how should the target mirror to be configured.

will that work as gerrit as code review frontend and when we click on repository, it will redirect to backend github/gitlab ?

Fabio Ponciroli

unread,
Aug 2, 2023, 9:46:32 AM8/2/23
to tech....@gmail.com, Repo and Gerrit Discussion
Hi Shad,

On Wed, 2 Aug 2023 at 14:39, tech....@gmail.com <tech....@gmail.com> wrote:


On Wednesday, 2 August 2023 at 17:58:40 UTC+5:30 Fabio Ponciroli wrote:
Hi Shad,

On Wed, 2 Aug 2023 at 14:08, tech....@gmail.com <tech....@gmail.com> wrote:
Hi All,

Just needed some information.
Is Gerrithub available for enterprise use as a binary ? or is it a saas only? 

Gerrithub architecture is composed of 5 Gerrit nodes in different geographical locations, using multi-site [1] and pull-replication plugin [2] to keep them in sync.
Thanks for the info, 
The Git repositories are pushed, via the replication plugin, to Github as well, which is just used as a readonly version of the repositories.
If I have a gerrit with ldap auth, and want to integrate with github/gitlab  which will work as just read only version.
what should be the replication config, I mean how should the target mirror to be configured.

There was already a thread asking the same. Have a look if it is of any help [1]. 


will that work as gerrit as code review frontend and when we click on repository, it will redirect to backend github/gitlab ?

Not sure I understand what you mean by frontend and backend in this context. However, the way it will work is that you will be able to do reviews via Gerrit which will store, internally, the git data.
The git date will also be replicated to github/gitlab. You will be able to access the repositories from github/gitlab as well, but they will be readonly.

This repository, for example, is accessible in Gerrithub [2] and Github [3].


 

Shad Perwez

unread,
Aug 2, 2023, 3:57:50 PM8/2/23
to Fabio Ponciroli, Repo and Gerrit Discussion


On Wed, 2 Aug, 2023, 7:16 pm Fabio Ponciroli, <pon...@gmail.com> wrote:
Hi Shad,

On Wed, 2 Aug 2023 at 14:39, tech....@gmail.com <tech....@gmail.com> wrote:


On Wednesday, 2 August 2023 at 17:58:40 UTC+5:30 Fabio Ponciroli wrote:
Hi Shad,

On Wed, 2 Aug 2023 at 14:08, tech....@gmail.com <tech....@gmail.com> wrote:
Hi All,

Just needed some information.
Is Gerrithub available for enterprise use as a binary ? or is it a saas only? 

Gerrithub architecture is composed of 5 Gerrit nodes in different geographical locations, using multi-site [1] and pull-replication plugin [2] to keep them in sync.
Thanks for the info, 
The Git repositories are pushed, via the replication plugin, to Github as well, which is just used as a readonly version of the repositories.
If I have a gerrit with ldap auth, and want to integrate with github/gitlab  which will work as just read only version.
what should be the replication config, I mean how should the target mirror to be configured.

There was already a thread asking the same. Have a look if it is of any help [1]. 
Looked into it. Looks like complete solution is not there.
replication.config
[remote - gitlab]
Url : what should be the complete url? 



will that work as gerrit as code review frontend and when we click on repository, it will redirect to backend github/gitlab ?

Not sure I understand what you mean by frontend and backend in this context. However, the way it will work is that you will be able to do reviews via Gerrit which will store, internally, the git data.
So that means, the merged git data will reside on gerrit and on the remote github/lab as well? Both will have its own independent storage, syncing will happen with replication plugin. 
The git date will also be replicated to github/gitlab. You will be able to access the repositories from github/gitlab as well, but they will be readonly.
Question: what is the benifit of having a read-only github/gitlab. Would it help to have a tool chain to evolve arround gerrit and gitlab/hub? Eventually which will help development of aosp and other domains as well?

Fabio Ponciroli

unread,
Aug 3, 2023, 3:01:08 AM8/3/23
to Shad Perwez, Repo and Gerrit Discussion
Hi,


On Wed, 2 Aug 2023 at 21:57, Shad Perwez <tech....@gmail.com> wrote:


On Wed, 2 Aug, 2023, 7:16 pm Fabio Ponciroli, <pon...@gmail.com> wrote:
Hi Shad,

On Wed, 2 Aug 2023 at 14:39, tech....@gmail.com <tech....@gmail.com> wrote:


On Wednesday, 2 August 2023 at 17:58:40 UTC+5:30 Fabio Ponciroli wrote:
Hi Shad,

On Wed, 2 Aug 2023 at 14:08, tech....@gmail.com <tech....@gmail.com> wrote:
Hi All,

Just needed some information.
Is Gerrithub available for enterprise use as a binary ? or is it a saas only? 

Gerrithub architecture is composed of 5 Gerrit nodes in different geographical locations, using multi-site [1] and pull-replication plugin [2] to keep them in sync.
Thanks for the info, 
The Git repositories are pushed, via the replication plugin, to Github as well, which is just used as a readonly version of the repositories.
If I have a gerrit with ldap auth, and want to integrate with github/gitlab  which will work as just read only version.
what should be the replication config, I mean how should the target mirror to be configured.

There was already a thread asking the same. Have a look if it is of any help [1]. 
Looked into it. Looks like complete solution is not there.
replication.config
[remote - gitlab]
Url : what should be the complete url? 

Did you check the documentation? [1] 



will that work as gerrit as code review frontend and when we click on repository, it will redirect to backend github/gitlab ?

Not sure I understand what you mean by frontend and backend in this context. However, the way it will work is that you will be able to do reviews via Gerrit which will store, internally, the git data.
So that means, the merged git data will reside on gerrit and on the remote github/lab as well? Both will have its own independent storage, syncing will happen with replication plugin. 

Correct.

The git date will also be replicated to github/gitlab. You will be able to access the repositories from github/gitlab as well, but they will be readonly.
Question: what is the benifit of having a read-only github/gitlab. Would it help to have a tool chain to evolve arround gerrit and gitlab/hub? Eventually which will help development of aosp and other domains as well?

Toolchain or any other reason you want to use github/gitlab for. 

tech....@gmail.com

unread,
Aug 3, 2023, 4:20:10 AM8/3/23
to Repo and Gerrit Discussion
On Thursday, 3 August 2023 at 12:31:08 UTC+5:30 Fabio Ponciroli wrote:
Hi,


On Wed, 2 Aug 2023 at 21:57, Shad Perwez <tech....@gmail.com> wrote:


On Wed, 2 Aug, 2023, 7:16 pm Fabio Ponciroli, <pon...@gmail.com> wrote:
Hi Shad,

On Wed, 2 Aug 2023 at 14:39, tech....@gmail.com <tech....@gmail.com> wrote:


On Wednesday, 2 August 2023 at 17:58:40 UTC+5:30 Fabio Ponciroli wrote:
Hi Shad,

On Wed, 2 Aug 2023 at 14:08, tech....@gmail.com <tech....@gmail.com> wrote:
Hi All,

Just needed some information.
Is Gerrithub available for enterprise use as a binary ? or is it a saas only? 

Gerrithub architecture is composed of 5 Gerrit nodes in different geographical locations, using multi-site [1] and pull-replication plugin [2] to keep them in sync.
Thanks for the info, 
The Git repositories are pushed, via the replication plugin, to Github as well, which is just used as a readonly version of the repositories.
If I have a gerrit with ldap auth, and want to integrate with github/gitlab  which will work as just read only version.
what should be the replication config, I mean how should the target mirror to be configured.

There was already a thread asking the same. Have a look if it is of any help [1]. 
Looked into it. Looks like complete solution is not there.
replication.config
[remote - gitlab]
Url : what should be the complete url? 

Did you check the documentation? [1] 

Yes, I did a setup with http credentials and URL. Two things we have observed are mentioned below
1. Manually created repositories with identical names (on gerrit and gitlab) are able to replicate from Gerrit to GitLab
2. Facing error if I create new repo on gerrit, here is the logs from replication log

[2023-08-02 20:41:24,963] Cannot create new project replication on remote site http://gitlab-poccom:8929/replication.git. [CONTEXT pushOneId="61271ce0" request="SSH" ]
[2023-08-02 20:41:24,965] Missing repository could not be created when replicating http://gitlab-poc.com:8929/replication.git [CONTEXT pushOneId="61271ce0" request="SSH" ]
 
replication.config
[gerrit]
        replicateOnStartup = false
        defaultForceUpdate = false
        autoReload = true
[remote "gitlab"]
        url = http://gitlab-poc.com:8929/${name}.git
        push = +refs/heads/*:refs/heads/*
        push = +refs/tags/*:refs/tags/*
        push = +refs/changes/*:refs/changes/*
        replicateProjectDeletions = true
        timeout = 70
        threads = 4
        replicationDelay = 15
        authGroup = Administrators
        mirror = true
        rescheduleDelay = 5
        createMissingRepositories = true

Fabio Ponciroli

unread,
Aug 3, 2023, 4:27:46 AM8/3/23
to tech....@gmail.com, Repo and Gerrit Discussion
Hi,


See Luca's answer about setting up Gerrit with Gitlab [1]. It may not be a viable solution.

 
Reply all
Reply to author
Forward
0 new messages