Rails 7.1 upgrade
# Scope Blueprint: https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/rails_upgrade/ Upgrade the [Rails gem](https://gitlab.com/gitlab-org/gitlab/-/blob/6c9b4caf7f33eb9aceeb8e09dd3ac1f65e9f22a8/Gemfile#L16) and related dependencies, to version `7.1` ([release notes](https://edgeguides.rubyonrails.org/7_1_release_notes.html)). [7.0.8 -\> 7.1.0 diff.](https://my.diffend.io/gems/activerecord/7.0.8/7.1.0/page/20#d2h-688868) ## Communication * [#f-rails-7-1](https://gitlab.slack.com/archives/C05SY4RV7SL) Slack channel ## Tasks ### Gem upgrades * [x] [bullet](https://gitlab.com/gitlab-org/gitlab/-/issues/427571 "Upgrade bullet gem to 7.1.1") (minimum 7.1.0) https://github.com/flyerhzm/bullet/blob/main/CHANGELOG.md#710-10062023: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/133558 * [x] `devise-two-factor`: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/134255 - :warning: ~~Only `devise-two-factor` 5.0 is compatible with Rails 7.1 and it has breaking changes https://github.com/devise-two-factor/devise-two-factor/blob/main/CHANGELOG.md#500.~~ `devise-two-factor` 4.1.1 has been released and is compatible with 7.1 * [x] `devise-pbkdf2-encryptable`: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/134514 * [x] `acts-as-taggable-on`: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/134554 * [x] Internal GitLab gems. Some of these gems have gemspecs that conflict with Rails 7.1: * [x] `gitlab_http`: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/133673 * [x] `rspec_flaky`: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/133573 * [x] `gitlab_quality-test_tooling`: https://gitlab.com/gitlab-org/ruby/gems/gitlab_quality-test_tooling/-/merge_requests/73 + https://gitlab.com/gitlab-org/ruby/gems/gitlab_quality-test_tooling/-/merge_requests/74 = https://gitlab.com/gitlab-org/gitlab/-/merge_requests/133594 * [x] `gitlab_rspec`: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/134777 ### Patches * [x] `ActiveRecord::GitlabPatches::Partitioning::Base` - [issue](https://gitlab.com/gitlab-org/gitlab/-/issues/427573 "Update ActiveRecord::GitlabPatches::Partitioning::Base to be compatible with Rails 7.1") * [x] `SchemaCacheWithRenamedTable` - [issue](https://gitlab.com/gitlab-org/gitlab/-/issues/427574 "Update SchemaCacheWithRenamedTable to be compatible with Rails 7.1"). The method parameters in `ActiveRecord::ConnectionAdapters::SchemaCache` has changed from `(table_name)` to `(connection, table_name)` ([diff](https://my.diffend.io/gems/activerecord/7.0.6/7.1.0.beta1/page/20#d2h-688868)). ### Upgrade tasks: - [ ] GitLab upgrade: https://docs.gitlab.com/ee/development/rails_update.html#prepare-an-mr-for-gitlab - [x] Gitaly upgrade: https://docs.gitlab.com/ee/development/rails_update.html#prepare-an-mr-for-gitaly - [ ] Security backport needed?: https://docs.gitlab.com/ee/development/rails_update.html#prepare-an-mr-for-gitlab ### Follow up items: - [ ] Deprecation logs https://docs.gitlab.com/ee/development/rails_update.html#deprecation-logger See related issues for more specific upgrade tasks. ## Links * [Draft MR to upgrade to 7.1.0](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/131865 "Draft: Upgrade to Rails 7.1.0") * [test MR using `7.1.0.beta1`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/133556 "Draft: Test upgrade rails 7.1.beta1")
epic