Skip to main content

此版本的 GitHub Enterprise 已停止服务 2022-10-12. 即使针对重大安全问题,也不会发布补丁。 为了获得更好的性能、更高的安全性和新功能,请升级到最新版本的 GitHub Enterprise。 如需升级帮助,请联系 GitHub Enterprise 支持

Managing code review settings for your team

You can decrease noise for your team by limiting notifications when your team is requested to review a pull request.

Who can use this feature

Team maintainers and organization owners can configure code review settings.

GitHub Team、GitHub Enterprise Server 2.20+、 和 GitHub Enterprise Cloud 上组织拥有的所有公共存储库,以及组织拥有的所有专用存储库中提供代� �评审设置。 有关详细信息,请参阅“GitHub 的产品”。

About code review settings

When you enable auto assignment, any time your team has been requested to review a pull request, the team is removed as a reviewer and a specified subset of team members are assigned in the team's place. Code review assignments allow you to decide whether the whole team or just a subset of team members are notified when a team is requested for review.

When code owners are automatically requested for review, the team is still removed and replaced with individuals unless a branch protection rule is configured to require review from code owners. If such a branch protection rule is in place, the team request cannot be removed and so the individual request will appear in addition.

Routing algorithms

Code review assignments automatically choose and assign reviewers based on one of two possible algorithms.

The round robin algorithm chooses reviewers based on who's received the least recent review request, focusing on alternating between all members of the team regardless of the number of outstanding reviews they currently have.

The load balance algorithm chooses reviewers based on each member's total number of recent review requests and considers the number of outstanding reviews for each member. The load balance algorithm tries to ensure that each team member reviews an equal number of pull requests in any 30 day period.

Any team members that have set their status to "Busy" will not be selected for review. If all team members are busy, the pull request will remain assigned to the team itself. For more information about user statuses, see "Setting a status."

Configuring auto assignment

  1. 在 GitHub Enterprise Server 的右上角,单击� 的个人资料照片,然后单击“� 的组织”。 贵组织在配置文件菜单中

  2. 单击您的组织名称。 组织列表中的组织名称

  3. 在组织名称下,单击 “团队”。 “团队”选项卡

  4. 在 Teams(团队)选项卡上,单击团队名称。 组织的团队列表

  5. 在团队页面顶部,单击 “设置”。 团队设置选项卡

  6. In the left sidebar, click Code review Code review button

  7. Select Enable auto assignment. Auto-assignment button

  8. Under "How many team members should be assigned to review?", use the drop-down menu and choose a number of reviewers to be assigned to each pull request. Number of reviewers dropdown

  9. Under "Routing algorithm", use the drop-down menu and choose which algorithm you'd like to use. For more information, see "Routing algorithms." Routing algorithm dropdown

  10. Optionally, to always skip certain members of the team, select Never assign certain team members. Then, select one or more team members you'd like to always skip. Never assign certain team members checkbox and dropdown

  11. Optionally, to only notify the team members chosen by code review assignment for each pull review request, under "Notifications" select If assigning team members, don't notify the entire team.

  12. Click Save changes.

Disabling auto assignment

  1. 在 GitHub Enterprise Server 的右上角,单击� 的个人资料照片,然后单击“� 的组织”。 贵组织在配置文件菜单中
  2. 单击您的组织名称。 组织列表中的组织名称
  3. 在组织名称下,单击 “团队”。 “团队”选项卡
  4. 在 Teams(团队)选项卡上,单击团队名称。 组织的团队列表
  5. 在团队页面顶部,单击 “设置”。 团队设置选项卡
  6. Select Enable auto assignment to remove the checkmark. Code review assignment button
  7. Click Save changes.