xp conf-tbd
TRANSCRIPT
![Page 1: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/1.jpg)
Copyright © 2015 SolutionsIQ Inc. All rights reserved.
Branching for CD?Think again !Devesh Chanchlani
![Page 2: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/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
![Page 3: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/3.jpg)
3
Traditional Branching Strategies
![Page 4: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/4.jpg)
4
Long Lived Feature Branches
Less risk of non-finished changes
» Merging with other Feature branches
» Merging with mainline changes
» Accommodating Refactorings and design improvements
![Page 5: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/5.jpg)
5
Changes being made to the mainline after being reviewed
» Merging issues» Refactoring becomes
challenging» Cannot have CI for each
branch» Sometimes changes are big &
individual commits not stable, that folks simply squash their changes into big commits.
Short Lived Feature Branches
D1D2
D3 D4
![Page 6: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/6.jpg)
6
Another Curious Case
![Page 7: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/7.jpg)
<Footer Content: Presentation Title, Partner Name, Other> 7
![Page 8: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/8.jpg)
8
“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
![Page 9: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/9.jpg)
<Footer Content: Presentation Title, Partner Name, Other> 9
Trunk Based Development (TBD)
![Page 10: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/10.jpg)
10
What it means …
All developers commit to a single branch, called trunk, making frequent check-ins.
Branches are created only for Release purpose.
Bugs are always fixed on trunk and then merged with release branch.
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.
![Page 11: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/11.jpg)
11
Trunk Based Development Strategies
![Page 12: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/12.jpg)
12
Imagine you are releasing into production every two weeks, but need to build a feature that's going to take three months to complete. How do you use Continuous Integration to keep everyone working on the mainline without revealing a half-implemented feature on your releases?
![Page 13: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/13.jpg)
13
Feature Toggles
Courtesy: Spotify Labs / Henrik Kniberg
![Page 14: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/14.jpg)
14
Feature Toggle implies …
A configuration file defines a bunch of toggles for various pending features.
These toggles are mostly applied at UIs, from where interaction with the features begins.
For features with no UI, the toggle will be in the app code. In such cases, techniques like polymorphic substitution and dependency injection
should be used to avoid crude conditional tests.
Feature toggles should be removed once the feature is complete.
Pipelines for different permutations of toggles for releases should be setup. If either of the build fails, it implies a bad commit.
![Page 15: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/15.jpg)
15
Feature Toggle types
1. Release – partial features, temporary
2. Business – certain class of users, permanent
3. Runtime – easier rollbacks, run tests with various configurations of features
4. Build – new feature codebase is not compiled
![Page 16: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/16.jpg)
16
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
![Page 17: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/17.jpg)
17
TBD Success Stories
![Page 18: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/18.jpg)
18
Facebook's Trunk Based Development
![Page 19: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/19.jpg)
19
Google’s Scaled TBD
![Page 20: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/20.jpg)
20
Google’s Scaled TBD
Deals with enormous codebase which changes at enormous speeds.
Provides extensive tooling to the developers like Pre-commit validations
formal integration/merge/commit itself
have a “Distributed Builds” capability, which Supports “Caches” for leveraging results from previously built modules
Uses “Gerrit“ for code reviews on refs/for/master branch.
Has decided owners for all modules.
Third party dependencies can have only one existing version in the trunk.
Releases are made from branches cut from the trunk
![Page 21: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/21.jpg)
21
Google’s Scaled TBD
Master
Canary
Beta
Dev
Stable
![Page 22: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/22.jpg)
22
What it takes to Deliver Continuously
![Page 23: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/23.jpg)
23
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
![Page 24: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/24.jpg)
24
Our Customers
![Page 25: Xp conf-tbd](https://reader036.vdocuments.us/reader036/viewer/2022062316/588220ca1a28ab3f4c8b7b63/html5/thumbnails/25.jpg)
25
Thank you!solutionsiq.com