Wednesday afternoon at three, a PR that had been open for three days was sitting in the repo. The diff was over 1,200 lines, and the title said “some optimizations.” The author himself asked in the group chat: should I just close it and open a new one?
That day the four of us spent two hours splitting it into four smaller ones, then another afternoon reviewing, revising, and merging. Only two things actually needed discussion: one concurrent-write location and one null check. The other 800-plus lines were incidental renaming and formatting.
After that, we changed a few things.
We copied the big-company process and broke it in two weeks
There are four of us: two backend, one frontend, plus a half-time product person who also does testing. No dedicated reviewer, no QA gate, and nobody willing to read someone else’s code on a Friday night.
At first we copied a big-company process wholesale: two approvals, CODEOWNERS, all checks must be green, no merge without review. Within two weeks, everyone had learned to “click approve first, read later,” or just go find the most agreeable person. I configured the CODEOWNERS file once and never opened it again—too few people, anyone can change any directory, so writing it was the same as not writing it.
Then we tore that apart and kept only three rules:
- Every PR must be looked at by someone—one person is enough;
- Anything involving database migrations or payments needs two people;
- The PR description must clearly state “how to verify.”
Everything else is a suggestion, not a rule. The fewer the rules, the more people take them seriously.
Process exists to cover where people fall short. But when there are few people, what’s usually missing is “nobody remembered to look,” not “someone merged recklessly.” In a repo with four or five people, there are only three or four PRs a day; forcing a process designed for dozens of people means the entire cost lands on waiting for approvals.
What a machine can judge, don’t give to a human
The two kinds of review comments I least want to see are “missing a space here” and “this function name isn’t good.” The former a machine can do; the latter a machine can’t, and it’s also hard to reach consensus on through review.
Our CI is roughly these few things, running automatically as soon as a PR is pushed:
1 | # .github/workflows/pr.yml 的主要部分 |
prettier and lint lock down formatting, tsc blocks type issues, unit tests block obvious logic errors. If these aren’t green, the PR page never even gets to a human.
We didn’t set a coverage threshold. We used to set 80%, and the result was a pile of assertions like expect(fn).toBeDefined()—that was the real waste. Now we just show the coverage change on the PR page, and if it drops, we ask why.
The benefit of this layer isn’t “saving time.” Before, I could write twenty comments on a PR, eighteen about formatting; now there are only two or three, but each one is worth stopping to talk about.
As for why function names still need a human: naming is about how concepts are divided. When the same thing is called two different names in two modules, a machine can’t tell they’re the same thing—only someone with that part of the business in their head knows. That kind of comment is worth making, but with one precondition: the person commenting has to actually know that area. Among four people, often only one does.
The most common disease of small teams is being ignored
The most common state of a small team isn’t “review is too strict,” it’s “nobody pays attention.”
I’ve done it myself: see the notification in the morning, think I’ll look carefully when things quiet down, and then forget by the end of the day. The author is stuck, not knowing whether to keep revising or wait, afraid to merge, afraid to start the next one.
So we agreed on something very simple: at 11 a.m. and 4 p.m. on workdays, the person on duty scans the pending-review list. Duty rotates weekly.
The duty person’s obligation isn’t to “finish reviewing,” it’s to “give a first response within four hours.” The response can be comments, a direct approve, or just “I’m booked today, I’ll look tomorrow morning”—that counts too, at least the author knows how long to wait.
The only purpose of this rule is to eliminate the state of “sent, no reply.” When people get no feedback, they start guessing, and after guessing long enough they route around the process: push straight to main, or just stop opening PRs.
It has a side effect: the duty person easily becomes a bottleneck, with a week’s worth of PRs piling up on them. So duty only covers the first response, not finishing the review. Once they’ve replied, they hand the PR to the most relevant person—responsibility gets handed off too.
One PR tells one story, and splitting has a cost too
The conclusion from the postmortem on that 1,200-line PR was: it wasn’t one PR, it was six.
The habit now is to ask yourself before starting whether this change can be said in one sentence. If not, split it. Refactors, formatting, typo fixes you notice along the way—open a separate PR, the kind that merges in ten minutes. Small PRs have a hidden benefit too: when something breaks in production, they’re easy to roll back, and a revert won’t drag three unrelated changes down with it.
Roughly: under 300 lines of diff, review quality is still okay; past 500 lines people start going through the motions; past 1,000 lines it’s basically a click of approve. This number has no rigorous basis—it’s the inflection point we’ve felt ourselves. So now when someone says in the group “this PR of mine is a bit big,” everyone’s first reaction is “split it,” not “send it over.”
But splitting PRs isn’t cheap: you have to juggle branches, handle dependency order, and sometimes two PRs have to go out together. So I don’t think it’s unconditionally right. When fixing a production issue, one big PR straight in is completely fine—just add an explanation afterward. Rules are for day-to-day iteration, not for firefighting.
How a comment opens decides whether the other person wants to change anything
The easiest place for review to wound is tone. The same sentence—“this is wrong” versus “what happens if user is null”—the latter doesn’t make people want to argue back.
We agreed internally on a few prefixes, written into the PR template:
block:this must change, can’t merge without it;q:I didn’t understand, can you explain;nit:minor, optional;note:note for future me, no reply needed.
After adding prefixes there was an unexpected benefit: the author can see at a glance which are hard requirements, without having to guess on every one.
Prefixes aren’t magic either. Used long enough they become a template—hang something heavy after nit: and the author still gets nervous. They govern severity levels, not tone.
Another habit I insist on is writing a line after reviewing about “which parts I looked at.” For example, “looked at routing and auth, didn’t go deep on the SQL part.” For yourself it’s a reminder that you really didn’t finish; for the author it’s information about which part nobody has looked at yet. Far more useful than a lone LGTM.
And one more I learned the hard way: don’t put “I think the design should change” in a comment on a single line of code. That’s a different level of problem—put it in the PR’s general comments, or just hold a fifteen-minute meeting. Hanging it on one line, the author only feels you’re nitpicking.
For newcomers, review isn’t an efficiency tool
When onboarding newcomers, the first few PRs get reviewed by the process, and you often end up writing several comments. After the fixes, the same mistakes may still show up next time. Later we adjusted the approach: before the first PR, pair up and read code together for a few dozen minutes, explaining as you go. After a while of this, PR quality often improves noticeably.
The cost is my own time. Two or three times a week, which adds up, but it’s cheaper than repeated rework afterward.
For experienced people, code review is an efficiency tool; for newcomers, it isn’t. What newcomers lack isn’t “having errors pointed out” but “knowing why it’s written this way.” These two things have different solutions—it’s just that in small teams we always want to solve every problem with a single process.
Next week we plan to add a line to the small dashboard at our weekly meeting: “median hours from PR open to first response.” If in any week this number exceeds 12 hours, we’ll cut one item from that week’s iteration. This hasn’t run for a full month yet, so whether it will turn into new formalism, I can’t say.
Comments