Gerrit 自动添加codereviewers

Gerrit 自动添加codereviewers

从这篇开始,开始记录关于gerrit jenkins 工作中用到的干货知识点。

refs/meta/config介绍

打开想要操作的project,找到refs/meta/config 这个分支,这个分支存的都是关于project的配置相关的内容,比如gerrit上面显示的label,谁有权限进行codereview,或者定义谁可以对某个路径下面的代码进行codereview等
这个branch下面一般会有 三个文件,groups project.config 和reviewers.config

project.config

定义图标和各个label

   [access]
      inheritFrom = app_master  #继承权限
   [access "refs/heads/*"]
      push = group app_branch1 owner
      pushMerge = group app_branch1 owner
      label-AuthCheck = -1..+1 group app_branch1
      label-AuthCheck = group app_branch1
      label-AuthCheck = group app_branch1
      label-Code-Review = -2..+2 group app_branch1
      label-Code-Review = -2..+2 group app_branch1 
      label-Code-Review = -2..+2 group app_branch1
      label-Code-Review = -1..+1 group app_branch1
      label-Verified = -1..+1 group app_branch1
      label-Verified = -1..+1 group app_branch1
      label-Verified = -1..+1 group owner app_branch1
      rebase = group owner app_branch1
      submit = group app_branch1
      submit = group owner app_branch1
      createTag = group  owner app_branch1

reviewers.config

这个文件主要定义的是codereview自动添加人员

[filter "branch:branchname"] 直接指定branch名字,然后定义谁能自动添加
		reviewer = groupname
		reviewer = [email protected]
[filter "branch:branchname file:^/asg/app/cpu/.*"] 或者加上代码路径来精确的进行控制
		reviewer = groupname
		reviewer = [email protected]

你可能感兴趣的:(devops)