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
-
Exclude pending migration connection from reestablished connections -
Autoload all eager load paths -
Upgrade Rails to 7.1.3.4 -
Fix ee/spec/features/groups/analytics/productivity_analytics_spec.rb -
Fix ./spec/lib/gitlab/pagination/keyset/simple_order_builder_spec.rb -
Fix spec/services/loose_foreign_keys/partition_cleaner_service_spec.rb -
Use ActiveRecord::SchemaMigration.versions instead of all_versions -
Use migration connection to support multiple dbs -
Fix background migration tests -
Define default_timezone for ClickHouseHelpers -
Raise the version of migration order patch -
Remove irb USE_AUTOCOMPLETE override -
Remove Rails version restriction for ActiveJob patch -
Raise the version of ActionView patch -
Update gitlab_quality-test_tooling version -
Fix gitlab-database-load_balancing gem Rails version -
Use config.fixture_paths instead of config.fixture_path -
Fix Gitlab::Database.gitlab_schemas_for_connection method -
Fix Gitlab::ImportExport::AttributeCleaner for Issue#external_author -
Call the registered parser for rendered content -
Fix spec/requests/oauth/tokens_controller_spec -
Fix journey router patch -
Use BroadcastLogger instead of ActiveSupport::Logger.broadcast -
Fix updated_by_or_author method -
Fix ee/spec/models/users_security_dashboard_project_spec.rb -
Remove transaction instrumentation notification -
Fix type map cache -
Ignore id_value for Ci::Build spec -
Fix with_lock_retries_spec that hangs -
Rename builds partials to jobs -
Fix the migrations patch -
Fix preview_path= deprecation warning -
Fix deprecation warning for Gitaly deprecators -
Change deprecated config defaults -
Fix BulkInsertSafe module for composite keys -
Fix Redis patch -
Add ignored deprecations -
Use connection.schema_migration instead of ActiveRecord::SchemaMigration -
Kas::UserAccess: set request to controller that checks csrf -
Handle zettabytes in storage helper specs -
Stub clock_gettime with values called by Rails -
Ignore NullConfig return value in Gitlab::Database -
Database indexes: columns and include are seperate fields now -
Examine previous value of updated_at in ThrottledTouch -
Explicitly define primary key for Geo::TrackingBase -
Rename rails/generators/testing/behaviour -> rails/generators/testing/behavior -
Explicitly state returning columns for p_ci_builds -
Add ActiveRecord::Enum patch -
Fix database patch -
Update gitlab-activerecord dependency activerecord version to 7.1 -
Use Rails.application.deprecators instead of ActiveSupport::Deprecation -
Fix undefined usage_type for GroupDeployKey -
Rename all_versions -> version for schema_migrations -
Use internal_metadata object instead of InternalMetadata class -
Verify null_relation?/none? instead of ActiveRecord::NullRelation inheritance