Share
Embed
Journey of Feature Flag development in LINE Android
Hidetsugu Tamaki
LINE App Dev Team3 Software Engineer
https://linedevday.linecorp.com/jp/2019/sessions/D2-4
LINE DevDay 2019
November 21, 2019
Transcript
98 slides
-
2019 DevDay Journey of Feature Flag Development in LINE Android
> Hidetsugu Tamaki > LINE App Dev Team3 Software Engineer -
Agenda > Pain Points of Feature Branches > Benefits of
Feature Flags > History of Feature Flags in LINE Android -
Agenda > Pain Points of Feature Branches > Benefits of
Feature Flags > History of Feature Flags in LINE Android -
Agenda > Pain Points of Feature Branches > Benefits of
Feature Flags > History of Feature Flag in LINE Android -
Feature Flag Usage > Activity I B CG CG )
G E )B = .( . ((. L CG CG G F . = C G I GK B FF I BF L CG CG G F B: = C G I GK B FF I > View visibility FG A E GG C F F B ) G E )B = )( ( ,( -
Feature Flags Achieve > Conflict minimization > Smoother release schedule
management > Instant toggling > Better collaboration with stakeholders -
Feature Flags Achieve > Conflict minimization > Smoother release schedule
management > Instant toggling > Better collaboration with stakeholders -
Conflict Minimization Main branch Sticker feature PRs Theme feature PRs
Saved PRs Saved PRs -
Conflict Minimization Main branch Sticker feature PRs Theme feature PRs
Conflict Saved PRs Saved PRs -
Feature Flags Achieve > Conflict minimization > Smoother release schedule
management > Instant toggling > Better collaboration with stakeholders -
Feature Flags Achieve > Conflict minimization > Smoother release schedule
management > Instant toggling > Better collaboration with stakeholders -
Smoother Release Schedule Management Main branch Release branches 1.0 2.0
Sticker feature PRs -
Feature Flags Achieve > Conflict minimization > Smoother release schedule
management > Instant toggling > Better collaboration with stakeholders -
Feature Flags Achieve > Conflict minimization > Smoother release schedule
management > Instant toggling > Better collaboration with stakeholders -
✗ Instant Toggling Main branch Release branch 1.0 Critical issue
Sticker feature PR -
Instant Toggling Main branch Release branch 1.0 Critical issue Sticker
feature PR Conflicting PR ✗ -
✗ Instant Toggling Main branch Release branch 1.0 Critical issue
Conflicting PR Sticker feature PR -
Feature Flags Achieve > Conflict minimization > Smoother release schedule
management > Instant toggling > Better collaboration with stakeholders -
Feature Flags Achieve > Conflict minimization > Smoother release schedule
management > Instant toggling > Better collaboration with stakeholders -
Feature Flags Achieve > Conflict minimization > Smoother release schedule
management > Instant toggling > Better collaboration with stakeholders -
Feature Flags Achieve > Conflict minimization > Smoother release schedule
management > Instant toggling > Better collaboration with stakeholders -
Limitation of Feature Flags Not a “silver bullet” > Difficult
to apply > Updating libraries > Overkill > Prototyping -
Agenda > Pain Points of Feature Branches > Benefits of
Feature Flags > History of Feature Flags in LINE Android -
Feature Flags in LINE Android > Started with a simple
Gradle script (Dec. 2015) > Injects values into BuildConfig file > Loads values from a property file -
Feature Flags in LINE Android > Started with a simple
Gradle script (Dec. 2015) > Injects values into BuildConfig file A A A C= # . " A A A C= # " #. > Loads values from a property file -
Feature Flags in LINE Android > Started with a simple
Gradle script (Dec. 2015) > Injects values into BuildConfig file > Loads values from a property file -
> Toggle flag by user name or app version >
Toggle flag at runtime > Support Gradle submodule Growth of Feature Flags -
> Toggle flag by user name or app version >
Toggle flag at runtime > Support Gradle submodule Growth of Feature Flags -
Module Structure of LINE Android line-android-app submodule-sticker Product Flavor Product
Flavor dev, beta, rc, release debug, release -
Initial Feature Flags Implementation line-android-app FeatureFlag script Flag Property File
Product Flavor Refers to Product Flavor submodule-sticker -
Initial Feature Flags Implementation line-android-app FeatureFlag script Flag Property File
Product Flavor BuildConfig.java Injects values into Product Flavor submodule-sticker Refers to -
Misused Feature Flags in Submodules line-android-app FeatureFlag script Flag Property
File Product Flavor BuildConfig.java FeatureFlag script Product Flavor BuildConfig.java submodule-sticker Refers to Injects values into Refers to Injects values into -
Misused Feature Flags in Submodules line-android-app FeatureFlag script Flag Property
File Product Flavor BuildConfig.java FeatureFlag script Product Flavor BuildConfig.java submodule-sticker Back reference Refers to Injects values into Refers to Injects values into -
Misused Feature Flags in Submodules line-android-app FeatureFlag script Flag Property
File Product Flavor BuildConfig.java FeatureFlag script Product Flavor BuildConfig.java dev, beta, rc, release debug, release submodule-sticker Back reference Refers to Injects values into Refers to Injects values into -
Misused Feature Flags in Submodules line-android-app FeatureFlag script Flag Property
File Product Flavor BuildConfig.java FeatureFlag script Product Flavor BuildConfig.java dev, beta, rc, release debug, release submodule-sticker Back reference Refers to Injects values into Refers to Injects values into -
Misused Feature Flags in Submodules line-android-app FeatureFlag script Flag Property
File Product Flavor BuildConfig.java FeatureFlag script Product Flavor BuildConfig.java package com.linecorp.line package com.linecorp.sticker dev, beta, rc, release debug, release submodule-sticker Back reference Refers to Injects values into Refers to Injects values into -
Problems of Misuse > Caused by BuildConfig.java and product flavors
> Generated wrong values > Caused by back reference > Submodules were no longer standalone -
Problems of Misuse > Caused by BuildConfig.java and product flavors
> Generated wrong values > Caused by back reference > Submodules were no longer standalone -
Workaround for Wrong Flag Values Simplified references by extracting Feature
Flags into a module -
Workaround for Wrong Flag Values line-android-app FeatureFlag script Flag Property
File Product Flavor BuildConfig.java FeatureFlag script Product Flavor BuildConfig.java submodule-sticker Back reference Refers to Injects values into Refers to Injects values into -
Workaround for Wrong Flag Values line-android-app FeatureFlag script Flag Property
File Product Flavor BuildConfig.java FeatureFlag script feature-flag BuildConfig.java Refers to submodule-sticker Refers to Injects values into Injects values into -
Workaround for Wrong Flag Values BuildConfig.java BuildConfig.java Injects values into
Injects values into package com.linecorp.line package com.linecorp.sticker -
Workaround for Wrong Flag Values FeatureFlag.java FeatureFlag.java Creates Creates package
com.linecorp.line package com.linecorp.line -
Workaround for Wrong Flag Values line-android-app FeatureFlag script Flag Property
File Product Flavor FeatureFlag.java FeatureFlag script feature-flag FeatureFlag.java Refers to submodule-sticker Refers to Creates Creates -
Workaround for Wrong Flag Values line-android-app FeatureFlag
script Flag Property File Product Flavor FeatureFlag.java FeatureFlag script feature-flag FeatureFlag.java Refers to submodule-sticker Refers to Creates Creates -
Workaround for Wrong Flag Values line-android-app FeatureFlag script Flag Property
File Product Flavor FeatureFlag.java submodule-sticker Refers to Creates -
Things Got Worse > Tricky usage of `
> Wrong dependencies still remain > Poor compatibility with automated testing -
Things Got Worse > Tricky usage of `
> Wrong dependencies still remain > Poor compatibility with automated testing -
Things Got Worse > Tricky usage of `
> Wrong dependencies still remain > Poor compatibility with automated testing -
Things Got Worse > Tricky usage of `
> Wrong dependencies still remain > Poor compatibility with automated testing -
Things Got Worse > Tricky usage of `
> Wrong dependencies still remain > Poor compatibility with automated testing -
Proper Solution line-android-app FeatureFlag script Flag Property File Product Flavor
FeatureFlag.java submodule-sticker Refers to Creates -
Proper Solution line-android-app FeatureFlag script Flag Property File Product Flavor
FeatureFlag.java submodule-sticker Refers to FeatureFlag script Flag Property File Product Flavor FeatureFlag.java Refers to Creates Creates -
Proper Solution line-android-app FeatureFlag script Flag Property File Product Flavor
FeatureFlag.java submodule-sticker Refers to FeatureFlag script Flag Property File Product Flavor FeatureFlag.java Refers to Links to Creates Creates -
Proper Solution line-android-app FeatureFlag script Flag Property File Product Flavor
FeatureFlag.java submodule-sticker Refers to FeatureFlag script Flag Property File Product Flavor FeatureFlag.java Refers to Links to Refers to Creates Creates -
Link to Submodule Flag Values &, - B = B
A: &, - &, - line-android-app submodule-sticker -
)& ) ,) () CC )-)& ) = A: )&
) ,) -& ) Property Parsing: Format )& ) ,) () )-)& ) = A: )& ) ,) -& ) > Written with “disjunctive normal form” style property -
Property Parsing: Phase > Enabled if build variant is
Phase Phase > Enabled if build variant is -
Property Parsing: Value Calculation : E variant )( ( &
( ( ( ( ( CE A E : CD= : )( ( & ( - ( )( ( & ( D E: C: CE A E : CD= : )( ( & ( - ( F )( ( & ( D E: Optimization Phase resolution -
Property Parsing: Value Calculation : E variant )( ( &
( ( ( ( ( CE A E : CD= : )( ( & ( - ( )( ( & ( D E: C: CE A E : CD= : )( ( & ( - ( F )( ( & ( D E: Optimization Phase resolution -
Property Parsing: Value Calculation : E variant )( ( &
( ( ( ( ( CE A E : CD= : )( ( & ( - ( )( ( & ( D E: C: CE A E : CD= : )( ( & ( - ( F )( ( & ( D E: Optimization Phase resolution -
Property Parsing: Value Calculation : E variant )( ( &
( ( ( ( ( CE A E : CD= : )( ( & ( - ( )( ( & ( D E: C: CE A E : CD= : )( ( & ( - ( F )( ( & ( D E: Optimization Phase resolution -
Property Parsing: Value Calculation )& ) ) () )-)& )
F AC: F E )& ) ) .-& ) )& ) ) F E F AC: F E )& ) ) .-& ) )& ) ) F AC: F E )& ) ) Optimization Variant resolution E F variant Package name extraction I )& ) ) CA CED F E E = )& ) ) -
Property Parsing: Value Calculation )& ) ) () )-)& )
F AC: F E )& ) ) .-& ) )& ) ) F E F AC: F E )& ) ) .-& ) )& ) ) F AC: F E )& ) ) Optimization Variant resolution E F variant Package name extraction I )& ) ) CA CED F E E = )& ) ) -
Property Parsing: Value Calculation )& ) ) () )-)& )
F AC: F E )& ) ) .-& ) )& ) ) F E F AC: F E )& ) ) .-& ) )& ) ) F AC: F E )& ) ) Optimization Variant resolution E F variant Package name extraction I )& ) ) CA CED F E E = )& ) ) -
Property Parsing: Value Calculation )& ) ) () )-)& )
F AC: F E )& ) ) .-& ) )& ) ) F E F AC: F E )& ) ) .-& ) )& ) ) F AC: F E )& ) ) Optimization Variant resolution E F variant Package name extraction I )& ) ) CA CED F E E = )& ) ) -
Property Parsing: Value Calculation )& ) ) () )-)& )
F AC: F E )& ) ) .-& ) )& ) ) F E F AC: F E )& ) ) .-& ) )& ) ) F AC: F E )& ) ) Optimization Variant resolution E F variant Package name extraction I )& ) ) CA CED F E E = )& ) ) -
Results > Gradle plugin instead of script > Simplified dependencies
> Correct feature flag values in submodules -
Results > Gradle plugin instead of script > Simplified dependencies
> Correct feature flag values in submodules -
Results > Gradle plugin instead of script > Simplified dependencies
> Correct feature flag values in submodules -
Results > Gradle plugin instead of script > Simplified dependencies
> Correct feature flag values in submodules -
Summary > Solved pain points of feature branches with feature
flags > Gradle plugin for Android is now available