DEV Community

Discussion on: How many pull requests is too many? Exploring a 2 PR rule

Collapse
 
katafrakt profile image
Paweł Świątkowski

This is a very good rule! I think I'll suggest we start to use it in my team on next retrospective meeting. Even though my team is small now, we do tend to have problems with forgotten pull requests hanging around. And you are right that getting back to work you did 5 pull requests ago is quite expensive in terms of context switching.

There are actually other things that can help. In my previous company we were often reminded that reviewing PRs is probably most important task for a developer, because it (un)blocks other people. It was a good practice to always look if there are some PRs to review before picking up any new task.

Collapse
 
derekjhopper profile image
Derek Hopper

I didn't even think of context switching while reading this post - thanks for bringing it up. That's a great point. Even if each pull request only took you a day to work on, you might have to context switch to a week ago at the very least.

Also, if there are 5 pull requests hanging around, it's possible something else is broken as well. Maybe those pull requests weren't the most important things to be working on? Maybe a QA team is backed up with other testing? Maybe nobody is focused on releasing? There could be a bunch of other factors in addition to the development team.

Collapse
 
tonydiaz profile image
Tony Diaz

Great point Paweł! I didn't mention context switching but you are right it is a hidden cost that is being paid.

You could try to experiment to see if 3 PRs per developer is the right number for a smaller team.