Is two way sync between gerrit and github.com possible?

我的未来我决定 提交于 2019-12-06 08:04:52

This is a hard problem. Multi-master setups like what you describe exist in many places, but rely on the involved systems to be heavily integrated and built to support this.

I see two options:

  • Both Gerrit and Github would have to be capable of talking to each other and allow the git on server A to be locked while server B updates its ref. Once B has been updated, the data is replicated to A, and A is unlocked. This feature does not exist and probably never will.
  • The server receiving a push could be optimistic and hope that a concurrent update won't happen. For a moderately busy server this won't happen most of the time, but if it does happen there must be a sane recovery strategy. Recovery becomes much more difficult if not impossible if the concurrency check is done asynchronously, i.e. if e.g. Gerrit signals "okay" on the push before actually securing the transaction with Github first. Synchronous updates would solve this but would be detrimental to performance and reliability.
StephenKing

It might not be the direct answer to your question, but if you would make Gerrit your source of truth and you only care about pull requests, you can use the github plugin to import the PR into a Gerrit change.

This wouldn't help, of course, if anybody pushes commits directly to Github.

In general, I agree with Magnus Bäck.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!