Exercise - Reviewing pull requests

In this lab, you will learn how to effectively review pull requests on GitHub. Code review is a critical part of the software development process, and pull requests are GitHub's way of facilitating collaboration and code review. You'll learn best practices for reviewing code, providing constructive feedback, and approving changes.

You will learn how to:

  • Understand the pull request review workflow
  • Review code changes effectively
  • Leave comments and suggestions
  • Request changes from contributors
  • Approve pull requests
  • Use GitHub's review features

This lab takes approximately 30-45 minutes to complete.

Before you start

To complete the lab, you need:

  • A GitHub user account. If you don't have one, you can create a new account. If you need instructions on how to create a GitHub account, refer to the article Creating an account on GitHub.
  • Basic understanding of pull requests and branches.
  • A web browser with access to the internet.

Complete the exercise on GitHub

In this exercise, you'll learn pull request review workflows through a hands-on GitHub Skills exercise.

Note: This exercise is hosted on GitHub Skills and provides an interactive learning experience. You'll practice reviewing pull requests, commenting on code, and using GitHub's review tools.

The exercise consists of the following activities:

  1. Start a web browser and navigate to the exercise repository: https://github.com/skills-dev/review-pull-requests

  2. On the exercise page, select the Use this template button to copy the exercise to your GitHub account.

    Note: Simply copy the exercise to your account, then give GitHub about 20 seconds to prepare the first lesson, then refresh the page.

  3. Follow the instructions on the repository's README to complete all the challenges, which include:

    • Understanding the review process and its importance
    • Reviewing code changes in pull requests
    • Adding line comments to provide specific feedback
    • Creating a review summary with your overall assessment
    • Requesting changes when improvements are needed
    • Approving pull requests when code meets standards
    • Using suggested changes feature to propose specific edits
  4. Work through each step in the exercise, following the prompts and instructions provided in the pull requests.

    Note: The exercise will guide you through different review scenarios to help you understand when to comment, request changes, or approve.

  5. When you finish all the challenges, you'll be comfortable with the pull request review process.

What you've learned

After completing this exercise, you should be able to:

  • Navigate and understand pull request interfaces
  • Review code changes effectively
  • Provide constructive, actionable feedback
  • Use line comments and general comments appropriately
  • Request changes when necessary
  • Approve pull requests that meet standards
  • Use suggested changes to propose specific code edits
  • Understand pull request review best practices
  • Collaborate effectively with team members through reviews

Congratulations! You've completed the "Reviewing pull requests" exercise and learned how to be an effective code reviewer!