copyright © 2015 solutionsiq inc. all rights reserved. branching for cd? think again ! devesh...

23
Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani

Upload: juliana-atkins

Post on 18-Jan-2018

223 views

Category:

Documents


0 download

DESCRIPTION

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 3

TRANSCRIPT

Page 1: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani

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

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

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

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

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

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

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

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

9Branching for CD? Think Again! – Devesh Chanchlani

Page 10: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani

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

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

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

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

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

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

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

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

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

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

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

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

22

Our Customers

Branching for CD? Think Again! – Devesh Chanchlani

Terri Sharp
Customer Logo Grid layout. These logos are locked on the slide master. Customize it: to use a different set of customer logos, use the Title Only or Blank layout and import the logos you need. Try to reduce them to all roughly the same size as shown here, and align the rows and columns for a neater appearance.
Page 23: Copyright © 2015 SolutionsIQ Inc. All rights reserved. Branching for CD? Think again ! Devesh Chanchlani

23

Thank you!solutionsiq.com

Branching for CD? Think Again! – Devesh Chanchlani

Terri Sharp
Customize it: Thank you slide can also be used to provide additional contact information.