Trunk-based development

Trunk-based development represents a version control management approach wherein developers continuously merge small, frequent updates directly into a core "trunk" or main branch.

I see our team evolving towards a Trunk-Based Development approach, where we prioritize continuous integration and delivery, ensuring that small, frequent updates are seamlessly merged into our main branch. By adopting this approach, we can accelerate our release cycles, minimize delays, and enhance collaboration among team members.

Furthermore, I envision our team as thought leaders in the tech community, actively contributing to open-source projects, attending industry conferences, and staying abreast of emerging trends. Through continuous learning and skill development, we will remain at the forefront of innovation, driving the success of our organization and making a positive impact on the software development industry as a whole.

Gitflow vs Trunk-Based

In Gitflow, multiple long-lived branches exist, and changes are not merged into the master branch until a feature is considered complete, often waiting for other features to finish development as well. Typically, Gitflow involves branches like develop and hotfix, but our team currently maintains only the develop branch.

On the other hand, Trunk-Based development focuses on using the trunk or master branch as the main source for branching off all features, hotfixes, and improvements. This ensures that each feature is always branched off from the master, without waiting for other features to complete development before release. If there are no conflicts with the master, it's considered safe and ready for deployment to production.

Applying Trunk-Based

To align with our team's new goal of delivering features, bug fixes, and improvements to users as quickly as possible, we need to implement the following practices:

  • Whenever a new feature or task is started, branch off from the master to ensure the latest updates and to facilitate easier merging back into the master with minimal conflicts.

  • Proactively select features with shorter development times, breaking tasks into smaller, more manageable chunks for quicker delivery to increase customer value.

  • Once a feature is completed, move on to the next feature by creating a new branch. Avoid adding new features to a completed branch to prevent delays when preparing a feature for release.

  • Follow a naming convention for branches, such as type/name. For example, use feature for new features, hotfix for urgent fixes, bugfix for non-urgent issues, and improve for experience enhancements.

The ultimate goal of Trunk-Based development is to achieve Continuous Delivery and Continuous Deployment, where updates to the product occur automatically and continuously. While we may still have a long way to go to reach this level, our immediate focus should be on delivering new value to users as quickly as possible. Additionally, we should strive to establish a robust CI/CD system in the future, although it may not be fully automated initially, to ensure efficient and timely software delivery.

Reference: https://www.atlassian.com/continuous-delivery/continuous-integration/trunk-based-development

Last updated

Was this helpful?