RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub

RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub

On August 15, 2018 GitHub was deployed to production running Rails 5.2. This was a historic event; for years GitHub had been behind Rails and dependent on a custom fork of Rails 2.3. This talk will visit GitHub's past, including our tumultuous relationship with the Rails framework, and the grueling effort it took to get our application on the latest version. You’ll learn what mistakes to avoid and the reasons why such a difficult upgrade was worth it. We’ll explore what tracking master means for the future and establish that GitHub and Rails are in it together for the long haul.

C44e1f7e22c3f23cff7bc130871047ef?s=128

Eileen M. Uchitelle

April 30, 2019
Tweet

Transcript

  1. The Past, Present, & Future of at

  2. Eileen M. Uchitelle ! " # @eileencodes eileencodes.com

  3. I’m a Staff Engineer at !

  4. I’m on the Core team!

  5. Upgrading at

  6. The Past, Present, & Future of at

  7. a ♥

  8. 2004

  9. Rails is born 2004

  10. Frameworks are extracted, not built. -DHH “ ”

  11. Rails 1.0 2005 2004 Rails is born

  12. 2005 2006 2007 2004 Rails is born Rails 1.2 Rails

    1.0
  13. I built a thing!

  14. I’m in! I built a thing!

  15. 2005 2006 2007 2004 Rails is born Rails 1.2 GitHub

    is born Rails 1.0
  16. 2005 2006 2007 2004 Rails is born GitHub is born

    GitHub launches 2008 Rails 1.2 Rails 1.0
  17. 2005 2006 2007 2004 Rails is born 2008 GitHub is

    born Rails 1.2 GitHub launches Rails joins Rails 1.0
  18. 2006 2007 2008 2005 2009 GitHub is born Rails 1.2

    GitHub launches Rails joins Rails 2.3 Rails 1.0
  19. GitHub is born GitHub launches Rails 1.2 Rails joins Rails

    2.3 2007 2008 2009 2006 2010 Fork Rails
  20. None
  21. GitHub is born GitHub launches Rails 1.2 Rails joins Rails

    2.3 2007 2008 2009 2006 2010 Fork Rails
  22. fork repository

  23. fork repository

  24. GitHub is born GitHub launches Rails 1.2 Rails joins Rails

    2.3 2007 2008 2009 2006 2010 Rails 3.0 Fork Rails
  25. None
  26. GitHub is born GitHub launches Rails 1.2 Rails joins Rails

    2.3 2007 2008 2009 2010 Rails 3.0 Fork Rails 2011 Start 3.0 upgrade
  27. GitHub launches Rails joins Rails 2.3 2008 2009 2010 Rails

    3.0 Fork Rails 2011 Start 3.0 upgrade 2012 Rails 3.2
  28. GitHub launches Rails joins Rails 2.3 2008 2009 2010 Rails

    3.0 Fork Rails 2011 Start 3.0 upgrade 2012 Rails 3.2 Upgrade stalled
  29. Why upgrade when this version isn’t causing us pain?

  30. Why upgrade when this version isn’t causing us pain? Why

    upgrade when Rails 3 is slower?
  31. Why upgrade when this version isn’t causing us pain? Why

    upgrade when Rails 3 is slower? Why upgrade when our fork is better?
  32. None
  33. SECURITY BACKPORTS

  34. SECURITY BACKPORTS HIRING IS HARDER

  35. DEPENDENCIES ARE BRITTLE SECURITY BACKPORTS HIRING IS HARDER

  36. DEPENDENCIES ARE BRITTLE SECURITY BACKPORTS HIRING IS HARDER DEVELOPMENT IS

    PAINFUL
  37. 2010 Rails 3.0 2011 Start 3.0 upgrade 2013 Rails 3.2

    Upgrade stalled 2012 Complete 3.0 2014 Rails 4.0
  38. 2013 Rails 3.2 Upgrade stalled 2012 2014 2015 Complete 3.0

    2016 4.0 started Rails 4.0
  39. 2013 Rails 3.2 Upgrade stalled 2012 2014 2015 Complete 3.0

    2016 4.0 started Rails 5.0 Rails 4.0
  40. 2013 2014 2015 Complete 3.0 2016 2017 Eileen joins Rails

    5.0 4.0
 started Rails 4.0
  41. None
  42. None
  43. Gemfile.lock (Rails 3.2) $ rails server $ rails test tests/models/issue_test.rb

    Multiple Rails Versions Gemfile_rails4.lock (Rails 4.0) $ RAILS4=1 rails server $ RAILS4=1 rails test tests/models/issue_test.rb
  44. Gemfile_rails4.lock (Rails 4.0) $ RAILS4=1 rails server $ RAILS4=1 rails

    test tests/models/issue_test.rb Multiple Rails Versions Gemfile_rails41.lock (Rails 4.1) $ RAILS41=1 rails server $ RAILS41=1 rails test tests/models/issue_test.rb
  45. Conditional Code if GitHub.rails_3_2? # code for Rails 3.2 elsif

    GitHub.rails_4_0? # code for Rails 4.0 else # code for all future versions end
  46. 2015 2016 2019 Rails 5.0 4.0
 started 2017 Eileen joins

    2018 4.2 in prod
  47. None
  48. 2015 2016 2019 Rails 5.0 4.0
 started 2017 Eileen joins

    2018 5.2 in prod 4.2 in prod
  49. None
  50. None
  51. engineers at $ for hours = $ /hr

  52. The cost of not upgrading is immeasurable

  53. SECURITY BACKPORTS

  54. SECURITY BACKPORTS HIRING IS HARDER

  55. DEPENDENCIES ARE BRITTLE SECURITY BACKPORTS HIRING IS HARDER

  56. DEPENDENCIES ARE BRITTLE SECURITY BACKPORTS HIRING IS HARDER DEVELOPMENT IS

    PAINFUL
  57. DEPENDENCIES ARE BRITTLE SECURITY BACKPORTS HIRING IS HARDER DEVELOPMENT IS

    PAINFUL REWRITE IN MICROSERVICES
  58. …the stories of upgrading being a huge undertaking always makes

    me scratch my head - what are we doing wrong if its easy for us. - HN troll “ ”
  59. When upgrading you should…

  60. When upgrading you should build a team.

  61. When upgrading you should take time to make a plan.

  62. When upgrading you should fix deprecation warnings early.

  63. When upgrading you should plan for the future.

  64. None
  65. You may regret forking Rails.

  66. You may regret falling behind security supported versions.

  67. You may regret using old, unsupported gems.

  68. You may regret using private Rails
 APIs.

  69. None
  70. None
  71. None
  72. This was my first major upgrade.

  73. It’s important to remember…

  74. It’s important to remember to pay debt down incrementally.

  75. None
  76. It’s important to remember you’re not alone.

  77. None
  78. It’s important to remember the payoff is worth it.

  79. None
  80. The benefits of upgrading

  81. IMPROVED APIS

  82. IMPROVED APIS SECURITY FEATURES

  83. IMPROVED APIS BETTER PERFORMANCE SECURITY FEATURES

  84. IMPROVED APIS BETTER PERFORMANCE NEW LIBRARIES SECURITY FEATURES

  85. IMPROVED APIS BETTER PERFORMANCE NEW LIBRARIES SECURITY FEATURES A CHANCE

    TO CONTRIBUTE
  86. The Future…

  87. None
  88. 75+ Pull Requests from GitHub

  89. Rails 6.0: Multiple database support

  90. Continuous Upgrades

  91. For the first time in GitHub’s history…

  92. We’re pioneering the future of Rails.

  93. We have a responsibility to support Rails

  94. None
  95. DEPENDENCIES ARE BRITTLE SECURITY BACKPORTS HIRING IS HARDER DEVELOPMENT IS

    PAINFUL
  96. IMPROVED APIS BETTER PERFORMANCE NEW FEATURES SECURITY A CHANCE TO

    CONTRIBUTE
  97. None
  98. None
  99. a ♥

  100. Thank you! ! " # @eileencodes eileencodes.com