Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-11 00:07:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-11 00:07:33 +0300
commit667f6fbc8df6c23f69bc6adba15204f8559bcc3a (patch)
treeb7d2bd14383e8fffc923b6bea051545cf59031f6 /lib/gitlab/background_migration.rb
parent6f0f893bd87535b61e0ecb1ce069eaa7fcb9e5be (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/background_migration.rb')
-rw-r--r--lib/gitlab/background_migration.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/background_migration.rb b/lib/gitlab/background_migration.rb
index 61e0a075018..ddd6b11eebb 100644
--- a/lib/gitlab/background_migration.rb
+++ b/lib/gitlab/background_migration.rb
@@ -78,6 +78,20 @@ module Gitlab
end
def self.migration_class_for(class_name)
+ # We don't pass class name with Gitlab::BackgroundMigration:: prefix anymore
+ # but some jobs could be already spawned so we need to have some backward compatibility period.
+ # Can be removed since 13.x
+ full_class_name_prefix_regexp = /\A(::)?Gitlab::BackgroundMigration::/
+
+ if class_name.match(full_class_name_prefix_regexp)
+ Gitlab::ErrorTracking.track_and_raise_for_dev_exception(
+ StandardError.new("Full class name is used"),
+ class_name: class_name
+ )
+
+ class_name = class_name.sub(full_class_name_prefix_regexp, '')
+ end
+
const_get(class_name, false)
end