Slide 1

Slide 1 text

Update Early Update Often #RubyKaigi 2015

Slide 2

Slide 2 text

Jolly Good Code Juanito Fatas from Taiwan ءٝؖه٦ٕ⠓爡

Slide 3

Slide 3 text

WHY!
 FREQUENT UPDATE WHY?

Slide 4

Slide 4 text

MAKE FUTURE UPGRADE EASIER

Slide 5

Slide 5 text

REDUCE TECHNICAL DEBT

Slide 6

Slide 6 text

MAINTAINER LOVE NEW BUGS

Slide 7

Slide 7 text

DEVELOPERS DISLIKE LEGACY

Slide 8

Slide 8 text

PERFORMANCE IMPROVEMENTS

Slide 9

Slide 9 text

SECURITY VULNERABILITY

Slide 10

Slide 10 text

LEARN FROM GEM UPDATES

Slide 11

Slide 11 text

SHIP LATEST SOFTWARE https://jollygoodcode.github.io/2015/09/03/the-birth-of-deppbot.html

Slide 12

Slide 12 text

HOWTO bundle-update(1) Quick Demo

Slide 13

Slide 13 text

$ git checkout master

Slide 14

Slide 14 text

$ git pull

Slide 15

Slide 15 text

$ git checkout -b bundle-update-2015-12-12

Slide 16

Slide 16 text

$ bundle updaet

Slide 17

Slide 17 text

Could not find command "updaet"

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

$ bundle update

Slide 20

Slide 20 text

$ git add Gemfile.lock

Slide 21

Slide 21 text

$ git comit -m "Bundle Update 2015-12-12"

Slide 22

Slide 22 text

git: 'comit' is not a git command. See 'git --help'. Did you mean this? commit

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

$ git commit -m "Bundle Update 2015-12-12"

Slide 25

Slide 25 text

$ git pull-request -m "Bundle Update 2015-12-12" git pull-request command is from github.com/github/hub

Slide 26

Slide 26 text

~ 10 minutes

Slide 27

Slide 27 text

7200 per hour Juanito Fatas

Slide 28

Slide 28 text

7200*10/60 ~= 1200 ¥

Slide 29

Slide 29 text

3.times a month, 1200*3 = 3600¥

Slide 30

Slide 30 text

3600 ¥ 蔦拉麵 900¥ ⭐

Slide 31

Slide 31 text

Automation

Slide 32

Slide 32 text

May I use tachikoma.io?

Slide 33

Slide 33 text

Sure What is it?

Slide 34

Slide 34 text

A service which runs bundle update automatically.

Slide 35

Slide 35 text

Sounds good. Can try, can try.

Slide 36

Slide 36 text

But... It only costs a little, $49/month.

Slide 37

Slide 37 text

Hmm...
 Can’t you write a simple script that does that?

Slide 38

Slide 38 text

Sure I can!

Slide 39

Slide 39 text

today = Time.current.strftime("%F") new_branch = "bundle-update-#{today}" `git checkout master` `git pull` `git checkout -b #{new_branch}` `bundle update` `git push origin #{new_branch}` `git pull-request -m "Bundle Update #{today}" script 'depbot'

Slide 40

Slide 40 text

Works except I need to run 'depbot' from time to time

Slide 41

Slide 41 text

Then I am busy

Slide 42

Slide 42 text

No bundle updates

Slide 43

Slide 43 text

Could you make a cronjob that runs every day?

Slide 44

Slide 44 text

How about make it a service?

Slide 45

Slide 45 text

Sure, do it.

Slide 46

Slide 46 text

From Script to Rails app

Slide 47

Slide 47 text

GitHub Org. API deppbot will send a Pull Request like a human

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

Process

Slide 50

Slide 50 text

git clone works for project hosts on bitbucket, submodules too

Slide 51

Slide 51 text

bundle update Updates Gemfile.lock and install gems

Slide 52

Slide 52 text

TravisCI? Not all kinds of gems can be installed on a single VPS

Slide 53

Slide 53 text

bundle lock --update Updates Gemfile.lock without installing This command re-introduced in bundler v1.10 #3439

Slide 54

Slide 54 text

diff -u "BUNDLED WITH" will be preserved

Slide 55

Slide 55 text

Delete Repo on VPS immediately when we got the diff

Slide 56

Slide 56 text

Cook Pull Request gem links, compare views, changelogs, time savings

Slide 57

Slide 57 text

Pull Request &YBN QMF

Slide 58

Slide 58 text

nokogiri Query RubyGems.org API Gem authors, please fill in your metadata

Slide 59

Slide 59 text

1.6.6.4…1.6.7 Parse diff and link_to repository compare view for code review Gem authors, please push your tags when release a gem

Slide 60

Slide 60 text

CHANGELOG Query GitHub API, jollygoodcode/whatsnew Don’t let your friends dump git logs into CHANGELOGs

Slide 61

Slide 61 text

Time Savings Sum every Pull Request processed time

Slide 62

Slide 62 text

Conclusion

Slide 63

Slide 63 text

Update Early

Slide 64

Slide 64 text

Update Often

Slide 65

Slide 65 text

"Continuous Updates"

Slide 66

Slide 66 text

https://www.deppbot.com 1108 Pull Requests Sent 94 hours Engineering Time Saved

Slide 67

Slide 67 text

WHAT’S NEXT?

Slide 68

Slide 68 text

"Automated Security Updates" Powered by Bundler Audit

Slide 69

Slide 69 text

hor hor hor Christmas '

Slide 70

Slide 70 text

Any Questions Any Suggestions )

Slide 71

Slide 71 text

Please come talk to me or

Slide 72

Slide 72 text

I have stickers

Slide 73

Slide 73 text

ָ֮֯הֲ