Sync between Github and Gerrit without the need for manual repo pulling in gerrit

142 views
Skip to first unread message

Maitri Porwal

unread,
Dec 26, 2023, 8:17:42 AM12/26/23
to Repo and Gerrit Discussion

I want to implement synchronization between Github and Gerrit such that whenever I create or push any changes in my Github repo- it should also be visible to the Gerrit without the need for manual repo pulling. Because for the first time, I have to pull/clone git repo in my Gerrit server (which is running on EC2) then I make changes in that, push the code and only then I can see those changes in the Gerrit UI.

So is there any way to enable this synchronization?

Luca Milanesio

unread,
Dec 27, 2023, 5:15:00 PM12/27/23
to Repo and Gerrit Discussion, Luca Milanesio, Maitri Porwal
Hi Maitri,
Could you help me understand your use-case?

On 26 Dec 2023, at 13:13, Maitri Porwal <mai...@york.ie> wrote:

I want to implement synchronization between Github and Gerrit such that whenever I create or push any changes in my Github repo- it should also be visible to the Gerrit without the need for manual repo pulling.

How can you create a change in your GitHub repository?
GitHub won’t have the listener to ‘refs/for/<branch>’ and therefore won’t be able to allocate a change number and create the ‘refs/changes/NN/NNNNN/*’ refs.

Because for the first time, I have to pull/clone git repo in my Gerrit server (which is running on EC2) then I make changes in that, push the code and only then I can see those changes in the Gerrit UI.

Yes, and that’s the only way it may work.

Q1: Why anyone would push to GitHub a Gerrit change? You would rather create a PR on GitHub isn’t it?
Q2: Why can’t you push to Gerrit directly? If you have installed a Gerrit server on EC2, why pushing to GitHub after all?

So is there any way to enable this synchronization?

Everything is possible, of course, assuming that you understand what you would like to achieve and you are willing to extend the GitHub plugin to make it possible :-)

Luca.
Reply all
Reply to author
Forward
0 new messages