Share
Embed
Journey of Feature Flag development in LINE Android
GDG DevFest Tokyo 2019 での講演資料です
https://tokyo.gdgjapan.org/devfest2019
LINE Developers
December 14, 2019
Transcript
97 slides
-
Journey of Feature Flag development in LINE Android > Hidetsugu
Tamaki / LINE Corporation -
> LINE Android Development Hidetsugu Tamaki (@r_ralph_h) Introduction > Apr.
2018 ~ > LINE Corporation / 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 , ,
= ( ) : = ( .) : > View visibility , , -
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
Sticker feature PRs -
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 -
Sticker feature PR ✗ Instant Toggling Main branch Release branch
1.0 Critical issue -
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 = = = # . " = = = # . " > 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 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 &, A
= A : &, - line-android-app submodule-sticker -
)(& ,( - (, = = :
)(& ,( - (, = = : Property Parsing: Format > 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 variant ( - -)&
: = ( - -)& : = ( - -)& Optimization Phase resolution -
( - -)& : =
Property Parsing: Value Calculation variant Optimization Phase resolution ( - -)& : = ( - -)& -
Property Parsing: Value Calculation ( - -)&
: = variant Optimization Phase resolution ( - -)& : = ( - -)& -
Property Parsing: Value Calculation variant ( - -)&
: = ( - -)& : = ( - -)& Optimization Phase resolution -
E F variant Property Parsing: Value Calculation )& ) )
() II )-)& ) F AC: F E )& ) ) .-& ) )& ) ) F II E F AC: F E )& ) ) .-& ) )& ) ) F AC: F E )& ) ) Optimization Variant resolution Package name extraction )& ) ) CA CED F E E = )& ) ) II F AC: F E )& ) ) II F AC: F E )& ) ) F AC: F E Optimization Phase resolution -
Property Parsing: Value Calculation E F variant )& ) )
() II )-)& ) F AC: F E )& ) ) .-& ) )& ) ) F II E F AC: F E )& ) ) .-& ) )& ) ) F AC: F E )& ) ) Optimization Variant resolution Package name extraction )& ) ) CA CED F E E = )& ) ) II F AC: F E )& ) ) II F AC: F E )& ) ) F AC: F E Optimization Phase resolution -
Property Parsing: Value Calculation E F variant )& ) )
() II )-)& ) F AC: F E )& ) ) .-& ) )& ) ) F II E F AC: F E )& ) ) .-& ) )& ) ) F AC: F E )& ) ) Optimization Variant resolution Package name extraction )& ) ) CA CED F E E = )& ) ) II F AC: F E )& ) ) II F AC: F E )& ) ) F AC: F E Optimization Phase resolution -
Property Parsing: Value Calculation E F variant )& ) )
() II )-)& ) F AC: F E )& ) ) .-& ) )& ) ) F II E F AC: F E )& ) ) .-& ) )& ) ) F AC: F E )& ) ) Optimization Variant resolution Package name extraction )& ) ) CA CED F E E = )& ) ) II F AC: F E )& ) ) II F AC: F E )& ) ) F AC: F E Optimization Phase resolution -
Property Parsing: Value Calculation E F variant )& ) )
() II )-)& ) F AC: F E )& ) ) .-& ) )& ) ) F II E F AC: F E )& ) ) .-& ) )& ) ) F AC: F E )& ) ) Optimization Variant resolution Package name extraction )& ) ) CA CED F E E = )& ) ) II F AC: F E )& ) ) II F AC: F E )& ) ) F AC: F E Optimization Phase resolution -
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