Add Tone Indicators to Your Pull Requests

It is a truth (almost) universally acknowledged that a single software developer in pursuit of good coding standards must be in want of peer review. Pride and Prejudice jokes aside, good codebases are rarely built by individuals. Peer review and testing processes are important for catching bugs, identifying risks, and, above all else, enforcing code standards. Effective teams provide balance and promote best practices through peer review and analysis of each others’ work as parts of a whole.

In an ideal world, such a process is easy. You spend a while crafting the best solution to a problem, submit it for a pull request, someone else hits the big green button, and then you merge and move on to the next thing. More often than not, though, you have not written the perfect, best, solution to the problem.

However, the process of discovering this is neither easy nor smooth. Someone may respond to your work with a comment that completely disagrees with your approach, or ask a question phrased in a way you perceive as aggressive. Pull request review is just another form of interpersonal communication, and like any other form of communication, it’s wrought with potential for offense, distrust, and argument.

Conventional Comments

A coworker on a past project introduced our team to a proposed solution for this exact friction, a resource called Conventional Comments. The concept is simple: annotate your comments with agreed-upon terms — including tone indicators — that denote the nature of the comment, the urgency to address it, and the degree of change necessary to accomplish the task.

For example, if a change is something that is well and truly broken in your opinion, that’s easy to communicate with fix or issue, blocking:

Pull request comment that reads: "Fix These titles need to be all caps according to the designs"

Pull request comment that reads: "issue blocking you shouldn't need to call this function again, if it's not updating on it's own without calling this again we may need to update the way we are collecting the flow in getUserOverview..."

In contrast, say there’s something much smaller you still want addressed, but you acknowledge that it’s not technically broken. You may communicate with terms like nit, polish, or pattern:

Pull request comment that reads: "nit could we add the Jira ticket to this todo"
Pull request comment that reads: "non-blocking, polish I wonder it it would be possible to move the Column/centering/fillmaxwidth formatting into the defaultErrorState component? It seems like we always want this behavior."
Pull request comment that reads: "Pattern (nonblocking) Since refactoring the Maintenance Models, we've been starting to move initialization to the top to make it easier to see what the initial state of everything is. See examples in ViewMaintenanceRequestViewModel"

And then what do you do when you have a suggestion to make? Or a question? Well, just annotate them as such and be on your merry way:

Pull request comment that reads: "Suggestion (nonblocking) Can we suffix this with =title workflow_title so we know what its purpose is? I know it seems obvious at a glance but would be nice to keep patterns of string naming."

Pull request comment that reads: "question wondering if this is somthing that should be in the MarkDownProcessor"

Another one that we liked using was praise. It can feel good to acknowledge and be acknowledged for doing good work, so take a shot and just do it!

Pull request comment that reads: "praise great call making a variable"

 

The Power of Annotation

This concept of annotation is not only limited to these terms. There’s denoting something as a blocking vs non-blocking change, specifying what the issue pertains to (UX, code standards, etc.). My team also marked things as todo or chore to indicate a fix that was necessary but small.

The true beauty of adding tone indicators to your pull requests is that you can make these comments as rigid or as loose as you like. But the additional information helps demystify what you are trying to communicate and takes the focus away from interpersonal communication and toward the overall goals of a project and the team’s work. It can also help you frame feedback as something that has a purpose, and not just leaving feedback for the sake of commenting on something. Peer review is important, and the smoother teams can make the PR process, the healthier they will be.

Conversation
  • Solar says:

    This article was very enlightening. Appreciate the insights.

  • coreball says:

    Value and effective application. Enjoy having access to diverse sources of knowledge. Really interesting experience with valuable topics.

  • Join the conversation

    Your email address will not be published. Required fields are marked *