我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们

关于拉取请求审查

审查允许协作者评论拉取请求中提议的更改、审批更改或在拉取请求合并之前请求进一步更改。 仓库管理员可要求所有拉取请求在合并之前获得批准。

本文内容:

关于拉取请求审查

在拉取请求打开后,具有读取权限的任何人都可以审查和评论其提议的更改。 您也可以对某行提出具体的更改,作者可直接从拉取请求应用更改。 更多信息请参阅“审查拉取请求中提议的更改”。

仓库所有者和协作者可向具体的个人申请拉取请求审查。 组织成员也可向具有仓库读取权限的团队申请拉取请求审查。 For more information, see "Requesting a pull request review."

审查允许讨论提议的更改,帮助确保更改符合仓库的参与指南及其他质量标准。 您可以在 CODEOWNERS 文件中定义哪些个人或团队拥有代码的特定类型或区域。 当拉取请求修改定义了所有者的代码时,该个人或团队将自动被申请为审查者。 更多信息请参阅“关于代码所有者”。

包含行注释的拉取请求更改的标头

审查有三种可能的状态:

  • 评论:提交一般反馈,但不明确批准更改或申请其他更改。
  • 批准:提交反馈并批准合并拉取请求中提议的更改。
  • 申请更改:提交在拉取请求合并之前必须解决的反馈。

审查状态图像

提示

  • If required reviews are enabled and a collaborator with write, admin, or owner access to the repository submits a review requesting changes, the pull request cannot be merged until the same collaborator submits another review approving the changes in the pull request.
  • Repository owners and administrators can merge a pull request even if it hasn't received an approving review, or if a reviewer who requested changes has left the organization or is unavailable.
  • If both required reviews and stale review dismissal are enabled and a code-modifying commit is pushed to the branch of an approved pull request, the approval is dismissed. The pull request must be reviewed and approved again before it can be merged.
  • When several open pull requests each have a head branch pointing to the same commit, you won’t be able to merge them if one or both have a pending or rejected review.

您可以在“对话”时间表中查看拉取请求收到的所有审查,也可在拉取请求的合并框中按仓库所有者和协作者查看审查。

合并框中的审查图像

Tip: You can find a pull request where you or a team you're a member of is requested for review with the search qualifier review-requested:[USERNAME] or team-review-requested:[TEAMNAME]. For more information, see "Searching issues and pull requests."

解决对话

如果您打开了拉取请求或者您对被打开拉取请求的仓库具有写入权限,您可以解决拉取请求中的对话。

要指示 Files changed(文件已更改)选项卡上的对话已完成,请单击 Resolve conversation(解决对话)

带解决对话按钮的拉取请求对话

整个对话将被折叠并标记为已解决,以便您更容易找到仍需解决的对话。

已解决对话

如果评论中的建议超出您的拉取请求范围,您可以打开一个新的议题,追踪反馈并链接到原始评论。 更多信息请参阅“合并拉取请求中的反馈”。

必要的审查

Repository administrators can require that all pull requests receive a specific number of approving reviews from people with write or admin permissions in the repository or from a designated code owner before they're merged into a protected branch. 更多信息请参阅“关于受保护分支”。

When required reviews are enabled, anyone with access to the repository can approve changes in a pull request. However, you won't be able to merge your pull request until the required number of reviewers with write or admin permissions in the repository approve your pull request's changes in their review. For more information about repository permission levels, see "Repository permission levels for an organization." If review is required from a designated code owner and the pull request affects code that has a designated owner, approval from that owner is required.

更多信息请参阅“关于拉取请求的必需审查”。

Tip: If necessary, people with admin or write access to a repository can dismiss a pull request review. 更多信息请参阅“忽略拉取请求审查”。

延伸阅读

问问别人

找不到要找的内容?

联系我们