The Ops Community ⚙️

Jason Purdy
Jason Purdy

Posted on

Automatic Checklists with Pull Request Templates

If you haven't read or heard of the Checklist Manifesto book, it's a great read about how a checklist can help get things right. There's a case study about how a hospital saw decreases in surgery deaths when they employed a checklist.

At my work, we employ a checklist when it comes to deploying code, which is a part of our pull request process. When someone has code that's ready to ship, they generate a pull request, which has some of these steps:

  • Get code review
  • Present staging server for stakeholder signoff
  • Have all stakeholders signoff
  • Pick deployment date/time and communicate w/ team that deployment is happening
  • Put site in maintenance mode and take backup
  • Deploy code
  • Make any database/configuration changes
  • Final testing on production
  • Remove maintenance mode
  • Communicate w/ stakeholders that code is live

You make make this checklist show up automatically with a pull request template. You would create a file called PULL_REQUEST_TEMPLATE.md and put it your project's .github folder. Looks something like this:

## Description
<!--
    Describe what this update does.
-->

<!--
    If this pull request closes any issues, please specify here. Otherwise, delete this section.
-->
Closes: #

## Testing
<!--
  Describe what testing you did for this.
-->

## Code Deployment Checklist
 - [ ] Get code review
 - [ ] Present staging server for stakeholder signoff
 - [ ] Have all stakeholders signoff
 - [ ] Pick deployment date/time and communicate w/ team that deployment is happening
 - [ ] Put site in maintenance mode and take backup
 - [ ] Deploy code
 - [ ] Make any database/configuration changes
 - [ ] Final testing on production
 - [ ] Remove maintenance mode
 - [ ] Communicate w/ stakeholders that code is live

Enter fullscreen mode Exit fullscreen mode

Then whenever you create a pull request in GitHub, the template gets auto-populated like so:
Pull request creation

And when you create the pull request, it looks something like this:

Checklist in pull request

And as things are checked off, the number of steps are reflected in the list of pull requests:

Index of pull requests, showing completed steps

So a checklist is a simple thing, yet I can attest to how powerful and preventative it is.

Latest comments (0)