分行政策:需要至少 1 个指定批准人的批准 [英] Branch Policy: Require atleast 1 Approval from specified approvers

查看:24
本文介绍了分行政策:需要至少 1 个指定批准人的批准的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我们的项目团队有 6 人.1 名 Techlead 和 1 名助理 Techlead.

So we have 6 people in the project team. 1 Techlead and 1 Assistant Techlead.

在我们的分支策略中,我们希望设置只有 Techlead 和助理 Techlead 可以批准拉取请求.我们只需要他们的 1 个批准,以避免另一个人休假时出现瓶颈.

In our branch policy we want to setup that only the Techlead and Assistant Techlead can approve the pull request. We only need 1 approval from them to avoid bottle neck if the other one is on leave.

问题是分支策略设置中只有 2 个选择.

The problem is there are only 2 choices in the branch policy setting.

A.指定所需的审批人数量(此方法无效,因为普通开发人员也可以审批)

A. Specifying the number of required approver (Will not work since normal developers would be able to approve as well)

B.指定要批准的实际人员(此方法无效,因为两者都需要,并且在休假时会导致瓶颈)

B. Specifying the actual person to approve (Will not work since both of them will be required and cause a bottle neck when one is on leave)

有人能指出我们正确的方向吗?

Can someone please point us in the right direction?

推荐答案

您可以提供所需的审阅者,这些审阅者会自动添加到每个 PR 中.这些审阅者也可以是小组.

You can provide required reviewers that are automatically added to each PR. These reviewers can also be groups.

这样做:

  1. 创建一个包含您的技术主管和助理技术主管的群组.
  2. Automatically include code reviewers
  3. 下将该组设为必需的批准者
  1. Create a group that contains your tech lead and assistant tech lead and.
  2. Make that group a required approver under Automatically include code reviewers

你应该得到这样的信息:

You should get something like this:

您的声明普通开发人员也可以批准仅当所需的组包含您的普通开发人员时才正确.

Your statement normal developers would be able to approve as well is only true if the group that is required contains your normal developers.

这样一来,至少 1 个人(在本例中为 Developers)必须批准 PR.如果需要,您还可以提供路径过滤器,以便仅要求对某些更改进行审核,或者为文件或文件夹分配不同的组.

This way at least 1 person from provided group (in this case Developers) must approve a PR. If you want you can also provide a path filter to require only reviews on certain changes or assign a different group for files or folders.

这篇关于分行政策:需要至少 1 个指定批准人的批准的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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