copyright © 2015 solutionsiq inc. all rights reserved. branching for cd? think again ! devesh...
Post on 18-Jan-2018
223 Views
Preview:
DESCRIPTION
TRANSCRIPT
Copyright © 2015 SolutionsIQ Inc. All rights reserved.
Branching for CD?Think again !Devesh Chanchlani
Self Introduction
• Passionate Programmer
• Technical Agile Coach with SolutionsIQ
• Coach teams to embrace, scale and sustain XP practices
• Belong to Pune
Branching for CD? Think Again! – Devesh Chanchlani 2
Branching for CD? Think Again! – Devesh Chanchlani 3
Project Background
Worked as an Technical Coach with a global e-payments company.
Multiple feature teams, contributing simultaneously in a release.
Each release would support numerous regions/countries.
Features would need to maintain compatibility across many vendor solutions.
Made a released once an year
And now we decided to go LEAN and deliver continuously …
Branching for CD? Think Again! – Devesh Chanchlani 4
When we started making FREQUENT releases …
Branching for CD? Think Again! – Devesh Chanchlani 5
Mainline
Feature 1
Feature 2 Feature 3
Feature 4
Rn Rn+1 Rn+2
When we started making Frequent Releases
Branching for CD? Think Again! – Devesh Chanchlani 6
Then we decided to deliver features INCREMENTALLY …
7Branching for CD? Think Again! – Devesh Chanchlani
R1Code-freeze R1 R2Code-freeze R2
Development for R2 (12 weeks)
Stabilizing R1 (4 weeks)
Integration
Feature 1
Feature 2
Feature 3
Feature 4
Stabilizing R2
8
Challenges observed
Merge-hells on integration branch before code-freeze (Processing)
Release stabilization phase being a drag (Inventory, Waiting)
Merges and stabilization leading to several code-hacks (Defects)
Merge-hells on feature branches after each release (Processing)
Even 100% automation won’t solve our problem
Branching for CD? Think Again! – Devesh Chanchlani
9Branching for CD? Think Again! – Devesh Chanchlani
10
On Retrospection …
Code-reuse & Refactoring becoming difficult
No real Continuous Integration happening
Isolated Feature teams
11
“Feature branching is a poor man's modular architecture, instead of building systems with the ability to easy swap in and out features at runtime / deploytime they couple themselves to the source control providing this mechanism through manual merging.” Dan Bodart
Branching for CD? Think Again! – Devesh Chanchlani
Branching for CD? Think Again! – Devesh Chanchlani 12
Trunk Based Development (TBD)
13
What it means …
All developers commit to a single branch, called trunk, making frequent check-ins.
Branches are created only for Release purpose.
Regular developers don’t commit to a release branch.
Release branches are never merged back to trunk.
Release branches are short-lived, frequently being replaced by other release branches.
Branching for CD? Think Again! – Devesh Chanchlani
14
Exploring Trunk Based Development
Branching for CD? Think Again! – Devesh Chanchlani
15
Our BIGGEST Problem - Imagine you are releasing into production every two weeks, but need to build a feature that's going to take three months to complete.
Branching for CD? Think Again! – Devesh Chanchlani
16
Feature Toggles
Courtesy: Spotify Labs / Henrik Kniberg
Branching for CD? Think Again! – Devesh Chanchlani
17
Feature Toggle implies …
A configuration file defined a bunch of toggles for various pending features.
These toggles were mostly applied at UIs, from where interaction with the features began.
For features with no UI, the toggle would be in the app code. using techniques like polymorphic substitution and dependency injection
Feature toggles were removed once the feature was complete.
Pipelines for different permutations of toggles for releases were setup. If either of the build failed, it implied a bad commit.
Branching for CD? Think Again! – Devesh Chanchlani
18
Feature Toggle types
1. Release – partial features, temporary
2. Business – certain class of users/regions, permanent (already existed)
3. Runtime – easier rollbacks, run tests with various configurations of features
4. Build – new feature codebase is not compiled
Branching for CD? Think Again! – Devesh Chanchlani
19
Another Problem - Phasing out old implementations
Branching for CD? Think Again! – Devesh Chanchlani
20
Branch by Abstraction
Consumer
Component to be replaced
STEP 1
Consumer
Component to be replaced
Abstraction Layer
STEP 2
Consumer
Old Component
Abstraction Layer
New Component
STEP 3
Consumer
Old Component
Abstraction Layer
New Component
STEP 4
Branching for CD? Think Again! – Devesh Chanchlani
21
References
Paul Hammant - http://paulhammant.com
Martin Fowler - http://martinfowler.com/bliki/FeatureToggle.html
Carlos Lopes - Multiple projects, different goals, one thing in common: the codebase!
Henrik Kniberg – Engineering at Spotify
Chuck Rossi – The Facebook Release Process
Thanks to www.bitstrips.com for comic characters
Branching for CD? Think Again! – Devesh Chanchlani
22
Our Customers
Branching for CD? Think Again! – Devesh Chanchlani
23
Thank you!solutionsiq.com
Branching for CD? Think Again! – Devesh Chanchlani
top related