从 gerrit 评论中排除作者 [英] Exclude author from gerrit review

查看:6
本文介绍了从 gerrit 评论中排除作者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想禁止更改的作者在 .我知道 这个建议的黑客攻击,但这并没有并不能真正解决问题.

I want to disallow the author of a change to review his/her own changes in gerrit. I'm aware of this suggested hack, but that doesn't really solve the issue.

现在我从 gerrit 问题中了解到 gerrit 的硬编码规则可以通过自定义序言代码,因此应该可以根据需要修改工作流程.但是,我之前从未修改过 gerrit 的工作流程,我也不太了解 .

Now I learned from the gerrit issues that gerrit's hardcoded rules can be modified by custom prolog code, so it should potentially be possible to modify the workflow as I want. However, I have never modified gerrit's workflow before and I don't know much prolog.

有没有人有一个使用这个 prolog 引擎的 gerrit 自定义规则的小型工作示例?

Does anyone have a small working example of custom rules for gerrit using this prolog engine?

我很乐意接受其他替代方法来禁止作者进行自我审查,因为它们不需要我的团队更改当前的工作流程.

I will happily accept other alternatives of how to forbid authors doing a self-review, given they do not require my team to change the current workflow.

推荐答案

我在这个 google 群组中找到了一个非常简单的答案:groups.google.com/disable-self-review

I found a very easy answer in this google group: groups.google.com/disable-self-review

在父项目中(默认为 All-Projects 项目)将其添加到 refs/meta/config 分支的 project.config 文件中:

In a parent project (default is the All-Projects project) add this to the project.config file in refs/meta/config branch:

[access "refs/*"]
label-Code-Review = block -2..+2 group Change Owner

并在同一分支的组文件中添加此行

and in the groups file in the same branch add this line

global:Change-Owner Change Owner

然后把允许权限的语句放到子项目的project.config中:

Then take the statement that allows the right into the child project's project.config:

label-Code-Review = -2..+2 group Developers

请务必在父项目中编写块语句,并在子项目中赋予权限.如果允许和阻止在同一个文件中,则允许将否决(参见 这个).这将阻止更改的所有者给予 -2 或 +2.它将保持 -1 和 +1 选项不变.您可以为可能使用的任何其他自定义标签添加类似的声明.

Make sure to do write the block statement in the parent project and give the rights in the child project. If allow and block are in the same file the allow will overrule (See this). This will block the owner of a change to give -2 or +2. It will leave the -1 and +1 options intact. You can add a similar statement for any other custom labels you might use.

这篇关于从 gerrit 评论中排除作者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆