Commit 508f626e authored by Harsh Chouraria's avatar Harsh Chouraria Committed by Ethan Urie

Add missing demodulize call to class name

The `BackfillJiraTrackerDeploymentType2` migration is remaining
stuck in pending
state at various customers because the job state update implementation
is passing the wrong string when sending a class name for lookup

The other migrations that do similar things
use the `demodulize` function
to transform a module name into just the unqualified classname but this
migration appears to have missed it

This change adds the missing method call to ensure future migration runs
(for yet-to-upgrade customers, or customers trying to re-run this) 
update the background migration jobs table correctly
parent 7c7bbf51
...@@ -79,7 +79,7 @@ module Gitlab ...@@ -79,7 +79,7 @@ module Gitlab
end end
def mark_jobs_as_succeeded(*arguments) def mark_jobs_as_succeeded(*arguments)
Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(self.class.name, arguments) Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(self.class.name.demodulize, arguments)
end end
end end
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
RSpec.shared_examples 'marks background migration job records' do RSpec.shared_examples 'marks background migration job records' do
it 'marks each job record as succeeded after processing' do it 'marks each job record as succeeded after processing' do
create(:background_migration_job, class_name: "::#{described_class.name}", create(:background_migration_job, class_name: "::#{described_class.name.demodulize}",
arguments: arguments) arguments: arguments)
expect(::Gitlab::Database::BackgroundMigrationJob).to receive(:mark_all_as_succeeded).and_call_original expect(::Gitlab::Database::BackgroundMigrationJob).to receive(:mark_all_as_succeeded).and_call_original
...@@ -13,7 +13,7 @@ RSpec.shared_examples 'marks background migration job records' do ...@@ -13,7 +13,7 @@ RSpec.shared_examples 'marks background migration job records' do
end end
it 'returns the number of job records marked as succeeded' do it 'returns the number of job records marked as succeeded' do
create(:background_migration_job, class_name: "::#{described_class.name}", create(:background_migration_job, class_name: "::#{described_class.name.demodulize}",
arguments: arguments) arguments: arguments)
jobs_updated = subject.perform(*arguments) jobs_updated = subject.perform(*arguments)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment