DEV Community

Vasily Polovnyov
Vasily Polovnyov

Posted on

“What” and “For what” in pull requests

What? and For what? questions in pull request template

A few months ago, I came up with a template for pull requests consisting of two questions: "What?" and "For what?". You open a pull request, answer the questions, and send it to the reviewer. The reviewer dives right into the problem, understands faster what we are trying to accomplish, and visualizes a possible solution.

A couple of examples:

## What?
Update Rails to

## For what?
To fix a security vulnerability: CVE-123123.

## What?
Before tracking a coupon, make sure it actually exists in the database.

## For what?
To avoid writing junk data like `utm_campaign`, `utm_source` or `utm_medium` into the analytics.
Enter fullscreen mode Exit fullscreen mode

I've also noticed a positive effect for the pull request author: if you can't articulate "For what?", you don't actually understand the task; if the "What?" has "Also..." and "And...", it's better to split the pull request into several ones.

What are your thoughts on this topic? What kind of pull request templates do you use?

(All in all, I really recommend trying this!)

Top comments (0)