There are several approaches to managing branches in Salesforce development. Broadly, these can be categorized into Org-based branching and other branching strategies.
Org-based branching is relatively uncommon outside the Salesforce ecosystem. While it allows tracking the state of multiple sandboxes in a pipeline, it comes with significant drawbacks. These include the need to create pull requests against multiple branches, challenges in keeping branches synchronized with their respective orgs, and difficulties in maintaining long-term branch consistency.
With Hutte, you have the flexibility to choose any branching strategy, as it supports the creation of feature branches from any branch. However, we strongly recommend trunk-based development for release deployments. Trunk-based development is widely regarded as a best practice in modern development lifecycles, as it promotes continuous integration, reduces merge conflicts, and simplifies release management.
One challenge of understanding trunk-based development is that a branch isn’t tied to a specific Salesforce org. In this approach, the content of the trunk branch (usually main
) is deployed to different orgs (e.g., SIT, UAT, or Production) based on specific events, like a Pull Request merge or a manual action (e.g., running a script to deploy metadata from the branch to Production).
This method simplifies development by requiring only one branch to manage and provides great flexibility in defining how the deployment pipeline operates. However, it introduces complexity in tracking which changes (metadata) are deployed to which org, since the main
branch is not linked to a single Salesforce org.
Hutte addresses this challenge by offering clear visibility into which release is installed in each org. This transparency ensures you always know where each feature is in the pipeline, making it easier to track deployments and manage features effectively.
Key Benefits of Hutte Release Module:
See Release Management (Deployments) for more information.
Aspect | Org-Based Branching | Trunk-Based Development |
---|---|---|
Branching Structure | Multiple branches mapped to specific orgs. | Single trunk branch with short-lived feature branches. |
Complexity | High: Requires managing multiple branches and their sync with orgs. | Low: Centralized trunk simplifies branch management. |
Merge Conflicts | Frequent: Increased risk due to parallel branches. | Minimal: Continuous integration reduces conflicts. |
Pull Requests | Often require PRs against multiple branches/orgs. | Single PR against the trunk branch. |
Release Visibility | Hard to track: Orgs may become out of sync with branches. | Easy: Centralized tracking of all features in the trunk. |
Testing | Performed per org, often late in the pipeline. | Continuous integration allows early testing (e.g., during sprints). |
Production Deployment | Complex: Requires syncing multiple branches and managing merges. | Simplified: Approved features are deployed from the trunk. |
Hotfix Management | Challenging: Must sync fixes across multiple branches and orgs. | Easy: Hotfixes are merged into the trunk and included in the next release. |