DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. How NOT to Review a Pull Request

How NOT to Review a Pull Request

Don't just look at the diff. Here's how to do your job properly when reviewing PRs.

Lorna Mitchell user avatar by
Lorna Mitchell
·
May. 21, 19 · Opinion
Like (3)
Save
Tweet
Share
4.40K Views

Join the DZone community and get the full member experience.

Join For Free

Examine the diff and comment on it, a line at a time

That's not very constructive, Lorna. Do you have a bit more advice for us?

Since you asked so nicely, yes I do!

How to Review a Pull Request

First, read the description. If there isn't one, close the pull request. You might need to go looking for an original task or story but it's vital that you read the words there and reflect on what problem this change should solve or what feature it should introduce. The code might be faultless but still miss the point or not catch an important edge case: as a reviewer, that's your job.

Now take the code and run it locally. If you haven't run the code, why are you accepting it into production? Even if you aren't expecting reviewers to also merge the code, an approving review is taking responsibility for that change going live. If it's prose, you still need to see how it renders, etc. Casting your eyes over a diff is never, ever enough, if you're serious about what you do, you'll see the change in context and "poke" at it. I'm sure you do have an excellent build process with tests and whatever - are they better than a curious human checking something for cracks?

When you can answer "yes" to the following questions, you can proceed:

  • Yes, I am happy that this is a useful feature/change, that I understand its purpose and it is fit for that purpose.
  • Yes, this change works as expected, even in the not-success case, even with unexpected data, even with missing configuration.

OK, now you can read the code diff. My final piece of advice: try not to add low-level idle commentary on other people's code when it really doesn't matter which way things are done. For example: nitpicking use of one approach over another but then allowing the code to merge anyway is IMO very unhelpful. However asking for a confusing/unclear/abbreviated variable to be renamed is probably valuable for the longer term.

Beware the "Helpful" Tools

GitHub is the worst offender for encouraging really awful pull request review processes. When you go to "leave your review", you are immediately transported to the diff. This is exactly where you should not start! Looking at the diff encourages commentary on whitespace. It does not encourage consideration of what is missing from this change request and it also does not encourage trying the code, asking questions, etc. I understand they mean well and for static websites on GitHub pages, perhaps this is enough and the "big green button" is a helpful addition to the workflow. Most of the projects I work are a bit more complicated than that and I encourage developers everywhere to use their brains as well as the helpful tools to provide the best-quality feedback on their peers' changes that they possibly can.

pull request Requests code style

Published at DZone with permission of Lorna Mitchell, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Rust vs Go: Which Is Better?
  • [DZone Survey] Share Your Expertise and Take our 2023 Web, Mobile, and Low-Code Apps Survey
  • How Elasticsearch Works
  • Monolithic First

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: