Database Migration Debugging and Cross-Database Compatibility
The road to Rails 5

The road to Rails 5

5/28/2019 · Jan Provaznik

What this post added

This post details the successful upgrade of GitLab to Rails 5. The key technical contributions include: - Implementing a strategy to run the application with both Rails 4 and Rails 5 simultaneously using environment variables (`RAILS5`, `BUNDLE_GEMFILE`) and version-specific Gemfiles. - Developing a helper method `Gitlab.rails5?` to conditionally apply code changes for Rails 5 compatibility. - Documenting the phased upgrade process: enabling dual compatibility, fixing CI issues, manual testing, switching to Rails 5 by default, maintaining Rails 4 compatibility for a period, and finally dropping Rails 4 support. - Highlighting challenges encountered, such as incompatible changes in Active Record/Arel and the need to refactor monkey patches. - Describing the production release strategy, including running CI for both Rails versions during the development cycle and removing Rails 4 code after a successful release.

Read the original post ↗