DEV Community

Discussion on: Do Stacked-PRs require re-review after merge?

Collapse
 
dorshinar profile image
Dor Shinar • Edited

This is true, changes in PR-1 would need to be propagated to the "downstream" branches manually.

Sometimes part1 might just be a refactor, and part2 is the actual feature...

I've combined both statements because to me, they are both supportive of merging to master (or another shared branch). If you are working on a refactor, I'm sure other developers on your team would love to have it merged sooner, so that they may start using it.

...I was drawn to it because it makes the review-experience better for the rest of the team because I've done this additional planning to chunk up a big task into cognitively smaller pieces.

I'm all for chunking up big tasks - it is really difficult to give a constructive review when you look at a diff that contains dozens of files.

In an ideal case I would prefer this, but sometimes there's pressure on time...

Well, then I think you should talk to your team leader about it, and find a way to justify it. In my opinion, it might shorten the review period if all goes well, but if not the price will be higher (again - IMO).

Assume that TDD is followed, and test-suite was passed for both PR-1, PR-2 and (PR-1 + PR-2). How would that impact your confidence in (PR-1 + PR-2)?

In that case it a much safer merge. I would still give it a quick look before merging, but it's passable.

Thread Thread
 
jlouzado profile image
Joel Louzado

In that case it a much safer merge.

Yes, it would definitely be safer if TDD was followed but I was hoping there would be a general way to answer the question: Is the sum of two approved PRs also an approved PR?

The answer is probably some function of tests, thoroughness of review process and a few other factors (perhaps). Thoughts?

Thread Thread
 
dorshinar profile image
Dor Shinar

Like much of what we do, there isn't a single right answer here. It depends on your confidence in your code and your tests.
My general answer would be no -
PR-1 + PR-2 =/> PR-1 * PR-2 (sum meaning both approved, multiplication meaning one merged into the other).
But, that does not mean that under certain conditions (which I believe were met in your case), it can't be assumed.