🚧 Under construction — VoTechWorks is being built. A free tech program — complimentary, as our commitment to get America working.
voTechWorksGrade 13 · a vocational technology learning center, by urbanicity
newSchoolWorks.com › VoTechWorks › Technology & Design › Web & Software Development › Git Version Control for Web & Software Development › Lesson 8
TEC-WEB46-05 · Lesson 8 · 16 clock hours · practice

Pull Requests and Code Review Workflow

Objective. Students open a pull request on GitHub, write a descriptive PR description, respond to review comments, request and conduct a peer code review, and merge the PR using the GitHub interface.

⚠ Pending professional review

This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.

VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.

What Is a Pull Request?

A pull request (PR) is a formal request to merge code from one branch into another. On GitHub, a PR creates a dedicated conversation thread where team members can read your changes, leave comments, and approve or reject the merge. Pull requests are the standard collaboration tool in professional web and software development teams. They protect the main branch from untested or broken code and create a written record of every change.

Why Code Review Matters

Code review catches bugs that automated tests miss, enforces team style standards, and spreads knowledge across the team so that no single developer becomes the only person who understands a feature. Good review also mentors junior developers and produces better software. Most employers expect every developer to both give and receive code reviews as a daily part of the job.

Opening a Pull Request

Before opening a PR, make sure your feature branch is pushed to the remote repository:

```

git push origin your-feature-branch

```

On GitHub, navigate to the repository. GitHub usually shows a banner offering to open a PR for a recently pushed branch. You can also click Pull requests → New pull request, then select your feature branch as the compare branch and the target branch (commonly `main` or `develop`) as the base.

Writing a Good PR Description

A weak PR title like "fixed stuff" wastes reviewers' time. A complete description includes:

Many teams provide a PR template (a Markdown file in the repository) that prompts you for each section. Fill every section in; do not delete headings and leave them blank.

Conducting a Peer Code Review

When assigned to review a PR, open the Files changed tab. GitHub shows a line-by-line diff in red (removed) and green (added).

To leave an inline comment, click the blue `+` icon next to any line. Write your comment in the text box. Inline comments are tied to a specific line so the author knows exactly what you mean. At minimum, a professional review includes:

When you are done reading all the files, click Review changes (top right), write a summary comment, and choose one of three outcomes:

Submit your review. The author is notified automatically.

Responding to Review Comments

When you receive review comments, read every one before making changes. For each comment you agree with, make the fix in your local branch, commit it, and push again:

```

git add changed-file.js

git commit -m "Address review: rename variable for clarity"

git push origin your-feature-branch

```

The new commit appears in the PR automatically. Reply to the comment on GitHub to let the reviewer know what you did (or explain respectfully if you disagree). The reviewer can then re-examine the file and approve.

Merging the Pull Request

Once a reviewer approves and no required checks are failing, the author merges the PR. GitHub offers three merge strategies:

Click Squash and merge, edit the commit message if needed, then confirm. Delete the remote feature branch afterward to keep the repository tidy.

Professionalism and Safety in Code Review

Code review involves real communication between people. Keep all comments focused on the code, not the person. Phrases like "this function is hard to follow; consider extracting lines 14–20 into a helper" are constructive. Phrases that attack the author's ability are not acceptable and violate most workplace codes of conduct.

From a technical safety standpoint, never merge a PR that introduces credentials (passwords, API keys) into a public repository. If you spot one in a review, flag it immediately with a Request Changes review and notify the instructor. Exposed credentials must be rotated even after deletion because commit history may have been cached.

Recording Your Work

Log the PR number, the merge strategy used, and a one-sentence summary of what was merged in your lab log after every PR activity. This habit mirrors professional practice and gives you a personal record you can reference when building your portfolio.

Key terms8

Pull Request (PR)A GitHub feature that proposes merging changes from one branch into another and opens a conversation thread for code review.
Base branchThe branch that will receive the merged code; commonly `main` or `develop`.
Compare branchThe feature branch containing the new code that you want to merge into the base branch.
Inline commentA review comment attached to a specific line in the diff, allowing precise feedback on that exact code.
Squash and mergeA GitHub merge strategy that collapses all commits from a feature branch into a single commit on the base branch, producing a cleaner history.
Request ChangesA review outcome that blocks merging until the PR author addresses the reviewer's required fixes.
PR templateA Markdown file stored in the repository that pre-populates the PR description with required sections such as what changed, why, and testing done.
DiffA side-by-side or unified display showing which lines were added (green) or removed (red) between the base branch and the compare branch.
In class: Each student pushes a feature branch to a shared class repository and opens a pull request using the GitHub web interface, writing a title and description that explains what changed, why it changed, and any testing done, following a provided PR template. · Students are paired to review each other's pull requests: they leave at least two inline code comments using GitHub's review tool, at least one suggesting a concrete improvement, and then submit the review as either Approve or Request Changes with a summary comment. · Students address at least one review comment by pushing an additional commit to the branch, then the reviewer approves and the original author merges the PR using the Squash and Merge option; both students record the PR number and merge strategy in their lab logs.
Materials: GitHub shared class repository (instructor-created), GitHub web interface, terminal, PR description template (provided), lab log
Check: PR contains a complete description, at least one review exchange is documented, the merge is completed with no broken files; instructor reviews the PR thread and lab log entry; 80% of evaluation rubric criteria met.

Practice check8

Answer each question, then check it. Nothing is recorded; this is your own practice.

Software development tools and workflows
1. A developer pushes a feature branch and opens a pull request on GitHub. Which tab shows a line-by-line comparison of what changed?
Software development tools and workflows
2. A reviewer wants to comment on a specific line of code in a pull request. What is the correct GitHub action?
Security and professional practice
3. A student notices an API key has been accidentally committed and is visible in an open pull request on a public repository. What is the correct first action?
Version control concepts
4. Which merge strategy combines all commits from a feature branch into a single commit on the base branch?
Software development tools and workflows
5. After receiving a Request Changes review, a developer fixes an issue locally. What is the correct sequence to update the pull request?
Professional communication in software development
6. A good pull request description should include which three elements?
Software development practices
7. Which statement best describes the purpose of code review in a professional development workflow?
Software development tools and workflows
8. A reviewer submits a review using the 'Comment' outcome instead of 'Approve' or 'Request Changes'. What does this mean for the pull request?
Record this lesson on my transcript. Sign in with your key and enrollment email to record lessons (enroll free if you have no key). This page stays open to read and practise.