Commit 6fb28081 authored by Ethan Urie's avatar Ethan Urie

Merge branch '350190-verify-or-fix-usages-of-activerecord-base-in-pseudonymizer' into 'master'

Annotate usages of ActiveRecord:Base in Pseudonymizer

See merge request gitlab-org/gitlab!81491
parents dfd5e40a d452c7e8
......@@ -5,9 +5,6 @@ Database/MultipleDatabases:
- ee/lib/gitlab/geo/geo_tasks.rb
- ee/lib/gitlab/geo/health_check.rb
- ee/lib/gitlab/geo/log_cursor/daemon.rb
- ee/lib/pseudonymizer/dumper.rb
- ee/lib/pseudonymizer/pager.rb
- ee/spec/lib/pseudonymizer/dumper_spec.rb
- ee/spec/services/ee/merge_requests/update_service_spec.rb
- lib/backup/database.rb
- lib/backup/manager.rb
......
......@@ -77,6 +77,9 @@ module Pseudonymizer
end.lazy
end
# Disable rubocop Database/MultipleDatabases cop until Pseudonymizer is removed
# See https://gitlab.com/gitlab-org/gitlab/-/issues/350190
# rubocop:disable Database/MultipleDatabases
def table_to_schema(table)
table_config = @config.dig(:tables, table)
......@@ -97,6 +100,7 @@ module Pseudonymizer
set_schema_column_types(table, type_results)
end
# rubocop:enable Database/MultipleDatabases
def set_schema_column_types(table, type_results)
has_id = type_results.any? {|c| c[:name] == "id" }
......
......@@ -19,6 +19,9 @@ module Pseudonymizer
end
end
# Disable rubocop Database/MultipleDatabases cop until Pseudonymizer is removed
# See https://gitlab.com/gitlab-org/gitlab/-/issues/350190
# rubocop:disable Database/MultipleDatabases
def pages_per_id(&block)
id_offset = 0
......@@ -40,7 +43,11 @@ module Pseudonymizer
break if results.count < PAGE_SIZE
end
end
# rubocop:enable Database/MultipleDatabases
# Disable rubocop Database/MultipleDatabases cop until Pseudonymizer is removed
# See https://gitlab.com/gitlab-org/gitlab/-/issues/350190
# rubocop:disable Database/MultipleDatabases
def pages_per_offset(&block)
offset = 0
......@@ -61,5 +68,6 @@ module Pseudonymizer
break if results.count < PAGE_SIZE
end
end
# rubocop:enable Database/MultipleDatabases
end
end
......@@ -102,6 +102,9 @@ RSpec.describe Pseudonymizer::Dumper do
end
end
# Disable rubocop Database/MultipleDatabases cop until Pseudonymizer is removed
# See https://gitlab.com/gitlab-org/gitlab/-/issues/350190
# rubocop:disable Database/MultipleDatabases
describe "manifest is valid" do
it "all tables exist" do
existing_tables = ActiveRecord::Base.connection.tables
......@@ -130,4 +133,5 @@ RSpec.describe Pseudonymizer::Dumper do
end
end
end
# rubocop:enable Database/MultipleDatabases
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment