Ep12. Code ReviewEng Cafe

Ep12. Code Review

56分钟 ·
播放数306
·
评论数10

Pre-show

本期播客涉及名词,链接:

Timeline:

  • 3:00 What is a code review?
    • The steps
    • Benefits: technical, sociological and knowledge sharing
    • Why it’s sometimes hard
  • 18:00 Tools and processes
  • 28:50 Tips and Best practices - as reviewer
  • 49:50 Tips and Best practices - as author


展开Show Notes
陈十二
陈十二
2023.1.29
赞同每个pr尽可能小,但主播是否遇到过一个大需求拆成多个pr呢,每个pr一个分支的话感觉git操作成本有点高
_xg
:
可能得看具体有多“大”。非常大的prototype或者repo merge或者refactoring,直接一个巨大的pr merge也许更合适。如果是正常几千行代码的pr,有很多工具可以帮助管理stack pr / stack commit。
_xg
:
e.g. https://engineering.fb.com/2022/11/15/open-source/sapling-source-control-scalable/
6条回复
很有帮助!谢谢分享🙏☺️
_xg
:
谢谢收听🙌🏼
Code review best principles:
Reviewers:
• Keep a Style guide: existed style guide (gg: possibly not updated with the new language features)
• Give code pointers / examples (suggested)
• Can we xxx not you should xxx
• This is great / learnt the trick!
• 尽早开始code review: keep the momentum / or remove myself / batch review (morning / before eod)
• 先达到60分
• 陷入僵局:design? Code itself? (Offline expressive/remove myself/escalate/doc/meeting)
Authors:
• Small change / peer review of the big changes / offline walkthrough
• Draft PR, self-review, comments, manually run -> ready to review
• Refactoring, feature, clean up, 3个PR or 2个
• Specify change files size
• Keep the reviewers “Minimum”
• Other team’s code: get Lgtm from our team first, then it’s easier to get approval from code owner team