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

GDG DevFest Tokyo 2019 での講演資料です
https://tokyo.gdgjapan.org/devfest2019

LINE Developers

December 14, 2019
Tweet

More Decks by LINE Developers

Other Decks in Technology

Transcript

  1. Agenda > Pain Points of Feature Branches > Benefits of

    Feature Flags > History of Feature Flags in LINE Android
  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 Flag in LINE Android
  4. Feature Flag Usage > Activity   , , 

        = (  ) :    = (  .) :   > View visibility  , ,    
  5. Feature Flags Achieve > Conflict minimization > Smoother release schedule

    management > Instant toggling > Better collaboration with stakeholders
  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. ✗ Instant Toggling Main branch Release branch 1.0 Critical issue

    Conflicting PR Sticker feature PR   
  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 = = = # . "  = = = # . "  > 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 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
  30. Problems of Misuse > Caused by BuildConfig.java and product flavors

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

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

    Injects values into package com.linecorp.line package com.linecorp.sticker
  35. 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
  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 submodule-sticker    Refers to Creates
  38. Things Got Worse > Tricky usage of `  

     > Wrong dependencies still remain > Poor compatibility with automated testing
  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. Proper Solution line-android-app FeatureFlag script Flag Property File Product Flavor

    FeatureFlag.java submodule-sticker    Refers to Creates
  44. 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
  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 Links 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 Refers to Creates Creates
  47. Link to Submodule Flag Values &,    A

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

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

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

     : =      ( - -)&   : =       ( - -)&  Optimization Phase resolution
  51. ( - -)&    : =  

       Property Parsing: Value Calculation variant Optimization Phase resolution ( - -)&   : =       ( - -)& 
  52. Property Parsing: Value Calculation ( - -)&   

    : =      variant Optimization Phase resolution ( - -)&   : =       ( - -)& 
  53. Property Parsing: Value Calculation variant ( - -)&  

     : =      ( - -)&   : =       ( - -)&  Optimization Phase resolution
  54. 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
  55. 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
  56. 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
  57. 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
  58. 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
  59. Results > Gradle plugin instead of script > Simplified dependencies

    > Correct feature flag values in submodules
  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. Summary > Solved pain points of feature branches with feature

    flags > Gradle plugin for Android is now available