如何获取经过自我审查的Gerrit更改的列表 [英] How to get a list of Gerrit changes that were self-reviewed
问题描述
在我们的Gerrit设置中,更改的作者有可能对其自己的更改进行+2审查(这是Gerrit的默认行为).我们希望保持这种行为,但是我们仍然希望对这些更改进行审核,即使它们已经被合并.
In our Gerrit setup, it is possible that the author of a change gives his or her own change a +2 review (which is the default behavior of Gerrit). We would like to keep this behavior, but we would still like to have a review for these changes, even if they have already been merged.
因此,我正在寻找一种搜索过滤器,该过滤器会生成一个变更列表,这些变更列表的变更作者仅+2,而其他帐户则不+2.
So, I'm looking for a search filter that produces a list of changes that only have a +2 from the change author and not from any other account.
我不在乎这是Gerrit UI的搜索过滤器,还是直接在数据库上运行的查询.只要它能产生更改列表,它就不必花哨,用户友好或精美.
I don't care if this is a search filter for the Gerrit UI, or a query that works directly on the database. It doesn't have to be fancy, user-friendly or beautiful, as long as it produces a list of changes.
推荐答案
您可以做的是运行搜索查询:
What you could do, is running a search query:
label:Code-Review=+2,owner
这将匹配拥有者得分的该标签的评论.
This matches reviews for that label with that score, by the owner.
尝试自定义此查询时有两个备注:
Two remarks when trying to customize this query:
- 将其更改为
label:Code-Review = + 2,uploader
似乎不受支持.因此,这意味着其他人可以推送新的补丁集并自行批准这些更改,而不会引起注意.请参阅我的功能请求: 10425 . - 使用
label:Code-Review = ok,owner
将其更改为更隐式的批准",而不是"+2",隐式地将结果限制为仅打开更改.
- Changing this to
label:Code-Review=+2,uploader
seems not supported. So that means that someone else can push a new patch set and self-approve those changes, going unnoticed. See my feature request: 10425. - Changing this to more implicit 'approval' rather than '+2' with
label:Code-Review=ok,owner
implicitly restricts the results to open changes only.
另请参见:文档:搜索更改-标签以及项目配置-标签配置-设置 ignoreSelfApproval
以防止基于自我批准的提交.
See also: Documentation: Searching Changes - Labels as well as the Project Configuration - Label Configuration - setting ignoreSelfApproval
to prevent submission based on self-approvals.
这篇关于如何获取经过自我审查的Gerrit更改的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!