Code reviews are the primary defense against software bugs, architectural rot, and security vulnerabilities. On GitHub, the Pull Request interface provides a comprehensive suite of review tools designed to foster collaborative learning and high engineering standards.
When a teammate asks you to review their Pull Request:
+), deletions are red (-).+ icon to start an inline comment.+-----------------------------------------------------------------------------+ | Line 42: const userToken = jwt.sign(payload, "secret_key_123"); | +-----------------------------------------------------------------------------+ | [Review Comment] | | Hey! Let's avoid hardcoding secrets in source files. Can we use | | `process.env.JWT_SECRET` instead? | | | | [ Add single comment ] [ Start a review ] | +-----------------------------------------------------------------------------+
Reviewers can do more than point out problems—they can provide ready-to-commit solutions! Click the Add a suggestion icon (+-) inside the comment box:
const userToken = jwt.sign(payload, process.env.JWT_SECRET, { expiresIn: '1h' });
The author can click Commit suggestion directly in GitHub, instantly incorporating your suggested code without switching back to their terminal!
Once you have examined the files, click Review changes in the upper right. Choose one of three verdicts:
| Verdict | When to Choose | Effect on PR |
|---|---|---|
| Comment | Submit general feedback or ask clarifying questions without giving approval | Leaves PR open; does not count toward branch protection approval quotas |
| Approve | You verified the code, tests pass, and it is ready to be merged | Marks the PR as approved green checkmark |
| Request changes | Critical bugs, security issues, or architectural flaws must be addressed | Blocks the PR from being merged until the author pushes fixes and requests re-review |
If a reviewer requests changes:
Continue learning with hands-on practice, examples, and exercises in the upcoming topic.
Test your understanding of this lesson with 5 questions. Each question has one correct answer.
Practice in live mentor-led sessions with real projects, mock tests, and verifiable certification at MSK Institute.