Skip to main content

Stop using pull requests!

Yes, I know. A little bit of controversy in the title of this post could have triggered your attention. But hear me out.

I think that the pull request model is a good fit for open source development where people are working in their spare time on projects and want to design, collaborate and review in the open before accepting changes. I don't want to go in too much detail, so if you want to learn more about this model, check out the documentation on Github or the Atlassian BitBucket website.

Let me focus on the reason when and why I don’t like to use pull requests. I don’t think they are a good fit for dedicated software development teams working in close collaboration fulltime on the same codebase. In these teams I see pull requests used as a quality control mechanism allowing another (senior) developer to review the changes before approving them and pushing them to the master branch.

Pull requests are not a good fit for dedicated software development teams working in close collaboration fulltime on the same codebase.

After observing multiple teams using this approach, I noticed the following patterns:

  • It slows the team down. As work is waiting to be reviewed, context switching is necessary when feedback finally arrives. Especially when a more senior person needs to review the code, this person becomes the bottleneck slowing down the whole team. It wasn’t exceptional to see pull request remaining unreviewed for multiple days. This makes merge conflicts much more likely.
  • It leads us further and further away from continuous integration. To avoid the bottleneck, developers tend to work longer and longer on their feature branches postponing creating pull requests until their feature is completely ‘done’. As  a consequence pull requests become larger and larger. I’ve seen pull requests that impacted 50+ files.
  • The quality of the codebase decreases over time. This is quite contrary to what you would expect but unfortunately this is what I observed monitoring the work of multiple teams. Let me explain why this happens; it is all related to the previous observation. When pull requests get larger, it becomes a lot harder to review them. No one likes to read through hundreds of lines of code or is able to fully understand and grab the impact of a change spanning tens of files and classes. As a result the reviewers become more sloppy and will approve a pull request sooner (especially when the pull request is open for a few days, a long list of other PR’s are waiting to be reviewed, the business wants this feature yesterday and the person doing the review is the bottleneck from my first observation.)

Instead of using pull requests I would suggest to use trunk-based development together with pairing or mobbing to eliminate the need for code review. If you want to keep code reviews, you can conduct code reviews after integrating, rather than as a pre-integration gate. Let the team work in a continuous integration fashion integrating many times per day directly on the trunk (or master).

I noticed that using this approach has a positive impact not only on speed but also on code quality as we want to have the master branch in a releasable state.

Popular posts from this blog

DevToys–A swiss army knife for developers

As a developer there are a lot of small tasks you need to do as part of your coding, debugging and testing activities.  DevToys is an offline windows app that tries to help you with these tasks. Instead of using different websites you get a fully offline experience offering help for a large list of tasks. Many tools are available. Here is the current list: Converters JSON <> YAML Timestamp Number Base Cron Parser Encoders / Decoders HTML URL Base64 Text & Image GZip JWT Decoder Formatters JSON SQL XML Generators Hash (MD5, SHA1, SHA256, SHA512) UUID 1 and 4 Lorem Ipsum Checksum Text Escape / Unescape Inspector & Case Converter Regex Tester Text Comparer XML Validator Markdown Preview Graphic Color B

Help! I accidently enabled HSTS–on localhost

I ran into an issue after accidently enabling HSTS for a website on localhost. This was not an issue for the original website that was running in IIS and had a certificate configured. But when I tried to run an Angular app a little bit later on http://localhost:4200 the browser redirected me immediately to https://localhost . Whoops! That was not what I wanted in this case. To fix it, you need to go the network settings of your browser, there are available at: chrome://net-internals/#hsts edge://net-internals/#hsts brave://net-internals/#hsts Enter ‘localhost’ in the domain textbox under the Delete domain security policies section and hit Delete . That should do the trick…

Azure DevOps/ GitHub emoji

I’m really bad at remembering emoji’s. So here is cheat sheet with all emoji’s that can be used in tools that support the github emoji markdown markup: All credits go to rcaviers who created this list.