Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Journey of Feature Flag development in LINE Android

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
Tweet

More Decks by LINE DevDay 2019

Other Decks in Technology

Transcript

  1. 2019 DevDay Journey of Feature Flag Development in LINE Android

    > Hidetsugu Tamaki > LINE App Dev Team3 Software Engineer
  2. Agenda > Pain Points of Feature Branches > Benefits of

    Feature Flags > History of Feature Flags in LINE Android
  3. Agenda > Pain Points of Feature Branches > Benefits of

    Feature Flags > History of Feature Flags in LINE Android
  4. Agenda > Pain Points of Feature Branches > Benefits of

    Feature Flags > History of Feature Flag in LINE Android
  5. 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 = )( ( ,(
  6. Feature Flags Achieve > Conflict minimization > Smoother release schedule

    management > Instant toggling > Better collaboration with stakeholders
  7. Feature Flags Achieve > Conflict minimization > Smoother release schedule

    management > Instant toggling > Better collaboration with stakeholders
  8. Feature Flags Achieve > Conflict minimization > Smoother release schedule

    management > Instant toggling > Better collaboration with stakeholders
  9. Feature Flags Achieve > Conflict minimization > Smoother release schedule

    management > Instant toggling > Better collaboration with stakeholders
  10. Feature Flags Achieve > Conflict minimization > Smoother release schedule

    management > Instant toggling > Better collaboration with stakeholders
  11. Feature Flags Achieve > Conflict minimization > Smoother release schedule

    management > Instant toggling > Better collaboration with stakeholders
  12. Feature Flags Achieve > Conflict minimization > Smoother release schedule

    management > Instant toggling > Better collaboration with stakeholders
  13. Feature Flags Achieve > Conflict minimization > Smoother release schedule

    management > Instant toggling > Better collaboration with stakeholders
  14. Feature Flags Achieve > Conflict minimization > Smoother release schedule

    management > Instant toggling > Better collaboration with stakeholders
  15. Feature Flags Achieve > Conflict minimization > Smoother release schedule

    management > Instant toggling > Better collaboration with stakeholders
  16. Limitation of Feature Flags Not a “silver bullet” > Difficult

    to apply > Updating libraries > Overkill > Prototyping
  17. Agenda > Pain Points of Feature Branches > Benefits of

    Feature Flags > History of Feature Flags in LINE Android
  18. Feature Flags in LINE Android > Started with a simple

    Gradle script (Dec. 2015) > Injects values into BuildConfig file > Loads values from a property file
  19. 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
  20. Feature Flags in LINE Android > Started with a simple

    Gradle script (Dec. 2015) > Injects values into BuildConfig file > Loads values from a property file
  21. > Toggle flag by user name or app version >

    Toggle flag at runtime > Support Gradle submodule Growth of Feature Flags
  22. > Toggle flag by user name or app version >

    Toggle flag at runtime > Support Gradle submodule Growth of Feature Flags
  23. Module Structure of LINE Android line-android-app submodule-sticker Product Flavor Product

    Flavor    dev, beta, rc, release debug, release
  24. Initial Feature Flags Implementation line-android-app FeatureFlag script Flag Property File

    Product Flavor Refers to Product Flavor submodule-sticker   
  25. 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   
  26. 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   
  27. 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
  28. 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
  29. 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
  30. 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
  31. Problems of Misuse > Caused by BuildConfig.java and product flavors

    > Generated wrong values > Caused by back reference > Submodules were no longer standalone
  32. Problems of Misuse > Caused by BuildConfig.java and product flavors

    > Generated wrong values > Caused by back reference > Submodules were no longer standalone
  33. 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
  34. 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
  35. Workaround for Wrong Flag Values BuildConfig.java BuildConfig.java Injects values into

    Injects values into package com.linecorp.line package com.linecorp.sticker
  36. 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
  37.    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
  38. Workaround for Wrong Flag Values line-android-app FeatureFlag script Flag Property

    File Product Flavor FeatureFlag.java submodule-sticker    Refers to Creates
  39. Things Got Worse > Tricky usage of `  

     > Wrong dependencies still remain > Poor compatibility with automated testing
  40. Things Got Worse > Tricky usage of `  

     > Wrong dependencies still remain > Poor compatibility with automated testing
  41. Things Got Worse > Tricky usage of `  

     > Wrong dependencies still remain > Poor compatibility with automated testing
  42. Things Got Worse > Tricky usage of `  

     > Wrong dependencies still remain > Poor compatibility with automated testing
  43. Things Got Worse > Tricky usage of `  

     > Wrong dependencies still remain > Poor compatibility with automated testing
  44. Proper Solution line-android-app FeatureFlag script Flag Property File Product Flavor

    FeatureFlag.java submodule-sticker    Refers to Creates
  45. 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
  46. 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
  47. 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
  48. Link to Submodule Flag Values &, - B = B

    A: &, - &, - line-android-app submodule-sticker
  49. )& ) ,) () CC )-)& ) = A: )&

    ) ,) -& ) Property Parsing: Format )& ) ,) () )-)& ) = A: )& ) ,) -& ) > Written with “disjunctive normal form” style property
  50. Property Parsing: Phase > Enabled if build variant is 

      Phase   Phase > Enabled if build variant is   
  51. Property Parsing: Value Calculation : E variant )( ( &

    ( ( ( ( ( CE A E : CD= : )( ( & ( - ( )( ( & ( D E: C: CE A E : CD= : )( ( & ( - ( F )( ( & ( D E: Optimization Phase resolution
  52. Property Parsing: Value Calculation : E variant )( ( &

    ( ( ( ( ( CE A E : CD= : )( ( & ( - ( )( ( & ( D E: C: CE A E : CD= : )( ( & ( - ( F )( ( & ( D E: Optimization Phase resolution
  53. Property Parsing: Value Calculation : E variant )( ( &

    ( ( ( ( ( CE A E : CD= : )( ( & ( - ( )( ( & ( D E: C: CE A E : CD= : )( ( & ( - ( F )( ( & ( D E: Optimization Phase resolution
  54. Property Parsing: Value Calculation : E variant )( ( &

    ( ( ( ( ( CE A E : CD= : )( ( & ( - ( )( ( & ( D E: C: CE A E : CD= : )( ( & ( - ( F )( ( & ( D E: Optimization Phase resolution
  55. 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 = )& ) )
  56. 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 = )& ) )
  57. 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 = )& ) )
  58. 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 = )& ) )
  59. 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 = )& ) )
  60. Results > Gradle plugin instead of script > Simplified dependencies

    > Correct feature flag values in submodules
  61. Results > Gradle plugin instead of script > Simplified dependencies

    > Correct feature flag values in submodules
  62. Results > Gradle plugin instead of script > Simplified dependencies

    > Correct feature flag values in submodules
  63. Results > Gradle plugin instead of script > Simplified dependencies

    > Correct feature flag values in submodules
  64. Summary > Solved pain points of feature branches with feature

    flags > Gradle plugin for Android is now available