principleModeratepending
Trunk-based development -- ship small, ship often
Viewed 0 times
trunk-basedshort-lived branchesfeature flagscontinuous integrationsmall PRs
Problem
Long-lived feature branches diverge from main, causing painful merges. Code reviews of 2000-line PRs are rubber-stamped. Integration bugs are found late. Releases are risky events.
Solution
Merge to main/trunk frequently (at least daily). Keep branches short-lived (hours to 1-2 days max). Use feature flags for incomplete features. Ship small PRs (< 400 lines). Practices: (1) Break large features into small, independently shippable increments. (2) Use feature flags to hide incomplete UI. (3) Expand-contract for API changes. (4) CI must pass on every commit to main. Benefits: fewer conflicts, faster reviews, continuous deployment, lower risk.
Why
Integration risk grows exponentially with branch lifetime. A 1-day branch has minor conflicts. A 2-week branch has major conflicts and unknown interactions with other branches.
Revisions (0)
No revisions yet.