-
Notifications
You must be signed in to change notification settings - Fork 1
Trunk Based Development
Morales Patty Jose Manuel edited this page Oct 27, 2024
·
1 revision
Trunk-Based Development (TBD) is a version control methodology that prioritizes collaboration on a single main branch ("trunk" or "main"). This guide establishes the guidelines for implementing TBD in our development team.
-
Single Source of Truth: The
mainbranch is always the single source of truth - Frequent Integration: Daily commits to trunk
- Frequent Deployments: Continuous Delivery/Deployment
-
Branch Creation
git checkout main git pull origin main git checkout -b [branch-name]
-
Development and Commits
git add . git commit -
Update with Main
git checkout main git pull origin main git checkout [branch-name] git rebase main
-
Pull Request
- Create PR to main
- Request code review
- Ensure CI passes
- Merge after approval
- Daily reviews
- Maximum 400 lines per PR
- Use of automatic linters
- Documentation required for significant changes
- No more than 1-2 days without integrating
- Short-lived branches (<24 hours ideal)
- Early conflict resolution
- Lint
- Unit Tests
- Build
- All tests must pass
- Code review approvals required
- No deployment with failing tests
- Automatic rollback on failure