Trunk Based Development

@jezeniel

What is Trunk Based Development?

It is a source control branching model, similar to Gitflow.

The main difference with Gitflow is we only have a single main branch which is the trunk/master.

What is the problem with Gitflow?

  • Complexity of maintaining multiple branches, master, development, release
  • Gives engineers false sense of safety. Instead of everybody cares about production builds and releases, only a select few does
  • Releasing to production takes longer, especially if development is far from master

Advantage of  Trunk Based Development

  • Simple management, we only have 1 main branch
  • Enables Continuous Delivery, which enables quick deployment to both staging and production
  • All engineers are responsible in maintaining and making sure the build doesn't break
  • Forces as to do good habits like unit-tests and code reviews

Workflow changes

  • The trunk/master branch should always be production ready
  • Strict implementation of unit-tests and code reviews
  • Short-lived branches for features
  • Feature flags
  • Take advantage of our CI (gitlab runners)
  • Full commitment of the team to always ensure the build doesn't fail and doesn't push breaking code to master

Trunk Based Development

By Jezeniel Zapanta

Trunk Based Development

  • 245