Skip to content

Pull Request Best Practices

Patrick Erichsen edited this page May 2, 2020 · 2 revisions

When creating a Pull Request it is important to follow best practices in order to make sure your code is able to be reviewed as quickly and effectively as possible.

This page details some high level best practices pulled from "The anatomy of a perfect pull request" by Hugo Dias Follow. ​

Break down large pull requests into smaller ones

​ Take a big feature and break it into small pieces that make sense in isolation and can be merged into the codebase piece by piece without breaking anything. ​

Follow the “Single Responsibility Principle”

The single responsibility principle is a computer programming principle that states that every module or class should have responsibility over a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class. ​

Write an accurate title and description of the issue

​ Imagine that the code reviewer is arriving in your team today without knowing what is going on, and even so, they should be able to understand the changes. ​

Provide thorough test instructions

  • Provide instructions on how to run any new unit or e2e tests
  • If there are manual UI tests, walk a user through how to perform and validate them