![Page 1: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/1.jpg)
Copyright © 2015 SolutionsIQ Inc. All rights reserved.
Branching for CD?Think again !Devesh Chanchlani
![Page 2: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/2.jpg)
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
![Page 3: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/3.jpg)
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 …
![Page 4: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/4.jpg)
Branching for CD? Think Again! – Devesh Chanchlani 4
When we started making FREQUENT releases …
![Page 5: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/5.jpg)
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
![Page 6: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/6.jpg)
Branching for CD? Think Again! – Devesh Chanchlani 6
Then we decided to deliver features INCREMENTALLY …
![Page 7: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/7.jpg)
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
![Page 8: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/8.jpg)
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
![Page 9: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/9.jpg)
9Branching for CD? Think Again! – Devesh Chanchlani
![Page 10: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/10.jpg)
10
On Retrospection …
Code-reuse & Refactoring becoming difficult
No real Continuous Integration happening
Isolated Feature teams
![Page 11: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/11.jpg)
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
![Page 12: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/12.jpg)
Branching for CD? Think Again! – Devesh Chanchlani 12
Trunk Based Development (TBD)
![Page 13: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/13.jpg)
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
![Page 14: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/14.jpg)
14
Exploring Trunk Based Development
Branching for CD? Think Again! – Devesh Chanchlani
![Page 15: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/15.jpg)
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
![Page 16: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/16.jpg)
16
Feature Toggles
Courtesy: Spotify Labs / Henrik Kniberg
Branching for CD? Think Again! – Devesh Chanchlani
![Page 17: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/17.jpg)
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
![Page 18: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/18.jpg)
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
![Page 19: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/19.jpg)
19
Another Problem - Phasing out old implementations
Branching for CD? Think Again! – Devesh Chanchlani
![Page 20: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/20.jpg)
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
![Page 21: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/21.jpg)
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
![Page 22: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/22.jpg)
22
Our Customers
Branching for CD? Think Again! – Devesh Chanchlani
![Page 23: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani](https://reader035.vdocuments.us/reader035/viewer/2022062306/5a4d1b217f8b9ab059995807/html5/thumbnails/23.jpg)
23
Thank you!solutionsiq.com
Branching for CD? Think Again! – Devesh Chanchlani