Saltar al contenido ForoHackers

I approved a 3000-line pull request in four minutes

Revisión de código
#1172 · anónimo · · Denunciar

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 · anónimo · · Denunciar

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 · anónimo · · Denunciar

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 · anónimo · · Denunciar

"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.

Firmar como fuente habitual (una clave guardada solo en este navegador)

Enviar tarda unos segundos aquí: tu navegador resuelve antes una prueba de trabajo contra el spam.

Responder