Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

PR Walkthrough: Make It Easy to Verify

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

This guide shows you how to structure a code review walkthrough so reviewers can verify your changes quickly and confidently. You’ll learn what to include in the description, how to break down the diff, and how to preempt questions—cutting review time and reducing back-and-forth.

What You'll Need

  • A pull request (PR) that is ready for review—code pushed, tests passing locally.
  • Access to the repository and the PR tool (GitHub, GitLab, Bitbucket, etc.).
  • The ability to edit the PR description and add comments.

Step-by-Step

  1. Start with a clear, concise title. Use the pattern “Area: Brief change summary” (e.g., “Auth: Add refresh token rotation”). This tells reviewers what the PR touches and what it does at a glance.
  2. Write a description that answers “why” and “what”. In the PR body, include:
    • Problem: What bug or missing feature does this fix? Reference the issue or ticket number.
    • Solution: What approach did you take? Mention any design decisions.
    • Testing: What did you run? Unit tests, manual steps, screenshots?
  3. List the key files and what changed in each. Instead of making reviewers dig through the diff, add a short bullet list: “auth/token.go – added rotation logic; auth/token_test.go – added tests for rotation.” This gives a map of the changes.
  4. Provide a step-by-step test plan. Write numbered instructions for a reviewer to reproduce your testing. For example:
    1. Check out the branch.
    2. Run go test ./....
    3. Start the server with docker-compose up.
    4. Log in, then call POST /refresh twice—the first should succeed, the second should fail with a 401.
  5. Add inline comments on tricky parts. In the diff, comment on complex logic or non-obvious decisions. Explain why the code is written that way. This prevents reviewers from having to ask.
  6. Include screenshots or GIFs for UI changes. Show the before and after, or the new state. Visual evidence is the fastest way to verify visual changes.
  7. Keep the diff small and focused. If the PR grows beyond the original scope, split it. Reviewers verify faster when the change is one logical unit.
  8. Run the tests and show the results. Paste the output of the test suite in the PR description, or link to a CI run. This proves the code passes.
  9. Check off any checklist items. Many repos have a PR template (e.g., “I have added tests”, “I have updated the docs”). Fill it in—it shows you’ve thought about completeness.
  10. Review your own PR before requesting review. Read the diff as if you were a stranger. Fix any typos, debug code, or confusing comments. This is the single best way to make verification easy.

Common Mistakes

  • Vague descriptions like “fixes bug” or “updates stuff”. Reviewers can’t verify intent without context.
  • No test plan. Even if tests exist, a reviewer doesn’t know how to run them or what to expect.
  • Huge diffs. A 50-file change is hard to verify. Break it into smaller PRs.
  • Ignoring the PR template. If the repo asks for a checklist, skipping it signals carelessness.
  • Not explaining why. Code that looks “wrong” but is intentional needs a comment. Otherwise reviewers will flag it.
  • Leaving debug code or commented-out lines. These distract and raise questions.

Tips

  • Use a consistent PR format. Create a template for your team so every PR has the same sections.
  • Link to the relevant issue. This gives reviewers the full context without searching.
  • Mention any trade-offs. If you chose a simpler approach over a more complex one, say so—reviewers can then focus on whether the trade-off is acceptable.
  • Add a “How to test” section even for backend changes. A curl command or a script snippet is gold.
  • Use checklists for repetitive tasks. For example, “I updated the API docs” or “I ran the linter”.
  • Keep the description up to date. If you change the approach mid-review, update the description so it stays accurate.

Troubleshooting

Reviewer says “I can’t verify this” – what now? Ask them what they’re missing. Often it’s a missing test step or context. Add the missing information and thank them for pointing it out.

PR is too large and you can’t split it. If you truly can’t split it, provide a “review order” in the description: “Start with file X, then Y, then Z.” This guides the reviewer through the logic.

Tests fail on CI but pass locally. Check for environment differences (e.g., Go version, database). Add a note in the PR: “Tests pass locally with Go 1.21; CI uses 1.20.” This prevents confusion.

You’re not sure what to write in the description. Use the PR template or look at a previously merged PR that was well-received. Mimic its structure.

Reviewer keeps asking the same question. That means your description is missing a piece. Add a FAQ section to the PR body, or make the answer more prominent.

Frequently Asked Questions

How long should a PR description be?

Long enough to explain the why and what, but not a novel. Aim for 5-10 sentences plus a test plan. If it’s longer, consider splitting the PR.

Should I include screenshots for backend changes?

Not usually, but include terminal output or a sample API response. That serves the same purpose.

What if the PR is a one-line typo fix?

Still write a short description: “Fixed typo in error message.” No test plan needed, but mention that no tests were required.

How do I handle a PR that touches multiple concerns?

Ideally, split it. If you can’t, clearly label the sections in the description: “Part 1: refactor, Part 2: feature.” Reviewers can then verify each part separately.

Is it okay to ask a reviewer to run a specific command?

Yes, but make it easy—copy-paste ready. For example: “Run python manage.py test to see the test results.”

What if the reviewer still doesn’t verify after my best effort?

Politely ask if they have time, or offer to walk them through it verbally. Sometimes a quick chat resolves what the written description couldn’t.