Loading...
Loading...
Compare original and translation side by side
create-prcreate-prundefinedundefined
Read the commit bodies before the diff. They are usually the richest source of
motivation. Then verify what they claim: a commit message saying "matches the existing
pattern in this file" is an assertion about code, and it is often wrong. Do not forward a
claim you have not checked.
Verify by looking, not by reasoning. The checks worth making are cheap and specific:
- Read what the change deletes. When a change exists to fix something, the defect is
usually visible in the removed code.
- Ask the system what a thing means, rather than inferring it: `gcloud iam roles
describe` for a role's permission set, the provider or API schema for a resource's
fields, the parser for what a marker does.
- Grep a flag across the environment files before claiming it is on or off.
- Open the file a comment or commit message points at, and confirm it says what the
pointer claims.
One check of this kind usually produces the best sentence in the description.
Gather what the diff cannot tell the reviewer:
- The motivation. What breaks, costs, or stays impossible without this change.
- The linked issue, spec, or design doc, and any spec files committed on the branch.
- Decisions with a real alternative, and why the alternative lost.
- The blast radius: what this can break beyond the files it touches.
- The validation you ran, and what it showed.
- Anything you are unsure of.
先阅读提交正文再看diff,提交正文通常是最丰富的动机来源。然后验证提交中的表述:比如提交信息说“匹配文件中的现有模式”,这是对代码的断言,但往往不准确。不要转发未经核实的表述。
通过实际查看而非推理来验证。值得做的检查简单且明确:
- 查看被删除的内容。当修改是为了修复问题时,缺陷通常能在被移除的代码中找到。
- 直接查询系统获取信息,而非自行推断:比如用`gcloud iam roles describe`查看角色的权限集,查看提供商或API schema了解资源字段,查看解析器了解标记的作用。
- 在环境文件中全局搜索某个标志,再断言它的开启或关闭状态。
- 打开注释或提交信息指向的文件,确认内容是否与描述一致。
这类检查通常能产出描述中最有价值的句子。
收集diff无法告知评审者的信息:
- 动机:没有本次修改会导致什么问题、额外成本,或是哪些功能无法实现。
- 关联的issue、规格说明或设计文档,以及分支中提交的任何规格文件。
- 存在真实备选方案的决策,以及为何最终选择了当前方案。
- 影响范围:除了修改的文件外,本次变更还可能破坏哪些内容。
- 你执行的验证操作,以及验证结果。
- 任何你不确定的内容。Why## Review guide## What changed## Validation## 评审指南## 变更内容## 验证情况## Review guide## 评审指南Co-Authored-ByCo-Authored-By