问题
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