SlideShare a Scribd company logo
1 of 34
Download to read offline
百倍速交付
~ 談Trunk-Based Development
Bryan Liu 劉栢峰 2017
Some Definitions
Long-Lived (Feature) Branch
• Creates lots of overhead
Git Flow
GitHub Flow
Short-Lived Feature Branch
• Branch’s length of life: less than 2 days
• Shared for code-review and CI only
• Easily becomes long-lived branch
https://trunkbaseddevelopment.com/short-lived-feature-branches/
Trunk-Based Development (TBD)
• Commit in trunk at least once a day
• Trunk is always in a releasable state
• Hide unfinished code with feature toggle
• Refactor with branch by abstraction
http://www.alwaysagileconsulting.com/articles/organisation-pattern-trunk-based-development/
Facts
Always the bridesmaid* from Paul Hammant
TBD
Only search few of these kings…
Also other TBD giants, ex: Google, Netflix
were not included in this startups research.
Never mind become A Category King
2000 ~ 2015 yr
600k companies
34 of them
76 % market cap
Winner-takes-all
Category King
‘‘Somewhere in the middle of this two-month process you’re going to run
across a bridge and burn it behind you.’’
‘‘LinkedIn’s big switch to continuous deployment has been linked to very
concrete and visible financial success…’’
~ Kevin Scott, the senior VP of engineering
http://www.wired.com/2013/04/linkedin-software-revolution/
https://paulhammant.com/2013/03/13/facebook-tbd-take-2/
Facebook’s
Trunk-Based Development
branching models
v.s.
release frequency
TBD & Feature Toggle
if ( ToggleManager.isEnabled(“FastCheckout”, user) ) {
useFastCheckout()
} else {
useOriginCheckout()
}
https://martinfowler.com/articles/feature-toggles.html
What’s Toggle
Business Toggle:
• A/B Testing
Low Risk Release and Zero-Downtime
• Canary Release, Dark Launch, Blue-Green deployment
• DB/Schema Migration
Decouple Feature Rollout from Code Deployment
• Re-planning
• Microservices
Some Toggle Use Cases
Canary Release / Blue-Green Deployment & A / B Testing
http://featureflags.io/
• Phased rollout
• Monitor performance
• Check user feedback
• Features in live but NOT visible to user
• Warm up cache, load DB tables with real
production traffic
• Soak test, verify performance
Dark Launch
DB / Schema Change
• Forwards & backwards compatible
• Stage roll-out with verification online
• No downtime needed
Q:
What are the requirements
to achieve previous scenarios ?
A:
• Feature toggles &
• Old and new code co-exists in the same delivery
“Get good with build-flags and
toggles” ~ Paul Hammant
“ This is also the major difference
between short-lived branch and TBD!”
Inefficiencies ...
Decouple Release from Code Deployment
• TBD reduce merge pain
• Merge hell is error prone and risky
• Inefficiency on spending time in bug fix - merge - test cycle.
As in Microservices:
Any attempt trying to set release pace is not realistic!!
Feature flags
+ Microservices
= True decoupling
Re-planning
• It happens
• Leads to weeks of un-merge for teams
Image from: https://devops.paulhammant.com/
Inefficiencies in SW development:
• It slows down throughput
• Can’t keep talent
Spotify Release Train
https://labs.spotify.com/2014/03/27/spotify-engineering-culture-part-1/
Frequently commits to mainline:
• More communication with your team
• More frequent builds and tests (CI)
• More frequent deployment (CD)
• More experiments and faster feedback
Implementation
Pre-Commit Testing & Code Review
• Pre-commit (CI) test (option but best)
• Continuous (code) review
• Code ownership
Figure from https://trunkbaseddevelopment.com/continuous-integration/
Why Continuous Review (Large Diffs Hurts)
• Large diffs won’t get reviewed
• Reverting large diffs is hard
• Rebasing/merging large diffs is error-prone
Code review statistics: http://blogs.atlassian.com/2011/07/creating_optimal_reviews/
Pull Request Code Review
git commit -m "fixed issue with fan"
https://zachholman.com/posts/deploying-software
Code Review Page
• Code statistics
• CI test results
• Review discussion &
comments
Hello, about me …
DevOps Evangelist
QA Architect
Bryan Liu 劉栢峰
• trunkbaseddevelopment.com

• trunk-based development, Paul Hammant

• Facebook's Trunk-Based Development, Paul Hammant

• Branch by Abstraction, Martin Fowler

• Feature Toggles, martinfowler.com

• Category King, J. Van Grove and Play Bigger

• The Death of Continuous Integration, Steve Smith

• And many links inside each slide deck ~
Reference

More Related Content

What's hot

Introduction to Gitlab
Introduction to GitlabIntroduction to Gitlab
Introduction to Gitlab
Julien Pivotto
 
The Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps ToolkitThe Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps Toolkit
Weaveworks
 

What's hot (20)

Git Branching Model
Git Branching ModelGit Branching Model
Git Branching Model
 
Git Branching Model
Git Branching ModelGit Branching Model
Git Branching Model
 
Git workflows presentation
Git workflows presentationGit workflows presentation
Git workflows presentation
 
Git flow
Git flowGit flow
Git flow
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Introduction to Gitlab
Introduction to GitlabIntroduction to Gitlab
Introduction to Gitlab
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
Learning git
Learning gitLearning git
Learning git
 
Gitops Hands On
Gitops Hands OnGitops Hands On
Gitops Hands On
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Devops Porto - CI/CD at Gitlab
Devops Porto - CI/CD at GitlabDevops Porto - CI/CD at Gitlab
Devops Porto - CI/CD at Gitlab
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 
Getting Git
Getting GitGetting Git
Getting Git
 
A Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching StrategyA Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching Strategy
 
GitLab.pptx
GitLab.pptxGitLab.pptx
GitLab.pptx
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
 
The Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps ToolkitThe Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps Toolkit
 

Similar to Trunk-Based Development

Similar to Trunk-Based Development (20)

Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?
 
Git Branching – the battle of the ages
Git Branching – the battle of the agesGit Branching – the battle of the ages
Git Branching – the battle of the ages
 
Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...
Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...
Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...
 
Software Versioining: A Time Travel Problem in Software Engineering
Software Versioining: A Time Travel Problem in Software EngineeringSoftware Versioining: A Time Travel Problem in Software Engineering
Software Versioining: A Time Travel Problem in Software Engineering
 
Implementing Continuous Product Delivery
Implementing Continuous Product DeliveryImplementing Continuous Product Delivery
Implementing Continuous Product Delivery
 
A Business Case for Git - Tim Pettersen
A Business Case for Git - Tim PettersenA Business Case for Git - Tim Pettersen
A Business Case for Git - Tim Pettersen
 
Short Introduction of software engineering for bioinformatics
Short Introduction of software engineering for bioinformatics Short Introduction of software engineering for bioinformatics
Short Introduction of software engineering for bioinformatics
 
Code review vs pull request
Code review vs pull requestCode review vs pull request
Code review vs pull request
 
Working with Git
Working with GitWorking with Git
Working with Git
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
 
Simplified CI/CD Flows for Salesforce via SFDX - Downunder Dreamin - Sydney
Simplified CI/CD Flows for Salesforce via SFDX - Downunder Dreamin - SydneySimplified CI/CD Flows for Salesforce via SFDX - Downunder Dreamin - Sydney
Simplified CI/CD Flows for Salesforce via SFDX - Downunder Dreamin - Sydney
 
Unit Testing in JavaScript
Unit Testing in JavaScriptUnit Testing in JavaScript
Unit Testing in JavaScript
 
Software Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuableSoftware Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuable
 
Why I Love TorqueBox (And Why You Will Too)
Why I Love TorqueBox (And Why You Will Too)Why I Love TorqueBox (And Why You Will Too)
Why I Love TorqueBox (And Why You Will Too)
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and Consistently
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and Consistently
 
Make It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version ControlMake It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version Control
 
Why real integration developers ride Camels
Why real integration developers ride CamelsWhy real integration developers ride Camels
Why real integration developers ride Camels
 
The Pivotal Engineering Dojo: Earning Your Black Belt in Cloud Foundry Engine...
The Pivotal Engineering Dojo: Earning Your Black Belt in Cloud Foundry Engine...The Pivotal Engineering Dojo: Earning Your Black Belt in Cloud Foundry Engine...
The Pivotal Engineering Dojo: Earning Your Black Belt in Cloud Foundry Engine...
 
Salesforce CI (Continuous Integration) - SFDX + Bitbucket Pipelines
Salesforce CI (Continuous Integration) - SFDX + Bitbucket PipelinesSalesforce CI (Continuous Integration) - SFDX + Bitbucket Pipelines
Salesforce CI (Continuous Integration) - SFDX + Bitbucket Pipelines
 

Recently uploaded

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Recently uploaded (20)

VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

Trunk-Based Development