summaryrefslogtreecommitdiff
path: root/lib/gitlab/background_migration
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-03-29 23:49:37 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-03-29 23:50:02 +0000
commit5f3e1225fc725ed303f3dee989e5b84fafb307d8 (patch)
tree8f56b3905e0e28a873b50940b66ffcddd7bcbd0a /lib/gitlab/background_migration
parent56ff640a2f919e9d0e450964081381a8eccef5e4 (diff)
downloadgitlab-ce-5f3e1225fc725ed303f3dee989e5b84fafb307d8.tar.gz
Add latest changes from gitlab-org/security/gitlab@15-10-stable-ee
Diffstat (limited to 'lib/gitlab/background_migration')
-rw-r--r--lib/gitlab/background_migration/nullify_last_error_from_project_mirror_data.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/gitlab/background_migration/nullify_last_error_from_project_mirror_data.rb b/lib/gitlab/background_migration/nullify_last_error_from_project_mirror_data.rb
new file mode 100644
index 00000000000..6ea5c17353b
--- /dev/null
+++ b/lib/gitlab/background_migration/nullify_last_error_from_project_mirror_data.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module BackgroundMigration
+ # Nullifies last_error value from project_mirror_data table as they
+ # potentially included sensitive data.
+ # https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/3041
+ class NullifyLastErrorFromProjectMirrorData < BatchedMigrationJob
+ feature_category :source_code_management
+ operation_name :update_all
+
+ def perform
+ each_sub_batch { |rel| rel.update_all(last_error: nil) }
+ end
+ end
+ end
+end