Support

stacker

Organized Pull Requests for Better Code Reviews

Synopsis

Ensure high quality Code Reviews by splitting your large Pull Requests into a series of smaller interconnected ones.

Code Reviews are an important tool the development team wields that lets them prevent bugs and ensure code quality and consistency. Often enough, the reviewer has to grok hundreds of changed lines in dozens of files. This leads to either a very shallow skim of the Pull Request or Pull Requests decaying because no one wants to bother with such a monumental task.

Features

(Inspired bythis)
  • Stacked Pull Requests

    Stacker lets you split your Pull Request into multiple, interconnected Sub-Pull Requests. The Pull Requests are managed as a Stack where each Pull Request is based on the branch of the previous. Each PR contains a minimal scoped change making it easy to review.

  • Guide You Through the Process

    Stacker automatically detects the changes to your Pull Requests and adds a status check to make sure only the top most PR will be merged.

  • Easily Track Your PRs

    Stacker maintains an up-to-date TOC in the main Pull Request of all PRs in the stack.

What

The solution is split into two:
  • Stacker CLI - Helps you create the PR Stacks
  • Stacker Github Bot - Helps you manage your PR Stacks in Github

User Flow

  • Use the Stacker CLI to open PR Stacks and their Items (more on this in the next section)
  • Each Stack Item is based on the branch of the previous Item
  • The Stacker Github Bot detects PRs from the same stack and link between them for an easier workflow while also creating an up-to-date Table of Contents of all PRs in the main Stack PR
  • Push commits to your PRs while merging updates up the stack (from the oldest PR to the newest)
  • When all PRs have been reviewed and approved and you're ready to merge the entire stack, start squash-merging down, starting from the top most PR in the stack
  • The Stacker Github Bot adds a failing status check to all PRs that are not at the top of the stack in order to avoid out of order merging
  • The main PR should be the last PR to be merged

Usage

  • Install the Stacker Github Bot into your repository or organization
  • Install the stacker CLI - brew tap stackedpr/stacker && brew install stacker
  • Create a new branch - git checkout -b user-dashboard
  • Create a PR Stack - stacker --new
    • ➜ my-repo git:(user-dashboard) stacker --new
    • ✔ What is the name of the PR Stack? User Dashboard
    • ✔ What would you like to appear in the title of the main PR? Support Pro Users
    • Creating a PR Stack for User Dashboard...
    • Created PR Stack: https://github.com/my-org/my-repo/pull/10
    • Run `stacker --add` to create a Stack Item
  • A new Pull Request will open
  • Create a Feature Stack Item - stacker --add
    • ➜ my-repo git:(user-dashboard) ✗ stacker --add
    • ✔ What is the title of this Stack Item? Server API
    • Creating Stack Item...
    • Created Stack Item: https://github.com/my-org/my-repo/pull/11
  • A new Pull Request will open, based on the previous branch
  • The main PR will be updated with a link to the PR Stack Item that was just created (example of a main PR with two Stack Items)
  • The main PR's Table of Contents will be updated whenever a PR Stack Item is merged or closed
  • A failed status check will be present for all PRs that are not at the top of the stack