Slide 1

Slide 1 text

Continuous Mobile App Delivery 1

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

Yusei Nishiyama @yuseinishiyama 3

Slide 4

Slide 4 text

Previous talks and blog posts • Building iOS Apps at Scale • Continuous App Delivery 4

Slide 5

Slide 5 text

Cookpad • 40 million monthly average users • Available in 70 countries • Over 2 million recipes 5

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

7

Slide 8

Slide 8 text

Agenda • How to schedule release • How to automate release (with a Slack bot) • Case Study: Cookpad 8

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

Weekly Release in Cookpad 10

Slide 11

Slide 11 text

Weekly Release in Cookpad 11

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

Agenda • How to schedule release • How to automate release • Case Study: Cookpad 14

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

Tips: Server Provisioning with Fastlane match https://codesigning.guide/ 16

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

18

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

! branch + context = build 20

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

! • Who's going to trigger the build? • How can we decide what parameters to send? 22

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

GitHub Webhooks + Label (Failed) • CI tends to be busy • Too many internal releases • People started ignoring them 25

Slide 26

Slide 26 text

ChatOps 26

Slide 27

Slide 27 text

What's ChatOps? ChatOps is the use of chat clients to facilitate software development and operational tasks — Yusei Nishiyama 27

Slide 28

Slide 28 text

Why ChatOps? • Transparent • Infalliable • Intuitive 28

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

Bot Version 2 • Interactive • Prepopulated options • Contextual 30

Slide 31

Slide 31 text

Architecture 31

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

Choose Right Technology • Incoming Webhooks • Slash Commands • Events API • RTM (Real-time messaging) API • Web API 33

Slide 34

Slide 34 text

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

Slide 35

Slide 35 text

Posting Messages • Incoming Webhooks • Web API • RTM API 35

Slide 36

Slide 36 text

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

Slide 37

Slide 37 text

Questions You Should Ask Yourself • Post, receive, or both • Only messages or including other events • A need of your web server 37

Slide 38

Slide 38 text

"Which API is right for your Slack app?" 6 6 https://medium.com/slack-developer-blog/getting-started-with-slacks-apis-f930c73fc889 38

Slide 39

Slide 39 text

Preparing Endpoints • Handle mentions • Handel interactions (e.g. a button is pressed) • Return dynamic options 39

Slide 40

Slide 40 text

Handle Mentions 40

Slide 41

Slide 41 text

Tips: URL Verification 41

Slide 42

Slide 42 text

Handle Interactions 42

Slide 43

Slide 43 text

Dynamic Options 43

Slide 44

Slide 44 text

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

Slide 45

Slide 45 text

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

Slide 46

Slide 46 text

Agenda • How to schedule release • How to automate release • Case Study: Cookpad 46

Slide 47

Slide 47 text

Weekly Release Cycle 47

Slide 48

Slide 48 text

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

Slide 49

Slide 49 text

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

Slide 50

Slide 50 text

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

Slide 51

Slide 51 text

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

Slide 52

Slide 52 text

Design Slack Messages Understands Slack Attachment9 9 https://api.slack.com/docs/message-attachments 52

Slide 53

Slide 53 text

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

Slide 54

Slide 54 text

The Art of Working from Home... 54

Slide 55

Slide 55 text

Wrap-up • Release frequently • Stick to a constant schedule • Set up remote build servers • Leverage chat application to do operational works 55

Slide 56

Slide 56 text

Yusei Nishiyama @yuseinishiyama 56

Slide 57

Slide 57 text

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

Slide 58

Slide 58 text

Thank you! 58