Skip to content

Move test fixes out of the Rails 7.1 Upgrade MR

Overview

Draft: Upgrade Rails to 7.1.1 version (!124004 - closed) contains ~65 commits.

https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/rails_upgrade/ suggested an approach to merge all the fixes to the main branch.

With Introduce Gitlab.next_rails? for dual-booting (!161208 - merged) Gitlab.next_rails? check is introduced. It can be used to distinguish between Rails 7 and Rails 7.1 code and merge it even if the fix is incompatible with the current version.

For example, all_versions was renamed to versions for @connection.schema_migration, we can fix it as:

versions_from_database =
  if ::Gitlab.next_rails?
    @connection.schema_migration.versions
  else
    @connection.schema_migration.all_versions
  end

More examples: Draft: Introduce Gitlab.next_rails? to run Rail... (!160895 - closed)

Process

Local verification steps:

  • bundle exec rspec <test_file_spec.rb> passes
  • BUNDLE_GEMFILE=Gemfile.next bundle exec rspec <test_file_spec.rb> fails
  • A fix is provided
  • BUNDLE_GEMFILE=Gemfile.next bundle exec rspec <test_file_spec.rb> passes

Mark the checkbox of the commit/test that is being investigated or just add this issue to the related merge request. Merge the MR 🚀

Commits

Edited by Igor Drozdov