Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d452c7e8
Commit
d452c7e8
authored
Feb 23, 2022
by
Matt Kasa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Annotate uses of ActiveRecord::Base in Pseudonymizer
Relates to
https://gitlab.com/gitlab-org/gitlab/-/issues/350190
parent
1b94b01e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
3 deletions
+16
-3
.rubocop_todo/database/multiple_databases.yml
.rubocop_todo/database/multiple_databases.yml
+0
-3
ee/lib/pseudonymizer/dumper.rb
ee/lib/pseudonymizer/dumper.rb
+4
-0
ee/lib/pseudonymizer/pager.rb
ee/lib/pseudonymizer/pager.rb
+8
-0
ee/spec/lib/pseudonymizer/dumper_spec.rb
ee/spec/lib/pseudonymizer/dumper_spec.rb
+4
-0
No files found.
.rubocop_todo/database/multiple_databases.yml
View file @
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
...
...
ee/lib/pseudonymizer/dumper.rb
View file @
d452c7e8
...
...
@@ -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"
}
...
...
ee/lib/pseudonymizer/pager.rb
View file @
d452c7e8
...
...
@@ -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
ee/spec/lib/pseudonymizer/dumper_spec.rb
View file @
d452c7e8
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment