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...

Podman– Command execution failed with exit code 125

After updating WSL on one of the developer machines, Podman failed to work. When we took a look through Podman Desktop, we noticed that Podman had stopped running and returned the following error message: Error: Command execution failed with exit code 125 Here are the steps we tried to fix the issue: We started by running podman info to get some extra details on what could be wrong: >podman info OS: windows/amd64 provider: wsl version: 5.3.1 Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM Error: unable to connect to Podman socket: failed to connect: dial tcp 127.0.0.1:2655: connectex: No connection could be made because the target machine actively refused it. That makes sense as the podman VM was not running. Let’s check the VM: >podman machine list NAME         ...