Step by Step Gerrit and Gitlab integration

680 views
Skip to first unread message

IT Learning Center

unread,
Feb 16, 2023, 2:29:50 AM2/16/23
to Repo and Gerrit Discussion
Hi Experts,

I have setup gerrit. We have already running Gitlab instance. I have been assigned to integrate gerrit with gitlab.

Main scope is, developer will push the code to gerrit, Senior developer will review the code if fine then he will push it to gitlab. 

I have searched on internet but could not get clear step by step procedure. A video on youtube I also watched that tells integration of Gerrithub to github. But it does not help me.

Please someone advise me step by step procedure

Thank you

Zohaib Shaikh

unread,
Feb 17, 2023, 10:32:44 AM2/17/23
to Repo and Gerrit Discussion, faya...@dcorp.email
Please experts advice on this. We have just deployed gerrit and want to integrate it with gitlab.

Kindly see the details in below email previously sent on this group.

Thanks in advance.


--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/34a7255e-b2fc-4b66-a3d5-422ba180a7b5n%40googlegroups.com.

Zohaib Shaikh

unread,
Feb 22, 2023, 12:51:27 AM2/22/23
to Repo and Gerrit Discussion, faya...@dcorp.email
Hi guys

I have created a repo on gitlab, cloned it to local system, then pushed it to gerrit. Now again cloned it from gerrit to my local system in separate folder.

Now i have made some changes amd push it to gerrit. Then replication does not reflect in gitlab.Procedure i followed:
Procedure i followed

git clone --mirror git@gitdomain:thesecretgroup/test2.git

git push --mirror "ssh://zohaibs@gerritdomain:29418/Test2"

git clone "ssh://zohaibs@gerritdomain:29418/Test2"

cd Test2/

touch readme2.md

git add -A

git status

git commit -m 'test2'

git push origin main

Above works perfect, now replication to gitlab is not working. replication.config


[remote "gitlab"]
        url = git@gitdomain:thesecretgroup/test2.git
        push = +refs/heads/*:refs/heads/*
        push = +refs/tags/*:refs/tags/*
        push = +refs/changes/*:refs/heads/review/*
        replicationDelay = 0
        createMissingRepositories = true

No any replication_logs there


Björn Pedersen

unread,
Feb 22, 2023, 3:57:58 AM2/22/23
to Repo and Gerrit Discussion
Zohaib Shaikh schrieb am Mittwoch, 22. Februar 2023 um 06:51:27 UTC+1:
Hi guys

I have created a repo on gitlab, cloned it to local system, then pushed it to gerrit. Now again cloned it from gerrit to my local system in separate folder.

Now i have made some changes amd push it to gerrit. Then replication does not reflect in gitlab.Procedure i followed:
Procedure i followed

Above works perfect, now replication to gitlab is not working. replication.config

That looks correct up to here. 

[remote "gitlab"]
        url = git@gitdomain:thesecretgroup/test2.git
        push = +refs/heads/*:refs/heads/*
        push = +refs/tags/*:refs/tags/*
        push = +refs/changes/*:refs/heads/review/*
        replicationDelay = 0
        createMissingRepositories = true

No any replication_logs there

Two things come to mind: 
 1 )  did you configure  the appropriate credentials in secure.config so  that force pushes to gitlab are allowed?
 2)  you  need to at least reload the replication plugin (better restart gerrit) as  changes to replication config  are not picked up on the fly
Reply all
Reply to author
Forward
0 new messages