-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Cascading Pull Requests
Prateeksha Singh edited this page Jun 19, 2018
·
4 revisions
Cascading Pull Requests (CPR) is a strategy to break down a big features in smaller mergeable parts. Smaller parts are easier to merge, review and have fewer bugs.
The goal is to keep un-shipped code to the minimum.
This document explains how to build a feature in a mergeable way using CPRs
These are strategies to help you plan how to implement a feature
- Make a mockup and get it approved, specially for larger features. This will make sure that the naming and labeling is correct. Fixing a column name or table / DocType name at a later point is going to be very difficult.
- Break down the feature into smaller phases so that each phase is complete on its own.
- Start from the data structures and move up to the user interface elements.
- Build the smallest possible feature that can be merged and is working
- Keep the feature hidden from the user until it is complete
- Create a new branch as soon as a phase is completed, so you can continue working even when your earlier phases are not merged.
- As soon as your phases get merged, rebase with
develop
.
- Of course, a gotcha is that almost always, the PRs are not mutually exclusive. This means that the contributor has to take care to keep rebasing his development branch to reflect the changes of his previously merged PR (and any other changes in the meantime).
- As a result, this approach works better if the individual PRs are merged at a reasonable pace.
- It also helps if the individual steps are defined beforehand, for the maintainers to understand the effects that may not clear in the early stages.
- It should be noted that this does not imply that you'd have to create a new branch for every PR. Cascading suggests separation of PRs, not necessarily branches. You can continue developing and push all your commits to the same feature branch and create PRs along the way. Simply rebase the branch as your previous PRs get merged.
If you are working on implementing Global Search, here are suggested phases
- Create Index Table
- Build Index table for existing data
- Update Index table for new inserts and updates
- Refactor search bar
- Show global search results in the new search bar
- Make a modal to show all results in a classified way.