by WirelessGigabit · 4y ago · 0 comments
Huge PR to refactor, and fatigue sets in. But we cannot PR chunks because the build cannot fail.
Usually, I strive for "vertical slices". That means that, sometimes, a PR just contains "useless" code in isolation, but that makes sense as I keep merging them (stacked diffs). My flow is usually:
1. Does this code have tests? What's the minimum chunk I need to write tests for it?
2. Write tests and the smallest refactor I can think of (it may be to create one function, p.e.)
3. Commit
4. Return to 1. until the full refactor is done
5. Throw 3-10 stacked diffs that can be merged with the build passing.
EDIT: formatting
There's only 3.333 lines in total??
Could you code review & approve on a branch without those build restrictions, and then have an additional review of a merge commit to main?
The "has to build" requirement has been circumvented at all previous employers with some similar workflow, including on perforce, cvs, email, mercurial, and git.
The second commit contains the 3 lines of functional change.