Upgradinate

Staying on master while doing heavy upgrades

Upgradinating is a process we have used a few times at Lonely Planet now that’s saved us a lot of time and grief.

We have recently completed a few technical milestones that have been haunting us for some time:

Having issues in the past with large chunks of work and a strong desire not to branch, we wanted a way we could keep shipping code without interrupting or slowing down our releases. We came up with the idea of forward-porting what we could and scripting up all other changes - and we called it upgradinating.

Enough talk, time for the code!

Simple demo

upgradinate_script.rb

  helper = UpgradinateFileHelper.new 'OLD NESS', 'NEW-NESS'
  helper.upgradinate_files [
      "/path/to/project/Gemfile"
    ]

Gemfile

  # NEW-NESS gem 'awesome_thing_to_put_in'
  gem 'deprecated_badness' # OLD NESS

Usage

ruby upgradinate_script.rb

NOTE:

  # Mac OSX
  brew install xz #required for installing grep through homebrew
  brew install https://raw.github.com/Homebrew/homebrew-dupes/master/grep.rb

Examples

Why this works

More reading

·