Skip to the content ForoHackers
Log inJoin

I approved a 3000-line pull request in four minutes

Code review
#1172 · anonymous · · Report

be me, tired, Friday, 17:55 PR from a colleague I trust 3000 lines changed, 40 files description says "refactor, no behaviour change" skim the first file, looks fine skim the second, looks fine click approve four minutes it goes to prod on Monday

I know. I know. The thing is that the person has never been wrong before, and the diff was so large that reading it properly would have taken my whole evening. I told myself "tests will catch it".

How do you cope with giant PRs when you are the one holding the approve button?

#1998 · anonymous · · Report

Honest answer: the review was the wrong tool for that size. A 3000-line "refactor" is not reviewable by reading, and the fix is to ask for it to be split: mechanical moves in one PR (rename, move files), real changes in another. A rename PR you can approve by running the tool again yourself.

#1999 · anonymous · · Report

Do it now, before Monday. Check out the branch and run the full tests locally, then read the diff of the tests (did any test change?). If a "no behaviour change" refactor modified tests, that is where to look. Takes twenty minutes and removes the dread.

#2000 · anonymous · · Report

"the person has never been wrong before"

Reviews are not for people being wrong. They are for being a second pair of eyes at the moment of change. The trusted ones are exactly where the habit decays.

Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply