Verify or fix usages of ActiveRecord::Base in importers
We need to fix instances of using connection (or other incompatible methods) directly on ActiveRecord::Base to support multiple databases. Using the wrong DB connection when executing DB queries can lead to application failures or data corruption.
We have a number of these offenses in a rubocop todo file.
Specifically, we have a number of offenses from importer-related code. To resolve this, we should ensure all of these files have been checked and offenses removed. If for some reason the offense should remain ignored, add a comment to to the todo file stating it has been checked.
-
lib/gitlab/gitlab_import/importer.rb
https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/gitlab_import/importer.rb#L20 -
lib/gitlab/import_export/base/relation_factory.rb
https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/import_export/base/relation_factory.rb#L303 -
lib/gitlab/import_export/group/relation_tree_restorer.rb
https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/import_export/group/relation_tree_restorer.rb#L32 -
lib/gitlab/legacy_github_import/importer.rb
https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/legacy_github_import/importer.rb#L223
Edited by Patrick Bair