25
Reviewing for Non-Maintainers George Dunlap

XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Embed Size (px)

Citation preview

Page 1: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Reviewing for Non-MaintainersGeorge Dunlap

Page 2: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Maintainers would love to have more help reviewing

Page 3: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

…but many people don't know where to start

Page 4: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Absolutely perfect

Ready to be checked in

Not so ready

Page 5: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Goal: Help move a patch closer to being

ready to be checked in

Page 6: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

But: “First, do no harm”

Page 7: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Not so helpful: Giving feedback the maintainer has

to contradict

Page 8: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Not so helpful: Beat up the new guy

Page 9: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Not so helpful: Looking for things to criticize

Page 10: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Helpful: Helping get the patch checked in

Page 11: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Necessary?

Architecture Interface

Effective Efficient All Cases Correct

Robust / Maintainable Coding Style Patch / Series

Page 12: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Necessary?

Architecture Interface

Effective Efficient All Cases Correct

Robust / Maintainable Coding Style Patch / Series

Page 13: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Necessary to accomplish goals?

• Is it clear what the goals are?

• Do we need to make a change, or can the goals be met with existing functionality?

Page 14: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Necessary?

Architecture Interface

Effective Efficient All Cases Correct

Robust / Maintainable Coding Style Patch / Series

Page 15: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Architecture / Interface

• Is this the best way to solve the problem?

• Is this the right part of the code to modify?

• Is this the right level of abstraction?

• Is the interface general enough? Too general? Forward compatible?

Page 16: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Necessary?

Architecture Interface

Effective Efficient All Cases Correct

Robust / Maintainable Coding Style Patch / Series

Page 17: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Functionality

• Does it do what it’s trying to do?

• Is it doing it in the most efficient way?

• Does it handle all the corner / error cases correctly?

Page 18: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Necessary?

Architecture Interface

Effective Efficient All Cases Correct

Robust / Maintainable Coding Style Patch / Series

Page 19: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Maintainability / robustness• Is the code clear? Appropriately commented?

• Does it duplicate another piece of code?

• Does the code make hidden assumptions?

• Does it introduce sections which need to be kept “in sync” with other sections?

• Are there other “traps” someone modifying this code might fall into?

Page 20: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Style

• Comments carriage returns, “snuggly braces”, &c

• See CODING_STYLE and tools/libxl/CODING_STYLE

• No extraneous whitespace changes

Page 21: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Patch• Informative one-line changelog

• Full changelog

• Motivation described

• All important technical changes mentioned

• Changes since previous revision listed

• Reviewed-by’s and Acked-by’s dropped if appropriate

Page 22: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Patch: Audiences

• Reviewers trying to figure out what the patch does

• Someone scanning for patches important to them

• Archaeologists trying to figure out how the code got this way

Page 23: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Series

• Broken down appropriately?

• No regressions in the middle of the series

Page 24: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Reviewing tips

• Code follows data: Look at the data structures first

• Three ways to look at a patch

• Look at the patch itself (emacs / vim ‘diff mode’)

• Look at the patched file

• Graphical diff (i.e., meld)

Page 25: XPDS16: Patch review for non-maintainers - George Dunlap, Citrix Systems R&D UK Ltd

Necessary?

Architecture Interface

Effective Efficient All Cases Correct

Robust / Maintainable Coding Style Patch / Series