Reviewing a Pull Request on GitHub
Become the reviewer: check the code against the requirements in the Files changed tab, leave polite line comments, request changes and approve the PR after the author’s new commit.
About the product
Hi! Last time your Pull Request went through a review. Today we switch roles: you are the reviewer. Marko from the development team has opened a PR with an order discount, and it needs checking. But first, four simple rules for comments.
Hi, Kadri! What is the first rule?
1. Polite. A comment is about the code, not the author. Write the way you would like to be written to.
✗ BadA bug again. Did you even read the task?
✓ GoodIt looks like a requirement isn’t met here — could you take a look?
And the second?
2. To the point. A comment sits on a specific line and says exactly what is wrong. One problem — one comment.
✗ BadSomething is wrong here.
✓ GoodFor an order of exactly 100 € the discount will be 5 %, not 10 %.
Is that enough?
3. With details. Explain why: which requirement is broken and at which value it fails. The author won’t have to guess.
✗ BadWrong condition.
✓ GoodThe requirement says 10 % “from 100 €”. With total = 100 the condition total > 100 is false.
And the last one?
4. Constructive. Suggest a solution or ask a question. And point out what was done well: a review helps the author, it doesn’t grade them.
✗ BadRedo it.
✓ GoodI suggest total >= 100. Otherwise the logic is clear, thanks!
Got it! And how does the review itself go?
A reviewer reads the changes before they get into main and decides: can they be merged or do they need fixing? The whole path looks like this:
- ReviewerFiles changedReads the changed lines and checks them against the requirements
- ReviewerLine comments“+” next to a line → text → Add single comment
- ReviewerReview changesOverall feedback and one of three decisions → Submit review
What to look at in the code
Does the code do what the task says? Check the boundary values, just like in test design.
The code is easy to read: clear names, nothing extra — no debug output, no commented-out lines.
Let’s check. There is a bug in the code: one requirement isn’t met. Which decision do you choose in Review changes?
Got it! Opening the PR.
Reviewing a Pull Request
Step 1 · Files changed
Here is Marko’s PR. The Conversation tab has the description: what was done and what the task requires. Read the requirements: you will check the code against them.
The requirements are clear. Where is the code?
Open the Files changed tab: it shows which files and lines have changed. Green lines with a + are added.
Hint
The PR tabs are under the title: Conversation · Commits · Files changed.
- Files changed
- Comments
- Request changes
- Fix
- Approve
- Merge
The PR has one new file, src/discount.js: the function takes the order total and returns the discount in percent. There aren’t many lines, but a reviewer reads every one.
Where do I start?
Step 2 · Checking the requirements
With the requirements. Find the condition for each of them in the code. Pay special attention to the boundaries of 50 € and 100 €: what discount does the function return for an order of exactly 100 €?
I think I’ve found it! How do I comment on a line?
Hover over the line with the bug — a blue + appears next to the line number. Click it, choose or write a comment and click Add single comment.
Hint
The requirement: “from 100 € — 10 % discount”. Find the line that checks 100 and try total = 100.
Great! The condition total > 100 doesn’t match exactly 100 €, so the customer gets 5 % instead of 10 %. A good comment points to the line, explains the problem and suggests a solution.
Why did the bug show up exactly at 100?
Are there any more problems?
Step 3 · Clear code
The requirements are done. Now read the code again as if you were seeing it for the first time: is every line needed? Extra lines make code harder to read, and debug output can reveal data nobody should see.
I can see an extra line.
Find the line that isn’t needed to calculate the discount and comment on it the same way: + → text → Add single comment.
Hint
console.log prints values to the console. It is used to check code during development, but such output is not left in finished code.
Yes, the console.log was left over from debugging. The two line comments are ready — now it’s time to sum up the review.
How do I sum it up?
Step 4 · Review changes
Line comments are the details. The Review changes button sets the outcome of the review: there you write overall feedback and choose one of three decisions.
Which decision do I choose?
Click Review changes, check the overall comment, choose the right decision and click Submit review.
Hint
The code breaks a requirement → the PR can’t be merged yet. Comment is neutral feedback, Approve is approval, Request changes asks for fixes.
The review is submitted: the PR now shows Changes requested, and merging is blocked until a reviewer approves the changes. Marko got a notification and can see your comments.
A review helps the author, it doesn’t grade them: be constructive and polite. You can point out what was done well too.
How should Marko make the fixes?
Waiting for the fixes!
Step 5 · Reviewing again
Marko has fixed the code and pushed: there is a new commit in the PR. The review isn’t over yet — make sure everything from your comments has been fixed.
Checking!
Open Files changed and check both lines. If everything is fine — Review changes → Approve → Submit review.
Hint
The condition for 100 € is now total >= 100, and the console.log is gone. No remarks — so the PR gets approved.
The PR is approved, and Marko has merged it into main: the changes are now part of the project. Usually the author merges the PR once it is approved and the checks have passed.
Done!
Great review! Remember the order: Files changed → line comments with + → Review changes: Comment, Approve or Request changes → Submit review. If you request changes, look at the PR again after the author’s new commit.
Quick reference
Files changed
The PR tab that shows which files and lines have changed: green lines with + are added, red lines with − are removed. A review starts here.
What to check
Whether the code meets the task requirements (especially boundary values), clarity and readability: names, no debug output and no extra code.
Line comment
Hover over a line and a blue “+” appears. Click it, write a comment and click Add single comment. You can comment on as many lines as needed.
Review changes
The outcome of the review: an overall comment and a decision. Comment is feedback that neither approves nor blocks, Approve means it can be merged, Request changes means it must be fixed before merging. Sent with Submit review.
Tone of comments
A comment is about the code, not the author. Say what is wrong, explain why and suggest a fix. Being polite and specific saves time for both sides.
After Request changes
The author fixes the code in a separate commit to the same branch and pushes — the PR updates by itself. The reviewer checks the changes again and approves, and then the PR can be merged.