Long Live Ride on Rails

023b04c98f39cc041293d780352432ff?s=47 Koichi ITO
February 06, 2019

Long Live Ride on Rails

@Repro Tech: Long Life RailsApps supported by REJOB
https://repro-tech.connpass.com/event/117280/

023b04c98f39cc041293d780352432ff?s=128

Koichi ITO

February 06, 2019
Tweet

Transcript

  1. Long Live Ride on Rails Koichi ITO / ESM, Inc.

  2. @koic Community Manager at ESM, Inc RuboCop committer Active Record

    Oracle enhanced adapter committer Cucumber Committer T ech Speaker
  3. None
  4. None
  5. Goal “Software is made for people by people” -Kenji Hiranabe

    (CEO at ESM, Inc.) * Oritinal phrase is “ιϑτ΢ΣΞ͸ਓ͕ਓͷͨΊʹ࡞͍ͬͯΔ” (JA) .
  6. Agenda Context: A continuous team Stage of upgrading Rails application(s)

    One for all, All for one
  7. Three laws for continuous software Money is Matter Money is

    Matter Money is Matter
  8. Three laws for continuous software Money is Matter Money is

    Matter Money is Matter
  9. Core members and temporary members Members will graduate someday But

    it will be done gently (minimize pain) Make core members (Increase truck number) The accumulated experience increases speed and quality to the system Members who know a lot of code can take the initiative to the team and proposals
  10. Give members the same authorities Anyone can participate in the

    meeting Anyone can proposal a new feature Anyone can report a bug Anyone can review, merge, release, etc… Positions are different for each member
  11. The real world development In fact, I think a specialized

    features will occur for each person, so it depends on that person Especially the author is detailed e.g. Review requests on GitHub I’m not sure if Mob and Pair Programming will solve it, but listening is important anyway
  12. T o make change, and embrace change This story will

    talk about RailsApp that involved more than 20 developers over 
 5 years ago.
  13. T o make change, and embrace change

  14. Upgrade Rails for (new) developers motivation Which project do you

    like prefer, Rails 4.2 or Rails 5.2?
  15. Stage of upgrading App bundle update without Rails Upgrading RailsApp

    Upgrading RailsApp(s) starts with you
  16. 5W1H of `bundle update` Who: Bancho or somebody When: Weekly,

    daily, or not (CI tools or a noticed member, With new features or only updated gem release) Where: local development -> CI -> staging -> production What: Dependent gems (`>= 5.1.0, < 6.0.0`) Why: A few (breaking) change is easy understand How: `bundle outdated`, `gemdiff` or others
  17. When, Where When: Weekly, daily, or not (CI tools or

    a noticed member, with new features or only updated gem release) Where: local development -> CI -> staging -> production
  18. Who, What Who: Bancho or somebody What: Dependent gems e.g.

    `>= 5.1.0, < 6.0.0`
  19. Why, How Why: A few (breaking) change is easy understand

    How: `bundle outdated`, `gemdiff` or others
  20. 5W1H of `bundle update rails` Who: Bancho or somebody When:

    Beta 1, RC 1... (only updated gem release) Where: local development (early preparing `bump_rails_to_6_0` branch)-> CI -> staging -> production What: Rails and dependent gems Why: A few (breaking) change is easy understand How: `bundle update rails` or handcraft after investigate
  21. When, Where When: Beta 1, RC 1... (only updated gem

    release, don’t include new features) Where: local development (early preparing `bump_rails_to_6_0` branch)-> CI -> staging -> production Don’t forget batch scripts
  22. Who, What Who: Bancho or somebody What: Rails and dependent

    gems
  23. Why, How Why: A few (breaking) change is easy understand

    How: `bundle update rails` or handcraft after investigate
  24. Do you develop the way? Or wait? Rails 6.0 Beta

    1 has been released You can opening a new (bug) issue You maybe able to fix the bug and reduction to upstream "Let's go upgrade Rails app by everyone." by Ginza.rb
  25. First step: bundle update Loose the dependence of gems You

    can use the `:path` and `:github` options with Bundler When `bundle update` passes, it ends
  26. `:path` option (1/2) Loose dependency of gemspec in local gem

    code % cd path/to/devise % git diff devise.gemspec - s.add_dependency("railties", ">= 4.1.0", "< 6.0") + s.add_dependency("railties", ">= 4.1.0", "< 6.1")
  27. `:path` option (2/2) Specify the path where the code is

    being changed locally % cd path/to/rails-app % git diff Gemfile - gem 'devise' + gem 'devise', path: '/Users/ koic/src/github.com/ plataformatec/devise'
  28. `:github` option Specify the URL where the code has been

    updated in remote repo (e.g. GH) % git diff Gemfile - gem 'activerecord- oracle_enhanced-adapter' + gem 'activerecord- oracle_enhanced-adapter', github: 'rsim/oracle-enhanced'
  29. Second step: rails console Can you start the console without

    error? Can you use Active Record without error? If they do not pass, an error will also occur in “bin/rails server”
  30. Example: Bullet % bin/rails c (snip) /Users/koic/.rbenv/versions/ 2.6.0/lib/ruby/gems/2.6.0/gems/ bullet-5.8.1/lib/bullet/ dependency.rb:32:in

    `active_record_version': Bullet does not support active_record 6.0.0.beta1 yet (RuntimeError)
  31. Example: Devise 1: from /Users/koic/src/github.com/ plataformatec/devise/app/ controllers/devise_controller.rb: 4:in `<top (required)>'

    /Users/koic/src/github.com/ plataformatec/devise/app/ controllers/devise_controller.rb: 18:in `<class:DeviseController>': undefined local variable or method `mimes_for_respond_to' for DeviseController:Class (NameError)
  32. After that, rails s, testing… Code without automated tests Monthly

    or Weekly batch script, etc Please note the AC::Parameters when upgrading from Rails 4.2 to Rails 5.0 I made “Everlasting” gem https://github.com/koic/everlasting
  33. Release cycle In terms of textbooks, it is better to

    separate feature release and bundle update release For example, when performance regression occurs in release, if it is only feature or bundle update release, we can quickly investigate the cause The reality is that bundle update whose change is known may be put in the feature release
  34. You may encounter issue first with the upgrade Our team

    try to upgrade to Rails 5.2 from Rails 5.1 Unfortunately we reverted the release. The result reverted to Rails 5.1, but we were able to exposed the problem “ORA-03113 end-of-file on communication channel”
  35. Rails/OSS patch meetup The Meetup hold in monthly at ESM,

    Inc We asked @yahonda in the meetup. He is an Oracle ACE and Oracle enhanced adapter maintainer
  36. Enable TCP keepalive

  37. None
  38. The beginning of monkey patch Place the code commenting out

    the following in the config/initializers directory I often use “open class” there :-)
  39. Monkey patch is a debt White box code monkey patch

    may break with gem upgrade Someday should be reduced to upstream And our troubled problem may be a troubled problem for everyone
  40. My colleague started for Rails 6.0

  41. At the end of a dream If you know where

    I mean When the mist just stars to clear -Long Live Rock’n’Roll (Rainbow)