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

Ruby on Ice 2019: The Past, Present and Future of Rails at GitHub

Ruby on Ice 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.

Eileen M. Uchitelle

February 22, 2019
Tweet

More Decks by Eileen M. Uchitelle

Other Decks in Programming

Transcript

  1. The Past, Present,
    & Future of
    at

    View Slide

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

    View Slide

  3. !
    I work at

    View Slide

  4. a ♥

    View Slide

  5. I’m on the
    Core team!

    View Slide

  6. Upgrading
    at

    View Slide

  7. The Past, Present,
    & Future of
    at

    View Slide

  8. a ♥

    View Slide

  9. 2004

    View Slide

  10. Rails is
    born
    2004

    View Slide

  11. Frameworks
    are extracted,
    not built.
    -DHH


    View Slide

  12. Rails 1.0
    2005
    2004
    Rails is
    born

    View Slide

  13. 2005 2006 2007
    2004
    Rails is
    born
    Rails 1.2
    Rails 1.0

    View Slide

  14. Let’s build
    a thing!

    View Slide

  15. I’m in! Let’s build
    a thing!

    View Slide

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

    View Slide

  17. View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  22. View Slide

  23. GitHub
    is born GitHub
    launches
    Rails 1.2
    Rails
    joins
    Rails 2.3
    2007 2008 2009
    2006 2010
    Fork
    Rails

    View Slide

  24. fork
    repository

    View Slide

  25. fork
    repository

    View Slide

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

    View Slide

  27. View Slide

  28. 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

    View Slide

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

    View Slide

  30. GitHub
    launches
    Rails
    joins
    Rails 2.3
    2008 2009 2010
    Rails 3.0
    GH forks
    Rails
    2011
    Start 3.0
    upgrade
    2012
    Rails 3.2
    Upgrade
    stalled

    View Slide

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

    View Slide

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

    View Slide

  33. Why upgrade when
    this version isn’t
    causing us pain?
    Why upgrade
    when Rails 3
    is slower?
    Why upgrade
    when our fork
    is better?

    View Slide

  34. View Slide


  35. SECURITY
    BACKPORTS

    View Slide


  36. SECURITY
    BACKPORTS
    HIRING
    IS
    HARDER

    View Slide


  37. DEPENDENCIES
    ARE BRITTLE
    SECURITY
    BACKPORTS
    HIRING
    IS
    HARDER

    View Slide


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

    View Slide

  39. 2010
    Rails 3.0
    2011
    Start 3.0
    upgrade
    2013
    Rails 3.2
    Upgrade
    stalled
    2012
    Complete
    3.0
    2014
    Rails 4.0

    View Slide

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

    View Slide

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

    View Slide

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

    started
    Rails 4.0

    View Slide

  43. View Slide

  44. View Slide

  45. 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

    View Slide

  46. 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

    View Slide

  47. 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

    View Slide

  48. 2015 2016 2019
    Rails 5.0
    4.0

    started
    2017
    Eileen
    joins
    2018
    4.2
    in prod

    View Slide

  49. View Slide

  50. 2015 2016 2019
    Rails 5.0
    4.0

    started
    2017
    Eileen
    joins
    2018
    5.2
    in prod
    4.2
    in prod

    View Slide

  51. View Slide

  52. View Slide

  53. engineers at $
    for hours = $
    /hr

    View Slide

  54. The cost of not
    upgrading
    is immeasurable

    View Slide


  55. SECURITY
    BACKPORTS

    View Slide


  56. SECURITY
    BACKPORTS
    HIRING
    IS
    HARDER

    View Slide


  57. DEPENDENCIES
    ARE BRITTLE
    SECURITY
    BACKPORTS
    HIRING
    IS
    HARDER

    View Slide


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

    View Slide


  59. DEPENDENCIES
    ARE BRITTLE
    SECURITY
    BACKPORTS
    HIRING
    IS
    HARDER
    DEVELOPMENT
    IS PAINFUL
    REWRITE
    IN MICROSERVICES

    View Slide

  60. …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


    View Slide

  61. When upgrading you
    should…

    View Slide

  62. When upgrading you should
    build a team.

    View Slide

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

    View Slide

  64. When upgrading you should
    fix deprecation
    warnings early.

    View Slide

  65. When upgrading you should
    add linters to prevent
    regressions.

    View Slide

  66. When upgrading you should
    plan for the future.

    View Slide

  67. View Slide

  68. You may regret
    forking Rails.

    View Slide

  69. You may regret
    falling behind security
    supported versions.

    View Slide

  70. You may regret
    using old,
    unsupported gems.

    View Slide

  71. You may regret
    using private
    Rails APIs.

    View Slide

  72. You may regret
    monkey patches.

    View Slide

  73. View Slide

  74. View Slide

  75. View Slide

  76. This was my first
    major upgrade.

    View Slide

  77. It’s important to
    remember…

    View Slide

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

    View Slide

  79. It’s important to remember
    you’re not alone.

    View Slide

  80. It’s important to remember
    the payoff is
    worth it.

    View Slide

  81. View Slide

  82. The benefits of
    upgrading

    View Slide


  83. IMPROVED APIS

    View Slide


  84. IMPROVED APIS
    SECURITY FEATURES

    View Slide


  85. IMPROVED APIS
    BETTER PERFORMANCE
    SECURITY FEATURES

    View Slide


  86. IMPROVED APIS
    BETTER PERFORMANCE
    NEW LIBRARIES
    SECURITY FEATURES

    View Slide


  87. IMPROVED APIS
    BETTER PERFORMANCE
    NEW LIBRARIES
    SECURITY FEATURES
    A CHANCE TO CONTRIBUTE

    View Slide

  88. The Future

    View Slide

  89. View Slide

  90. 60+ Pull Requests
    from GitHub

    View Slide

  91. Continuous
    Upgrades

    View Slide

  92. Rails 6.0: Multiple
    database support

    View Slide

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

    View Slide

  94. We’re pioneering
    the future of Rails.

    View Slide

  95. We have a
    responsibility to
    support Rails

    View Slide

  96. View Slide


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

    View Slide


  98. IMPROVED APIS
    BETTER PERFORMANCE
    NEW FEATURES
    SECURITY
    A CHANCE TO CONTRIBUTE

    View Slide

  99. View Slide

  100. View Slide

  101. a ♥

    View Slide

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

    View Slide