diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-10 21:07:33 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-10 21:07:33 +0000 |
commit | 667f6fbc8df6c23f69bc6adba15204f8559bcc3a (patch) | |
tree | b7d2bd14383e8fffc923b6bea051545cf59031f6 /lib | |
parent | 6f0f893bd87535b61e0ecb1ce069eaa7fcb9e5be (diff) | |
download | gitlab-ce-667f6fbc8df6c23f69bc6adba15204f8559bcc3a.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/background_migration.rb | 14 |
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 |