finner

finner

The Pull Request

When you are under pressure to deliver you ideally want your Pull Request to be reviewed, approved and merged as quick as possible. So does everyone else! I’ve seen a Pull Request go through a review for over 52 days! An extreme example, and most of the debate was petty.
But where do you draw the line? Does the wrong variable name stop you from approving someone’s work? Or, would you ask for a complete redesign of a submitted solution?

I would like to open a discussion around the Pull Request and share our experiences and practices.
Here’s some questions that I have pondered many a time:

  • How do you review Pull Requests ?
  • When do you review Pull Requests ?
  • How long are you willing to wait for a review / approval?
  • How long do you spend reviewing a Pull Request?
  • How many Pull Requests would you review in a day ?
  • What is the best size (number of modifications/ additions) for a Pull Request ?
  • How frequently do you submit Pull Requests? (daily / weekly / monthly)?
  • How do you feel emotionally when someone suggests changes?
  • How do you feel emotionally when you suggest changes?

Most Liked

wolf4earth

wolf4earth

How do you review Pull Requests?

Same as @ohm, on GitHub, but I want to go beyond the technical answer.

When I review PRs I’m very deliberate about my choice of words. I never write “you should do X” but I opt for wordings along “from where I’m standing it might be better to do X because of reason Y”.

I always explain the reasoning behind my suggestions and make liberal use of GitHub’s “suggestion” feature to ease integrating my suggestions for the author.

I’ve actually did a lightning talk on the topic a few years back, you can see it here (here is a great article on the topic which I also reference in the talk).

When do you review Pull Requests?

Usually in the morning or directly after lunch. I try to avoid interrupting my focus to do code reviews so I do them “when I have time”.

How long are you willing to wait for a review / approval?

As long as necessary. Usually they’re done on the same day, sometimes I need to wait another day. If it takes longer than that I tend to re-request the review as a more gentle version of pinging people on Slack.

How long do you spend reviewing a Pull Request?

Anything between 5-10 minutes for short PRs to up to an hour for bigger/complex PRs.

I really go through the code and try to understand the flow of the program which takes it’s time but also lets me spot things a more superficial code review would miss.

How many Pull Requests would you review in a day?

On busy days I’m reviewing around 3-4, haven’t had to review more than that so I can’t comment on what my “upper limit” would be.

What is the best size (number of modifications/ additions) for a Pull Request?

It’s great if the PR can stick below 100 changed lines that’s great because it eases the burden to understand the change. Sometimes that’s not possible but I think it’s a good rule of thumb to try to keep PRs small.

I struggle with this myself from time to time.

How frequently do you submit Pull Requests? (daily / weekly / monthly)?

A few times per week. Not necessarily daily.

How do you feel emotionally when someone suggests changes?

Depends on how the suggestions are phrased.

See my section above on how I do code reviews. :yum:

How do you feel emotionally when you suggest changes?

As said before, I always try to stay compassionate when reviewing and try to put myself into the author’s shoes. From the feedback I’m getting from colleagues I think I’m doing quite a good job at this.

AstonJ

AstonJ

I would try not to take anything personally (so long as the feedback wasn’t rude). Just keep in mind that often personal taste, direction and experience are factors, and if a change is suggested it just means they are looking for something different, which may be based on their taste or experience.

For people suggesting changes I would say please just be kind :blush:

ohm

ohm

  • How do you review Pull Requests?
    • On GitHub
  • When do you review Pull Requests?
    • When I have time after I get assigned as reviewer or pinged to review
  • How long are you willing to wait for a review / approval?
    • As long as it takes. We do not merge unreviewed or unapproved PRs, even for production critical code.
  • How long do you spend reviewing a Pull Request?
    • Depends on the PR, but generally not more than 15 minutes. If the PR is too big, we tend to mark our review as “Too much code, please split into smaller more reviewable chunks”.
  • How many Pull Requests would you review in a day?
    • Between 0 and 10. It depends on the day and what project the other developers are working on.
  • What is the best size (number of modifications/ additions) for a Pull Request?
    • I don’t think there is a “best size” or a “one size fits all” answer to this. If you’ve made the same change in a thousand files, I’ll still count it as one change. Make the changes relevant to the problem you’re trying to solve.
  • How frequently do you submit Pull Requests? (daily / weekly / monthly)?
    • Again, it depends on what I’m working on. I would say around 5-10 per week on an average week.
  • How do you feel emotionally when someone suggests changes?
    • I feel happy, because it means that they care enough to actually check out what I’ve been doing. If I agree, I’ll give a :+1: and immediately fix it. If I don’t, we can have a discussion. Sometimes that discussion happens off of GitHub (Slack, Zoom, in person) or it can happen in the review. Once we come to an agreement, we’ll post the agreed upon changes and I’ll do that.
  • How do you feel emotionally when you suggest changes?
    • If the change is “you misspelled this” or “Please follow the style guide” I get annoyed, because it feel like the other person just don’t care. When I suggest changes other than that I tend to back it up with “previously we’ve done this in file X on line Y” or “We discussed here LINK that we would do it this way” or even “I would have done it like THIS, but if you feel like we should do it your way going forward, we can do that”.

Popular General Dev topics Top

wolf4earth
Inspired by this thread about arcade games - which I initially misread as favorite arcade game soundtracks - I wanted to ask about your f...
New
AstonJ
Which apps do you think are killing it right now? Either from a technical perspective or ones that you like personally or feel have been...
New
AstonJ
Looking at @siddhant3030’s photo from the Do you blog? thread, do you cover your computer or phone camera as a security precaution? Wha...
New
chasekaylee
Hi there! I have some old Bose in ear noise cancelling headphones that have worked like a champ for the past 3 years and was maybe due fo...
New
Exadra37
I am a Linux user since 2012, more or less, and I always use Ubuntu on my computers, and my last 2 laptops have been used Thinkpads, wher...
New
AstonJ
Hi everyone… I’m so sorry about the delay in getting this thread up, I’ve just been so busy :see_no_evil: Are there any book clubs you’d...
New
New
malloryerik
With 100% less blockchain. I went searching for a lightweight immutable database that could be audited and ran into this. I guess this ...
New
AstonJ
Chris Seaton, the creator of TruffleRuby has died. It appears from suicide :cry: He left this note on Twitter on the weekend: And one...
New
Margaret
Hello DevTalk Community! Once again, The Pragmatic Programmers are looking for developers who’d like to help shape the future of our boo...
New

Other popular topics Top

Exadra37
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it. Does your monitor have eye p...
New
PragmaticBookshelf
Design and develop sophisticated 2D games that are as much fun to make as they are to play. From particle effects and pathfinding to soci...
New
AstonJ
Just done a fresh install of macOS Big Sur and on installing Erlang I am getting: asdf install erlang 23.1.2 Configure failed. checking ...
New
Exadra37
Oh just spent so much time on this to discover now that RancherOS is in end of life but Rancher is refusing to mark the Github repo as su...
New
PragmaticBookshelf
“A Mystical Experience” Hero’s Journey with Paolo Perrotta @nusco Ever wonder how authoring books compares to writing articles?...
New
New
AstonJ
If you want a quick and easy way to block any website on your Mac using Little Snitch simply… File > New Rule: And select Deny, O...
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
PragmaticBookshelf
Author Spotlight: Karl Stolley @karlstolley Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New