Konubinix' opinionated web of thoughts

Is Merge/Pull Request a Good Thing?

Fleeting

Is merge request a good thing?

TL;DR: In my mind, is it almost unavoidable when getting code from people you don’t trust and pretty useful but totally avoidable when dealing with people you trust.

People tend to say we have to do merge requests, almost dogmatically, without explaining what we want to achieve.

When a contributor to some code wants to provide change-sets, I think that there are two kinds of situation:

  1. when the people owning the code trust the contributor, like when they are team mates working in some shared code,
  2. when the code owner does not know or trust the contributor, like when suggesting a change in an open source project while people don’t know you,

In the former scenario, merge request may be useful1 because:

  1. it dedicates time to perform the code review, a dedicated time to discuss opinions and grow together. Otherwise, people tend to get into the next “urgent” stuff and this very useful activity gets dropped.
  2. it involves several people in the responsibility of the code, making them more keen on owning it and then taking initiatives, like fixing code smells or adding tests.

In the latter, they are needed because:

  1. the goals of the maintainers is not the same as the one of the contributors (see open source and cross goal game). Even though they both might want to do the right thing, their opinions of the right thing may not be totally aligned.
  2. any kind of code can be suggested, even malicious code. There is a need to moderate what comes through.

  1. Even in that case, I strongly advise not to make them compulsory (see the method I suggest) and leave the choice of having a code review to the person submitting the new code. I want to believe that people in my team are open minded enough to ask for an external opinion when they feel like they need one and share the urgent/important distinction to take the time to do it. Otherwise, I guess there is a need to work in a more profound and non technical issue: finding our commons goals and values so that we can together have a flourishing activity. ↩︎