如何不通过 rest api 在 Gerrit prolog 中获得特定的审阅者投票?

How to get a particular reviewer vote in Gerrit prolog not via rest api?

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

此代码根据以下场景运行

1- 当 jenkins 用户投 -1 票时,它会禁用提交按钮

2- 当 jenkins 用户投 +1 票时,它会启用提交按钮。

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]).