The right size for a PR #3
-
I'm having an existential philosophical PR-related GitHub dilemma and I hope that this is the right channel to phrase it. How big should a PR be? I get the appeal of making them very small, almost equivalent to 1 commit. But at the same time I feel like if you split one feature into multiple PRs - you lose context on what they actually are about... I would compare it to building a nuclear bomb in small increments... Anyone has any opinions? |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 13 replies
-
I definitely don't know the answer, but here's an interesting article advocating for exactly what you suggest, ie. breaking a feature down into smaller sub-features, and having a PR for each: https://medium.com/@hugooodias/the-anatomy-of-a-perfect-pull-request-567382bb6067 Maybe this can spark a conversation |
Beta Was this translation helpful? Give feedback.
-
also yay discussions!! |
Beta Was this translation helpful? Give feedback.
-
I'm a big fan of "A PR introduces a discrete unit of functionality." So if you're PRing into |
Beta Was this translation helpful? Give feedback.
-
Surely there is no correct, one-size-fits-all answer to this. I think maybe a good process might be to think about the reasons that might make you lean towards smaller or bigger. I'll begin... feel free to add/modify... reasons you might lean towards smaller...
reasons you might lean towards bigger...
|
Beta Was this translation helpful? Give feedback.
-
I feel the dilemma and welcome this discussion, but I wouldn't worry too much because I think we are in a much much better place than we used to be. By working together we have come a long way. We seem to already understand the main principles, and I doubt more detailed instructions would be easy to write or cover all possible situations. The main idea that comes to mind is this: Aim for continuous improvement; move towards your goal as much, as clearly, as safely, and as independently as possible. When you balance these elements, sometimes you realize you can't reach your goal in a single step. That is the core idea of "refactoring moves". |
Beta Was this translation helpful? Give feedback.
-
I also think an interesting process is to imagine if you were working on a project completely alone, but still using Git. Now imagine if you come back to this PR/merge a month from now, or a few months from now for whatever reason. Whatever stress, angst, difficulty you have then, multiply that by 10 and that will be a good estimate of what anyone else will experience if they have to look at it. |
Beta Was this translation helpful? Give feedback.
-
Just came across (again) with this wonderful article that answers (1) What is small, and (2) When large is okay. https://google.github.io/eng-practices/review/developer/small-cls.html |
Beta Was this translation helpful? Give feedback.
-
I came across this super relevant article: https://www.netlify.com/blog/2020/03/31/how-to-scope-down-prs/ |
Beta Was this translation helpful? Give feedback.
I'm a big fan of "A PR introduces a discrete unit of functionality." So if you're PRing into
dev
branch, it should be a single, small, self-contained feature. If you're movingdev
intomain
, then it will necessarily include several (hopefully related) features. I think the key thing to keep in mind is "What will break if I revert the merge commit?"