Continuous Mobile App Delivery

Continuous Mobile App Delivery

Release management is a major part of our daily work as well as regular app development. Frequent release is essential to survive in this fast-paced industry, which, however, gets harder and harder to manage as the project continues because the specification gets increasingly complicated and business will expand to different countries, which means you need to support more languages. What you need to care about is not only apps for your customers but also internal apps whose audience can be developers, product managers, community managers and QA team.

In this talk, Yusei will share how Cookpad copes with the complexity of release management by covering different topics ranging from basics like how to schedule releases properly to advanced topics like how to leverage ChatOps.

562e29ba057361b2b944bd7bbd274887?s=128

Yusei Nishiyama

February 14, 2019
Tweet

Transcript

  1. Continuous Mobile App Delivery 1

  2. Release management is hard and keeps getting harder and harder

    As your project continues: • The team gets bigger • Build time gets longer • Your app supports more languages • You have more build configurations 2
  3. Yusei Nishiyama @yuseinishiyama 3

  4. Previous talks and blog posts • Building iOS Apps at

    Scale • Continuous App Delivery 4
  5. Cookpad • 40 million monthly average users • Available in

    70 countries • Over 2 million recipes 5
  6. How we've been developing since 2014 • The number of

    iOS Engineers • 1 → 12 • Build Time • Nothing (Objective-C) → 20 mins • The number of supported languages • 1 → 17 6
  7. 7

  8. Agenda • How to schedule release • How to automate

    release (with a Slack bot) • Case Study: Cookpad 8
  9. Release Schedule • Frequent • Release changes incrementally • Consistent

    • It should be usually non-negotiable • Independent of the Product development cycle • Harness web-based feature toggles1 1 https://martinfowler.com/articles/feature-toggles.html 9
  10. Weekly Release in Cookpad 10

  11. Weekly Release in Cookpad 11

  12. App Versioning • Programmatic versioning • Auto increment • CI

    build number • Version-agnostic code base • Translations with a fallback language • Applying version info on build time 12
  13. Tips: Get App Version from Connect lane :app_version do |options|

    Spaceship::Tunes.login Spaceship::Tunes.select_team app = Spaceship::Tunes::Application.find(options[:bundle_id]) latest_version = app.edit_version || app.live_version latest_version.version end 13
  14. Agenda • How to schedule release • How to automate

    release • Case Study: Cookpad 14
  15. Remote Build Server • Make your builds independent from a

    specific machine environment • Keep the history • Use Fastlane match2 to provision servers 2 https://docs.fastlane.tools/actions/match/ 15
  16. Tips: Server Provisioning with Fastlane match https://codesigning.guide/ 16

  17. Targets of App Release It's not only your customers •

    A developer, so that they can debug a feature on a real device • A product manager, so that they can try out a work-in- progress feature to confirm that what’s being built is actually what is wanted • QA team, so that they can test a release candidate 17
  18. 18

  19. Different Build Configurations • The bundle ID can be different

    so that internal testers can have multiple apps installed on their devices • The server environment can be different • Enabled features can be different 19
  20. ! branch + context = build 20

  21. Tips: Jenkins Parameterised Build3 http://server/job/myjob/buildWithParameters? name1=value1&name2=value2 3 https://wiki.jenkins.io/display/JENKINS/Parameterized+Build 21

  22. ! • Who's going to trigger the build? • How

    can we decide what parameters to send? 22
  23. GitHub Webhooks + Label • Specify a PR that needs

    to be distributed with a GitHub label • If CI (Fastlane) founds a specific label it distributes the app to internal members with an Enterprise codesign 23
  24. GitHub Webhooks + Label • Specify a PR that needs

    to be distributed with a GitHub label • If CI (Fastlane) founds a specific label it distributes the app to internal members with an Enterprise codesign • master and branches with an RC prefix are distributed automatically 24
  25. GitHub Webhooks + Label (Failed) • CI tends to be

    busy • Too many internal releases • People started ignoring them 25
  26. ChatOps 26

  27. What's ChatOps? ChatOps is the use of chat clients to

    facilitate software development and operational tasks — Yusei Nishiyama 27
  28. Why ChatOps? • Transparent • Infalliable • Intuitive 28

  29. Bot Version 1 • Pattern match with regex • deploy

    {branch_name} to {destination} • Commands are hard to remember • Operational mistakes • Hard to know available options 29
  30. Bot Version 2 • Interactive • Prepopulated options • Contextual

    30
  31. Architecture 31

  32. How to Design Your Bot Read Message Guidelines4 • Replace

    the original message instead of making a new one • Cleaning up the entire interaction at the end to summarize what has happened • If it consists of multiple steps, those steps should be visible only to the user until the entire action is completed 4 For more information check https://api.slack.com/docs/message-guidelines and https://github.com/slackapi/sample-message-menus-node 32
  33. Choose Right Technology • Incoming Webhooks • Slash Commands •

    Events API • RTM (Real-time messaging) API • Web API 33
  34. Receiving Messages • Slash Commands • Events API • RTM

    (Real-time messaging) API 34
  35. Posting Messages • Incoming Webhooks • Web API • RTM

    API 35
  36. RTM API vs Events API5 • RTM API • WebSocket-based

    • More responsive ("__ is typing...", online status) • Events API • HTTP-based • Scalable 5 For more details check out https://api.slack.com/faq#events_api and https://api.slack.com/events 36
  37. Questions You Should Ask Yourself • Post, receive, or both

    • Only messages or including other events • A need of your web server 37
  38. "Which API is right for your Slack app?" 6 6

    https://medium.com/slack-developer-blog/getting-started-with-slacks-apis-f930c73fc889 38
  39. Preparing Endpoints • Handle mentions • Handel interactions (e.g. a

    button is pressed) • Return dynamic options 39
  40. Handle Mentions 40

  41. Tips: URL Verification 41

  42. Handle Interactions 42

  43. Dynamic Options 43

  44. Tips: Handle Timeout You must respond within 3 seconds. If

    it takes your application longer to process the request, we recommend responding with an HTTP 200 OK immediately, then use the response_url7 { "type": "interactive_message", "actions": […], "callback_id": "select_simple_1234", … "original_message": {…}, "response_url": "https://hooks.slack.com/actions/T012AB0A1/123456789/JpmK0yzoZDeRiqfeduTBYXWQ" } 7 https://api.slack.com/interactive-messages 44
  45. Tips: Debugging with ngrok • ngrok exposes local servers to

    the public internet over secure tunnels • A free plan is available8 8 https://ngrok.com/pricing 45
  46. Agenda • How to schedule release • How to automate

    release • Case Study: Cookpad 46
  47. Weekly Release Cycle 47

  48. Developing New Features • Run deploy chatbot command to distribute

    a working-in-progress feature to internal members: • To test it on different devices • To check it with PM • To ask QA to test it 48
  49. Wednesday: Code Freeze • Run code_freeze chatbot command to: •

    Create a release candidate branch off from master • Ask translators to translate new phrases • Post a list of changes to Slack • Run deploy command to make an RC build for QA team 49
  50. Friday: Submit • Run deploy chatbot command to: • Archive

    the RC and upload it to App Store Connect • Run submit chatbot command to: • Submit a new version with a specified build • Post a message to Slack 50
  51. Monday: Release • Run release chatbot command to: • Release

    "Pending Developer Release" version • Download dSYMs and upload them to a crash reporting service • Create the next version in App Store Connect • Post a message to Slack 51
  52. Design Slack Messages Understands Slack Attachment9 9 https://api.slack.com/docs/message-attachments 52

  53. Tips: Message Builder10 10 https://api.slack.com/docs/messages/builder 53

  54. The Art of Working from Home... 54

  55. Wrap-up • Release frequently • Stick to a constant schedule

    • Set up remote build servers • Leverage chat application to do operational works 55
  56. Yusei Nishiyama @yuseinishiyama 56

  57. We are Hiring https://www.cookpadteam.com 57

  58. Thank you! 58