Fat PRs with massive changes are a huge and anyoing workitems for reviewers. The question is how to avoid these massive Git pull requests (PR)? But there is a more easy way.
Massiv PRs contains many changed files. If you look more into the detail you can recognize differtent pattern of code changes:
- Code changes not related to the new function. These changes are clean-ups olf existing code without any relation to the new functionaliity. These changes are caused by the boy scout rule "Every time you work on some code it may get a little bit better." This is called Tidy First.
- Changes that relates to the function but are only preparations for the following implementation. These changes are functional neutral.
- The new feature itself.
- Cleanup the new feature code. These changes are also functional neutral.
The idea is to split large PRs into smaller PRs by seperation of these concerns. This keeps PR small an easy to review.
The down-side of these PR seperation of concerns that all code changes are spread over multiple PRs. You review 3 times code that will properly change again. Rool-backs are maybe a little more nasty.
At the end reviewing 4 PRs looks like extra effort but it isn't because every PR is bound to his own concern. That makes it much easier to review.
No comments:
Post a Comment