Skip to main content

How to Write Code Review Comments That Don't Bury the Bug

Blocking vs non-blocking labels help. The verdict line at the top is what actually stops a found bug from shipping.

Updated 9 min readMarkdown
How to Write Code Review Comments That Don't Bury the Bug

GitHub once published a number that should bother anyone who does code review: when it launched the option to require conversation resolution in 2021, it said half of all pull request review conversations were left unresolved before merging.

Some of those were nits nobody cared about. Some weren't. And nothing on the pull request told you which was which.

This post is about that gap: a reviewer finds a real bug, writes it down, and it still ships. Not because anyone was careless, but because a list of comments isn't a decision.

TL;DR: put the verdict on line one

Start every review with a Merge Line: the verdict, the blockers by number, and what's optional.

Merge as is. Three optional thoughts below.

Merge after 1 fix: #9. A retry after a successful charge bills
the customer twice. Needs an idempotency key. Rest optional.

Needs another round: the retry design needs a conversation before
line-level review. I stopped commenting on details after file 2.

Everything else in this post explains why that line matters and how to keep it honest.

The same fourteen review comments shown two ways: in file order with the retry bug at number nine, and with a Merge Line on top naming one blocking fix and batching thirteen optional items.

The failure, step by step

Take a pull request that adds retries to a payment call. The reviewer leaves 14 comments. Thirteen are about naming, a log typo, import order, a docstring. Comment 9 asks: "What if the retry runs after the charge already went through?"

The author works top to bottom, fixes thirteen, replies to #9 with "the provider should handle that," and clicks Resolve. All threads are resolved, so the reviewer approves. Later, a slow provider response triggers a retry and some customers get charged twice.

Look at what each step actually checked:

Step What it checked What it didn't check
Reviewer comment #9 That a risk exists That it blocks the merge
Author reply That the question got an answer That the answer was verified
Resolve click That the thread is closed That the problem is fixed
Approval That the reviewer is satisfied Which comments the approval depended on

Every row passed. The bug got through the gaps between them.

Why the important comment loses

It's outnumbered by design

Research on what reviews find is consistent: roughly 75% of issues found in code review are about evolvability (readability, structure, naming), not functional behavior. Mäntylä and Lassenius found this in industrial and student reviews; Beller et al. found the same 75:25 ratio in open-source projects. Those comments are valuable. They also mean the one functional bug is usually outnumbered three to one.

Comments carry the problem, not the stakes

An author needs three things from each comment: what you saw, how much it matters, and what you need. The text carries only the first. Severity gets inferred from tone, length and position, none of which measure risk. Google's public review guide notes that without severity labels, authors may treat all comments as mandatory. The reverse also happens: the serious one gets the same quick "done" as the typo.

File order steers attention

GitHub and Gerrit list changed files alphabetically. Fregnan et al. (ESEC/FSE 2022) analyzed 219,476 pull requests and found that files shown earlier got more comments. In their experiment with 106 developers, participants had 64% lower odds of finding one seeded bug when its file was last rather than first (a second seeded bug wasn't affected). Your most important comment lands wherever its filename sorts.

"Request changes" and "Resolve" are weaker than they look

On GitHub, "Request changes" doesn't block merging unless a ruleset or branch protection rule requires it. The PR author can resolve conversations, as can anyone with write access. Requiring conversation resolution guarantees threads are closed, not that problems are fixed.

Labels are necessary, not sufficient

Use labels. Google's guide suggests Nit:, Optional: and FYI:. Conventional Comments adds structure such as issue (blocking): and suggestion (non-blocking):.

But labels work per comment. The question the author actually has is per review: can this ship, and what exactly is in the way? Labels make the author compute that answer by scanning everything. The Merge Line hands it over.

The five rules that keep the Merge Line honest

Five numbered rules for the Merge Line: lead with the verdict, every blocker names its failure, questions declare their stakes, whoever opens a blocker closes it, nits travel together.

  1. Lead with the verdict. Merge as is, merge after N fixes, or needs another round.
  2. Every blocker names its failure. "If X happens, a user gets Y." No failure sentence, no blocker. Changes that are hard to reverse earn blockers more easily; see one-way door decisions in code review.
  3. Questions declare their stakes. Question (blocking): or Curious, no change needed:. A bare question reads as a hidden demand, or gets answered and forgotten.
  4. Whoever opens a blocker closes it. The author fixes and links evidence. The reviewer verifies and resolves. Optional threads the author can resolve freely.
  5. Nits travel together. One comment, clearly optional. A nit you leave every week belongs in a linter or formatter config.

A blocker written to these rules looks like this:

issue (blocking): #9 retry after success
If the provider times out after charging, this loop retries and
charges again. Customer is billed twice.
Fix: send an idempotency key per payment attempt.
Evidence I'll check: a test that simulates timeout-after-success.

The author's side: triage before you type

Authors can fix half of this alone.

  • Read the whole review first. Sort comments into: blocks merge / fix before merge / later (ticket, linked) / won't do (reason given). Start with pile one, even if it's comment 9.
  • If there's no verdict, propose one: "Reading this as: #9 blocks, rest optional. Correct?" It turns a guess into a one-word reply.
  • Close blockers with evidence, not "done."
#9: Added idempotency key per attempt (payment_attempt_id).
New test test_charge_retry_after_timeout fails on main,
passes here. Leaving this thread for you to resolve.

Before resolving any thread yourself, ask: would the reviewer agree it's fixed from my reply alone?

Team rollout and what to measure

Try it for two weeks. Track:

  • Rounds to merge per PR (each round is queue time someone pays)
  • Blockers found per review
  • PRs merged with a blocker thread still open (should hit zero)

Don't track comment counts. Microsoft research (Bosu et al., 2015) found about a third of review comments were judged not useful; volume isn't diligence.

Watch for the known failure modes: blocker inflation (rule 2 is the brake), softening real blockers into "maybe consider," second-round creep (round two comments are blockers or tickets), and verdict anchoring (each reviewer writes their own line before reading the others').

The First-Line Test: a typical first line fails three questions (can this merge, what must change, what can I skip) while a Merge Line answers all three.

Key Takeaways

  • Most review findings (about 75%) are maintainability issues, so the functional bug is usually outnumbered.
  • A comment carries the problem but not the stakes; authors guess severity from weak signals.
  • Labels help per comment, but the author needs a per-review verdict.
  • File position, polite questions, and the Resolve button all let a found bug slip through.
  • The Merge Line puts the verdict and the blockers on line one; five rules keep it honest.
  • Authors can triage, propose a verdict, and close blockers with evidence even on teams that don't adopt any of this.

FAQ

What is a blocking comment in code review?

A blocking comment is one the reviewer requires to be resolved before the change merges, usually because it describes a functional bug, a security issue, or a change that's hard to undo. A good blocking comment states the failure: "if X happens, the user gets Y."

What does "nit" mean in code review?

"Nit" (from nitpick) marks a minor, non-blocking suggestion such as naming or formatting. Google's code review guide recommends prefixing these with Nit: so authors know the comment isn't mandatory.

Should every code review comment be labeled?

Labels help, but the bigger win is a one-line verdict at the top of the review: merge as is, merge after N named fixes, or needs another round. Labels describe each comment; the verdict tells the author whether the change can ship.

Who should resolve a code review conversation?

For blocking comments, the reviewer who opened the thread should resolve it after checking the author's evidence. For optional comments, the author can resolve freely. On GitHub the PR author can resolve any conversation, so this is a team convention, not a tool guarantee.

How many comments should a code review have?

There's no right number. One well-argued blocker can matter more than thirty nits. If the design is wrong, stop after the verdict ("needs another round") rather than leaving dozens of line comments on code that will be rewritten.

What are Conventional Comments?

Conventional Comments is a format for review comments that adds a label (such as issue, suggestion, nitpick, question, praise) and optional decorations such as (blocking) or (non-blocking). It makes intent explicit per comment and pairs well with a verdict-first Merge Line.

The bottom line

The hard part of review is finding the problem. The easy part is saying "this one blocks." Most reviews do the hard part and skip the easy one.

A review isn't a list of what you noticed. It's a decision about whether this can ship, plus the reasons. Write the decision first.

Get one of these in your inbox each week: Simply Explained newsletter

Adam Jaber is a software engineer who writes Simply Explained: complex topics, made simple. No jargon, no hype.

About the author

  • I'm a senior software engineer. I write Simply Explained, a plain-English breakdown of how AI and software actually work, and the quiet ways they break: AI fixes that hide bugs, agents that pick the wrong tool, health checks that take down healthy servers. One symptom, one analogy, one fix per piece. New here? Start with the pinned Start Here guide, or get one breakdown a week by email.

"A list of comments isn't a decision" is the whole post in one line. Coming from construction estimating, a punch list works the same way. Forty items about paint touch-up and one about a missing fire stop, and if they all sit in one column the fire stop gets signed off with the rest. The verdict on line one is the inspector writing pass or fail at the top before the notes. Stopping line-level comments after file 2 when the design needs a conversation is the honest move too.

More from this blog