requesting-code-reviews

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Requesting Code Reviews

代码评审请求指南

Quick Start

快速开始

  1. Self-Review - Review your own diff first, catch obvious issues
  2. Prepare Code - Tests pass, no debug code, documentation updated
  3. Write Description - Clear summary, changes list, testing info, screenshots
  4. Select Reviewers - Match expertise to changes, respect workload
  5. Time Appropriately - Early week, morning hours, avoid Fridays
  1. 自我评审 - 先自行检查你的diff,发现明显问题
  2. 代码准备 - 测试通过,无调试代码,文档已更新
  3. 撰写描述 - 清晰的摘要、变更列表、测试信息、截图
  4. 选择评审者 - 根据变更匹配专业能力,尊重工作负载
  5. 合理安排时间 - 周初、上午时段,避开周五

Features

功能特性

FeatureDescriptionGuide
Self-ReviewCatch issues before requestingCheck debug code, TODOs, test coverage
PR DescriptionGuide reviewers effectivelySummary, changes, testing, attention areas
Reviewer SelectionMatch expertise to needsCode owner, domain expert, security reviewer
PR SizingOptimal size for review quality<400 lines ideal, split larger PRs
TimingWhen to request reviewsMorning, early week, check availability
Reviewer GuidanceHelp reviewers focusKey areas, skip suggestions, questions
特性描述指南
自我评审在请求评审前发现问题检查调试代码、TODO项、测试覆盖率
PR描述有效引导评审者摘要、变更内容、测试信息、重点关注区域
评审者选择根据需求匹配专业能力代码所有者、领域专家、安全评审人员
PR规模保证评审质量的最优规模理想规模<400行,拆分大型PR
时间安排何时发起评审请求上午、周初,确认评审者可用时间
评审者引导帮助评审者聚焦重点关键区域、可跳过建议、疑问点

Common Patterns

常见模板

undefined
undefined

PR Description Template

PR描述模板

Summary

摘要

[What changed and why - 2-3 sentences] Resolves #123
[变更内容及原因 - 2-3句话] Resolves #123

Changes

变更列表

  • [Bullet point each significant change]
  • [列出每项重要变更]

Testing

测试情况

Automated Tests

自动化测试

  • Unit tests added/updated
  • Integration tests pass
  • 新增/更新单元测试
  • 集成测试通过

Manual Testing

手动测试

  1. [Step to verify]
  2. [Expected result]
  1. [验证步骤]
  2. [预期结果]

Screenshots

截图

[For UI changes]
[适用于UI变更]

Areas Needing Review

需要重点评审的区域

  • Security: [specific file/concern]
  • Performance: [specific concern]
  • 安全:[具体文件/关注点]
  • 性能:[具体关注点]

Checklist

检查清单

  • Self-review completed
  • Tests pass locally
  • Documentation updated
undefined
  • 已完成自我评审
  • 本地测试通过
  • 文档已更新
undefined

PR Size Guide

PR规模指南

SizeLinesReview TimeRecommendation
Small<10015-30 minIdeal for quality review
Medium<40030-60 minAcceptable
Large<8001-2 hoursConsider splitting
Too Large800+2+ hoursSplit required
规模代码行数评审时长建议
小型<10015-30分钟评审质量最优
中型<40030-60分钟可接受
大型<8001-2小时考虑拆分
过大800+2小时以上必须拆分

Reviewer Selection

评审者选择

  1. Code owner - maintains affected area
  2. Domain expert - knows the technology
  3. Security - for auth/crypto changes
  4. Architecture - for design changes
Max reviewers: 4 (too many = diffused responsibility)
undefined
  1. 代码所有者 - 负责受影响区域的维护
  2. 领域专家 - 熟悉相关技术
  3. 安全人员 - 处理认证/加密相关变更
  4. 架构师 - 处理设计变更
最多评审者数量:4人(人数过多会分散责任)
undefined

Self-Review Checklist

自我评审检查清单

[ ] No console.log/debug statements [ ] No commented-out code [ ] No hardcoded values (should be config) [ ] Error handling appropriate [ ] All tests pass [ ] New code has tests [ ] Complex logic has comments [ ] Commit messages clear [ ] Rebased on latest main
undefined
[ ] 无console.log/调试语句 [ ] 无注释掉的代码 [ ] 无硬编码值(应配置化) [ ] 错误处理恰当 [ ] 所有测试通过 [ ] 新增代码配有测试 [ ] 复杂逻辑有注释 [ ] 提交信息清晰 [ ] 已基于最新main分支变基
undefined

Best Practices

最佳实践

DoAvoid
Self-review firstSubmitting PRs without testing
Keep PRs small (<400 lines)Creating massive PRs
Write clear descriptionsLeaving descriptions empty
Highlight key review areasExpecting reviewers to find everything
Choose reviewers wiselyOverloading single reviewers
Be responsive to feedbackIgnoring reviewer availability
Include screenshots for UIRushing reviewers
Test thoroughly firstWasting reviewer time on broken code
建议做法避免事项
先进行自我评审未测试就提交PR
保持PR规模较小(<400行)创建超大PR
撰写清晰的描述留空描述
突出重点评审区域期望评审者发现所有问题
明智选择评审者让单个评审者负担过重
及时回应反馈忽略评审者的可用时间
UI变更附上截图催促评审者
先充分测试让评审者在有问题的代码上浪费时间

Related Skills

相关技能

  • receiving-code-reviews
    - Handle feedback professionally
  • finishing-development-branches
    - Complete PR preparation
  • verifying-before-completion
    - Pre-submission verification
  • writing-plans
    - Plan review-ready deliverables
  • receiving-code-reviews
    - 专业处理反馈意见
  • finishing-development-branches
    - 完成PR准备工作
  • verifying-before-completion
    - 提交前验证
  • writing-plans
    - 规划可评审的交付物