Summary - Code review
- Git course
- Intermediate
- Lesson 60/82
- 5 min
Combine the review flow to approve and merge a PR.
Combine the review workflow
Reviewing a Pull Request, adding inline comments, and approving changes are connected steps. First, you evaluate the code and leave feedback on the lines where necessary.
Review changes
Add inline comments
Approve Pull Request
Merge Pull RequestOnce the review is complete and the required approvals are obtained, the PR can be merged.
Practice Complete the PR review
Create a pullRequest object. Set comment to "Add input validation", review to "approved", and status to "merged". Finally, print the merge status using console.log.
Starter code
const pullRequest = {
// İnceleme ve birleştirme bilgilerini ekle
};
// Birleştirme durumunu yazdırSample solution
const pullRequest = {
comment: "Add input validation",
review: "approved",
status: "merged"
};
console.log(pullRequest.status);Expected output
merged
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 What is the next action after the review is complete and the required approvals are obtained?
- Clone the repository again
- Merge the PR Correct answer
- Delete all commits
- Create a new GitHub account
Explanation: Once the required reviews and approvals are complete, the Pull Request can be merged.
2 Combine the review result
const pullRequest = {
comment: "Looks good",
review: "approved",
status: "____"
};
const pullRequest = {
comment: "Looks good",
review: "approved",
status: "merge_ready"
};
Explanation: An approved and reviewed PR is ready to be merged.
3 Actions in the review process
| Term | Meaning |
|---|---|
Review |
Inspect code changes |
Comment |
Add line feedback |
Approve |
Accept the changes |
Merge |
Integrate PR changes |