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

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.

Kubernetes–Limit your environmental impact

Reducing the carbon footprint and CO2 emission of our (cloud) workloads, is a responsibility of all of us. If you are running a Kubernetes cluster, have a look at Kube-Green . kube-green is a simple Kubernetes operator that automatically shuts down (some of) your pods when you don't need them. A single pod produces about 11 Kg CO2eq per year( here the calculation). Reason enough to give it a try! Installing kube-green in your cluster The easiest way to install the operator in your cluster is through kubectl. We first need to install a cert-manager: kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.5/cert-manager.yaml Remark: Wait a minute before you continue as it can take some time before the cert-manager is up & running inside your cluster. Now we can install the kube-green operator: kubectl apply -f https://github.com/kube-green/kube-green/releases/latest/download/kube-green.yaml Now in the namespace where we want t

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