BE: Fix bug in the migration script to create new cluster agent mappings
MR: !159051 (merged)
Description
This issues addresses the bug encountered in the migration script MR which results in fewer mappings than expected.
The bug exists here in this segment:
project_namespaces_by_id.values.map(&:traversal_ids)[0] # pluck the root namespace from traversal ids
In the above bit of code, we want to capture the root groups of each project namespace. Instead, this will capture the traversal ids of the first project namespace. This results in a scenario where mappings are created only for 1 root group and all the candidate agents within this group, resulting in the reduced amount of migrated data. The data that has been migrated is still correct, so there is no need to delete the entries that have already been migrated. The bug need only be fixed and the background migration enqueued again.
[Provide any additional description here.]
Acceptance Criteria
-
Fix the bug and add specs to capture the edge case -
Noop the earlier migration job and add new post migration task to requeue the migration job.
Technical Requirements
Same as the acceptance criteria
Design Requirements
NA
Impact Assessment
NA
User Story
NA