Gerrit-Plugin to preserve reviews/scores if pushing from Jenkins

空扰寡人 提交于 2019-12-11 02:29:45

问题


We use Jenkins to verify patch sets. Sometimes Jenkins needs to do some minor technical changes to the patch set. So it commit --amend the last patch set and then uploads it back to the Gerrit.

It works nicely besides the fact, that all manual reviews made to the original patch set are get erased by the Jenkins push.

The question Upload patch set preserving existing reviews showed, that it is possible to copy min/max scores on all pushes using label.LABEL-NAME.copyXXXXX options (Thanks to Marcelo Ávila de Oliveira)

Since it is not exactly, what I'm looking for, I consider writing a Gerrit-Plugin (if somebody wouldn't point me to a simpler solution of course).

My idea is to add a new git push ... % option. This may look like this:

$ git push origin HEAD:refs/for/master%copyAllScores

My questions are:

  • Q1: Is it possible to implement this or similar kind of options writing a Gerrit-Plugin?
  • Q2: If yes, what classs/methods of the Gerrit Plugin API are essential for doing it? Are there some plugins, that my serve as an example?
  • Q3: Do you have a better idea how my original goal can be configured or implemented?

PS The security is not important for me know, although it will become important if this plugin should become public.

来源:https://stackoverflow.com/questions/44482418/gerrit-plugin-to-preserve-reviews-scores-if-pushing-from-jenkins

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