Salesforce Trunk-based Development Link Link

❌ Multiple active release branches (e.g., release/spring , release/summer ). ❌ Feature branches older than 2 days. ❌ Development branch ( dev ) that lags behind main . 7. CI Pipeline Architecture for TBD in Salesforce Commit to main │ ▼ [Fast CI] (< 5 min) - Lint (PMD, ESLint) - Validate metadata syntax - Quick Apex tests (0-10% coverage) │ ▼ (if passes) [Medium CI] (< 15 min) - Deploy to validation scratch org - Run all Apex tests - Run destructive changes simulation │ ▼ (if passes) [Slow CI] (< 30 min) - Deploy to full copy sandbox - Run regression suite - Build unlocked package (if applicable) - Deploy to staging org 8. Metrics to Measure Success | Metric | Target | How to Measure | |--------|--------|----------------| | Branch lifetime | < 24 hours (average 4-6 hours) | Git analytics | | Time from PR open to merge | < 1 hour | GitHub/ADO metrics | | CI pass rate on main | > 95% | Build monitoring | | Merge conflicts per sprint | < 3 | Team retro | | Deployment failures to production | 0 per month | Change success rate | 9. Common Pitfalls (and Fixes) for Salesforce Teams | Pitfall | Solution | |---------|----------| | "We need long branches because profiles are hard to merge" | Move profile overrides to Permission Sets or use sfdx-git-delta . | | "Our scratch orgs take 30 minutes to create" | Use pre-configured scratch orgs (snapshots) or increase CI parallelism. | | "We can't test all Apex in 10 minutes" | Split tests: critical path (fast) vs. full regression (slow). | | "Our UAT requires a stable environment" | Deploy main to a dedicated UAT sandbox daily, not per commit. | | "We have managed packages that require versioning" | Use CI to auto-increment package version on each merge to main . | 10. Sample .gitattributes for Salesforce TBD To reduce merge conflicts in metadata XML files:

1. What is Trunk-Based Development (TBD)? Trunk-Based Development is a source control strategy where developers merge all changes directly into a single shared branch (the "trunk" or main ) multiple times a day. Instead of long-lived feature branches, teams use short-lived feature branches (lasting less than a day) or commit directly to the trunk. salesforce trunk-based development

| Mechanism | Use Case | Example | |-----------|----------|---------| | (Hierarchy) | Per-user, per-org rollout | FeatureToggle__c.enableNewDashboard__c | | Custom Metadata Type | Bulk configuration | Feature_Flag__mdt queried in Apex | | Permission Set | Visibility gates | New Lightning page assigned only to test users | | Apex if statements | Code-level toggle | if(FeatureService.isEnabled('NEW_FLOW')) | ❌ Multiple active release branches (e

Count Inventory Faster

RFID is the fastest way to keep track of your assets and inventory. Our Wave Inventory System is everything you need to track thousands of assets easily.

Request A Quote
Request A Quote