Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Shopify Engineering 13 min read Opinion mediumAdept

On the Importance of Pull Request Discipline

Well-structured pull requests make code review easier and leave a self-documenting history that speeds debugging and rollbacks. The guide walks through each part of a GitHub PR: titles that state scope and affected models, summaries that explain what changed and why, including alternatives considered, plus commit messages, comments, labels and linked issues. For commits it recommends that each one pass CI on its own, follow a logical order, keep refactors separate from business logic, fold linter and review fixes in with fixup/autosquash, and include tests with the code they cover. It also favors smaller PRs and accepts skipping the rules during emergencies, provided the history is cleaned up afterwards.

Assumes: Git basicsGitHub pull requests

Related posts

  • Git Organized: A Better Git Flow

    Render mediumAdept

    Commit-as-you-go branches often produce commits mixing unrelated or half-finished changes, which makes reverts risky and pull requests tedious to review. A cleaner flow is to do the work first with throwaway WIP commits, then `git reset` back to the branch point (keeping the working tree), and rebuild logically grouped commits using `git add -p` for partial files. Verify that each new commit works on its own by stashing the remaining changes and testing, and use `git commit --amend` to fix up omissions. If anything goes wrong, `git reflog` can recover the original commits.

  • Turn one giant AI-generated pull request to a reviewable stack

    GitHub Engineering mediumAdept

    Stacked pull requests split a large, agent-generated feature diff into a chain of small, dependency-ordered PRs that are each scoped to one concern. A worked example adds product search to a shopping assistant as four layers: catalog data, search API, chat wiring, and grounded UI. Each layer is built by a scoped custom agent and reviewed by a different owner using the gh-stack CLI (init, add, push, submit, rebase, sync). The recommended review flow is to read top-down for context and review bottom-up. Fixes to a lower layer are propagated with gh stack sync. Prefer local gh stack rebase over the web Rebase button, because the server-side rebase resets the committer and produces unsigned commits that can break branch protection.

  • Code Review Can Be Better

    TigerBeetle mediumAdept

    TigerBeetle shelved git-review, an experiment that stored code review as a single commit of inline marked comments on top of the PR branch, edited by author and reviewer and reverted once all threads were resolved. Reviewing locally with inline comments worked very well, but applying requested changes caused merge conflicts with review comments at hunk boundaries, and frequent force-pushes added friction. The mismatch between strict hash-chained history for code and the looser merging review needs pushed the tool past a small-script budget. Git's possible adoption of Gerrit-style Change-Ids may enable per-commit interdiff review, and related tools such as Fossil, git-appraise, prr and flirt are listed.

  • Continuous AI for accessibility: How GitHub transforms feedback into inclusion

    GitHub Engineering mediumAdept

    GitHub built an event-driven accessibility feedback pipeline on GitHub Actions, Copilot and the GitHub Models API that turns every user report into a tracked, prioritized issue. Issue creation triggers Copilot analysis that uses stored, PR-editable prompt files instead of fine-tuning. The analysis fills about 80% of 40+ metadata fields and suggests WCAG criteria, severity, affected user groups, team assignment and a reproduction checklist. A second Action parses Copilot's comment to apply labels and board status. Humans verify at each stage, and their corrections are logged to refine the prompts. About 75–80% of reports match existing audit findings and get reprioritized by real-world impact, and issues close only once the user confirms the fix works.

  • The Tests Are Passing, Why Would I Read The Diff Again?

    ClickHouse mediumAdept

    Code review reduces defects largely because explaining code to another person exposes gaps in understanding, much as writing comments or rubber duck debugging does. Reviewers should focus less on style and gatekeeping and more on whether the code is understandable. They should ask for clarification when something takes effort to follow and make sure the answers end up in the code and comments rather than staying in the conversation. Authors should do design review first, write introductory and why-focused comments, document data structures and invariants, and back comments with assertions and tests. The post also rebuts the "self-documenting code" and "comments go stale" objections to heavy commenting.

The quest for software engineering knowledge.

Look:
Layout: