Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Long Live Ride on Rails

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/

Koichi ITO

February 06, 2019
Tweet

More Decks by Koichi ITO

Other Decks in Programming

Transcript

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

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

    (CEO at ESM, Inc.) * Oritinal phrase is “ιϑτ΢ΣΞ͸ਓ͕ਓͷͨΊʹ࡞͍ͬͯΔ” (JA) .
  3. 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
  4. 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
  5. 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
  6. T o make change, and embrace change This story will

    talk about RailsApp that involved more than 20 developers over 
 5 years ago.
  7. 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
  8. 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
  9. Why, How Why: A few (breaking) change is easy understand

    How: `bundle outdated`, `gemdiff` or others
  10. 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
  11. 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
  12. Why, How Why: A few (breaking) change is easy understand

    How: `bundle update rails` or handcraft after investigate
  13. 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
  14. 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
  15. `: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")
  16. `: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'
  17. `: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'
  18. 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”
  19. 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)
  20. 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)
  21. 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
  22. 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
  23. 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”
  24. 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
  25. The beginning of monkey patch Place the code commenting out

    the following in the config/initializers directory I often use “open class” there :-)
  26. 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
  27. 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)