This presentation is about the benefits of continuous delivery. It covers some techniques such as trunk-based development and branch by abstraction. This is intended to help developers to commit small and incremental changes to production on a daily basis.
2. Goal
Talk about how we can use continuous delivery to increase the team productivity and what kind of
software development practices we need to effectively do that.
3. Agenda
● What is continuous delivery?
● Why continuous delivery?
● Continuous delivery benefits
● Continuous delivery practices
● Trunk-based development
● Branch by abstraction
4. What is continuous delivery
“Continuous Delivery is the ability to get changes of all types—including
new features, configuration changes, bug fixes and experiments—into
production, or into the hands of users, safely and quickly in a sustainable
way.”
See: Continuous Delivery Site
5. Why continuous delivery?
“It is often assumed that if we want to deploy software more frequently, we must accept lower
levels of stability and reliability in our systems. In fact, peer-reviewed research shows that this
is not the case—high performance teams consistently deliver services faster and more reliably
than their low performing competition. This is true even in highly regulated domains such as
financial services and government. This capability provides an incredible competitive advantage
for organizations that are willing to invest the effort to pursue it.”
See: Continuous Delivery Site
6. Continuous delivery benefits
● Low risk releases (canary, blue green deployments)
● Faster time to market (incorporate integration and regression testing into their daily work)
● Higher quality (building a deployment pipeline)
● Lower costs (delivering incremental changes are cheaper)
● Better products (test ideas with users before building out whole features)
● Happier teams (releases are less painful)
See: Continuous Delivery Site
9. Trunk-based development
“A source-control branching model, where developers collaborate on code in a single branch called ‘trunk’ *, resist
any pressure to create other long-lived development branches by employing documented techniques. They
therefore avoid merge hell, do not break the build, and live happily ever after.”
“Trunk-Based Development is a key enabler of Continuous Integration and by extension Continuous Delivery.
When individuals on a team are committing their changes to the trunk multiple times a day it becomes easy to
satisfy the core requirement of Continuous Integration that all team members commit to trunk at least once every
24 hours. This ensures the codebase is always releasable on demand and helps to make Continuous Delivery a
reality.”
See: Trunk-based development site
11. Trunk-based development (conditions)
● Short lived feature branches (enable code reviews)
● Release branches
● Adopt branch by abstraction technique (also consider feature flags)
● Resistance of people used to other workflows
See: Trunk-based development site
12. Branch by abstraction
“Branch by Abstraction is a set-piece technique to effect a ‘longer to complete’ change in the
trunk. Say a developer (or a pair of developers), has a change that is going to take five days to
complete. There could easily be pressure to create a branch for this - somewhere that can be
unstable for a period of time before it completes (and gets merged back somewhere).”
See: Trunk-based development site
13. Branch by abstraction
● Introduce an abstraction around the code that is to be replaced, and commit that for all to see. If needed, this can
take multiple commits. None of those are allowed to break the build, and all of them could be pushed to the shared
repository in order, and as done.
● Write a second implementation of the abstraction for the to-be-introduced code, and commit that, but maybe as
‘turned off’ within the trunk so that other developers are not depending on it yet. If needed, this can take multiple
commits as above. The abstraction from #1 may also be occasionally tweaked, but must follow the same rule - do not
break the build.
● Flip the software ‘off’ switch to ‘on’ for the rest of the team, and commit/push that.
● Remove the to-be-replaced implementation
● Remove the abstraction
See: Trunk-based development site
16. Summary
● Continuous delivery is a set of practices to improve productivity
● Trunk-based development is an enabler for Continuous Integration (CI) and by extension
Continuous Delivery (CD)
● Branch by abstraction is a technique to help developers to break down big changes into
small pieces and merge them into the trunk without breaking the build
17. References
● Continuous delivery site
● Trunk-based development site
● Accelerate Book
● Continuous Delivery Book
● Working with Legacy Code Book