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 full-size slide

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

    View full-size slide

  3. I’m on the
    Core team!

    View full-size slide

  4. The Past, Present,
    & Future of
    at

    View full-size slide

  5. Rails is
    born
    2004

    View full-size slide

  6. Frameworks
    are extracted,
    not built.
    -DHH


    View full-size slide

  7. Rails 1.0
    2005
    2004
    Rails is
    born

    View full-size slide

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

    View full-size slide

  9. Let’s build
    a thing!

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  17. fork
    repository

    View full-size slide

  18. fork
    repository

    View full-size slide

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

    View full-size slide

  20. 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 full-size slide

  21. 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 full-size slide

  22. 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 full-size slide

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

    View full-size slide

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

    View full-size slide

  25. 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 full-size slide


  26. SECURITY
    BACKPORTS

    View full-size slide


  27. SECURITY
    BACKPORTS
    HIRING
    IS
    HARDER

    View full-size slide


  28. DEPENDENCIES
    ARE BRITTLE
    SECURITY
    BACKPORTS
    HIRING
    IS
    HARDER

    View full-size slide


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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    started
    Rails 4.0

    View full-size slide

  34. 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 full-size slide

  35. 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 full-size slide

  36. 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 full-size slide

  37. 2015 2016 2019
    Rails 5.0
    4.0

    started
    2017
    Eileen
    joins
    2018
    4.2
    in prod

    View full-size slide

  38. 2015 2016 2019
    Rails 5.0
    4.0

    started
    2017
    Eileen
    joins
    2018
    5.2
    in prod
    4.2
    in prod

    View full-size slide

  39. engineers at $
    for hours = $
    /hr

    View full-size slide

  40. The cost of not
    upgrading
    is immeasurable

    View full-size slide


  41. SECURITY
    BACKPORTS

    View full-size slide


  42. SECURITY
    BACKPORTS
    HIRING
    IS
    HARDER

    View full-size slide


  43. DEPENDENCIES
    ARE BRITTLE
    SECURITY
    BACKPORTS
    HIRING
    IS
    HARDER

    View full-size slide


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

    View full-size slide


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

    View full-size slide

  46. …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 full-size slide

  47. When upgrading you
    should…

    View full-size slide

  48. When upgrading you should
    build a team.

    View full-size slide

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

    View full-size slide

  50. When upgrading you should
    fix deprecation
    warnings early.

    View full-size slide

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

    View full-size slide

  52. When upgrading you should
    plan for the future.

    View full-size slide

  53. You may regret
    forking Rails.

    View full-size slide

  54. You may regret
    falling behind security
    supported versions.

    View full-size slide

  55. You may regret
    using old,
    unsupported gems.

    View full-size slide

  56. You may regret
    using private
    Rails APIs.

    View full-size slide

  57. You may regret
    monkey patches.

    View full-size slide

  58. This was my first
    major upgrade.

    View full-size slide

  59. It’s important to
    remember…

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  63. The benefits of
    upgrading

    View full-size slide


  64. IMPROVED APIS

    View full-size slide


  65. IMPROVED APIS
    SECURITY FEATURES

    View full-size slide


  66. IMPROVED APIS
    BETTER PERFORMANCE
    SECURITY FEATURES

    View full-size slide


  67. IMPROVED APIS
    BETTER PERFORMANCE
    NEW LIBRARIES
    SECURITY FEATURES

    View full-size slide


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

    View full-size slide

  69. 60+ Pull Requests
    from GitHub

    View full-size slide

  70. Continuous
    Upgrades

    View full-size slide

  71. Rails 6.0: Multiple
    database support

    View full-size slide

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

    View full-size slide

  73. We’re pioneering
    the future of Rails.

    View full-size slide

  74. We have a
    responsibility to
    support Rails

    View full-size slide


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

    View full-size slide


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

    View full-size slide

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

    View full-size slide