Video in progress

Senior 🌿 Git

PRs in your team sit for 3-4 days waiting for review. How do you speed up the code review process without lowering quality?

The main lever is PR size: a PR of around 200-400 lines gets reviewed fast and well. On top of that I make review part of the daily rhythm, hand the mechanical checks (format, lint, tests) to CI, and name the reviewers explicitly.

📖 Answer

The wait usually comes from two causes: the PR is big (nobody wants to start) and it is unclear who should look at it.

What I do:

  • Small PRs. Split a big feature into stages: first the refactoring, then the new interface, then the implementation. People write "LGTM" on a 1500-line PR, and it is not really reviewed;
  • Automate the mechanical work. Formatting, import order, static analysis, test coverage all go in CI. The person looks only at design, logic, naming and errors;
  • A clear owner. Automatic assignment through CODEOWNERS or a rotation. "Someone will look" means nobody will;
  • An agreed SLA. For example, a first response within 4 working hours. Two blocks of review time a day;
  • The PR description. Why, how it was tested, what to pay attention to. It saves the reviewer a lot of time.

Culture is needed in the comments too: separate small suggestions with "nit:", and tell blocking and non-blocking comments apart. The author should not wait another day for every small thing.

To measure it, I track "time from PR opened to first review" and "time to merge". It is easier to have a conversation based on numbers than on impressions.