如何在Gerrit prolog中获得特定的评审员投票,而不是通过rest api



我有一个gerrit jenkins支持。我无法在gerrit-prolog文档中找到解决方案https://gerrit-review.googlesource.com/Documentation/prolog-cookbook.html

此代码根据以下场景工作

1-当詹金斯用户投-1票时,它将禁用提交按钮

2-当jenkins用户投+1票时,它将启用Submit按钮。

submit_rule(S) :-
    gerrit:default_submit(X),
    X =.. [submit | Ls],
    add_non_author_approval(Ls, R),
    S =.. [submit | R].
score(Category, Score) :-
    gerrit:commit_label(label(Category, Score), user(1000002)).
add_non_author_approval(S1, S2) :-
    gerrit:commit_label(label('Code-Review', 1), user(1000001)),
    A = user(1000002),
    gerrit:commit_label(label('Code-Review', 2), R),
    R = A, !,
    S2 = [label('Non-Author-Code-Review', ok(R)) | S1].
add_non_author_approval(S1, [label('Non-Author-Code-Review', need(_)) | S1]).

最新更新