1. 23-05-2018
1
Trunk Based Development
Ritabrata Moitra
2
Continuous Integration
● Development practice that requires
developers to integrate code into a shared
repository several times a day
● Each check-in is then verified with an
automated build
● Detect problems early
What and Why?
5. 23-05-2018
5
9
● Developers push code ( of all
possible features that are in
development ) on to a single
remote branch, referred to as the
trunk
● No merge hells
● Faster feedback
● No “It works on my machine”
● Always release ready
Trunk Based Development
Only way to achieve CI
10
● Small commits, frequent commits
● Faster time to production ( optimise
builds, tests, whatever it takes )
● Team’s mindset and commitment
to maintain “every commit as
production-ready”.
● NEVER intentionally commit a
change that we know doesn’t work
Benefits
6. 23-05-2018
6
11
AAQ’s
❖ How do you build something
complex in a small commit?
➢ You don’t.
❖ Bug fixes?
➢ Why should they be
different?
❖ Code Reviews ?
➢ Aha! Pair!
❖ Only works for small teams?
➢ Google does TBD with 25000
devs developing on a single
trunk. (Source: Rachel Potvin, Engineering
Manager, Google)
ALWAYS asked questions
12
❖ But we have short lived branches!
➢ What do you mean by short
lived?
➢ More than a day? Not short!
➢ Less than a day? Why bother?
❖ What about new unfinished
features? How do we push them ?
AAQ’s
ALWAYS asked questions