Add missing demodulize call to class name
What does this MR do and why?
Describe in detail what your merge request does and why.
The BackfillJiraTrackerDeploymentType2
migration job added originally via !46368 (merged) 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
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
N/A
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Simulate a pending job for
BackfillJiraTrackerDeploymentType2
by running the following PSQL insert (change ID in first column as necessary):insert into background_migration_jobs values (4, '2021-02-20 06:49:53.995423+00', '2021-02-20 06:49:53.995423+00', 0, 'BackfillJiraTrackerDeploymentType2', '[1,113]');
- Try to run the migration again, expecting it to complete and update the status table:
Gitlab::BackgroundMigration.perform("BackfillJiraTrackerDeploymentType2", [1, 113])
- Prior to patch, observe that the inserted record remains
0
forstatus
column - After the patch, the
status
updates to1
to indicate completed
More context can be found in internal slack thread on #g_database: https://gitlab.slack.com/archives/CNZ8E900G/p1644287755045969
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.