Writing good review comments
The grader rewards the same things a good teammate does.
- Name the problem, not just the line. "This looks off" scores as partial at best. "Anyone can call this;
export_ordershas no@staff_member_required" is a full hit. - Say what breaks and for whom. "On the last day of the range, orders after midnight are dropped" beats "date filter is wrong".
- Make it actionable. Suggest the fix or the direction:
select_related("customer"),hmac.compare_digest, anAbortControllerin the effect cleanup. - One problem per comment. Two issues in one comment can only match one of them.
- Comment where the bug lives. Put it on the line that has to change, not the first line of the file.
- Match severity to impact. See Classifying comments.
- Don't pad. Ten speculative nitpicks earn little and each false alarm costs points.
A checklist that finds most planted issues:
- Auth and permissions on every new entry point.
- Input validation and error paths (what returns a 500?).
- Queries in loops, unbounded lists, missing indexes.
- Concurrency: two requests at once, retries, idempotency.
- Async: missing
await, effects without cleanup, stale closures. - Data leaks: secrets in client bundles, caches keyed without the user.
- Tests for the new behavior.