Backfill traversal_ids and archived for existing `vulnerability_reads`
requested to merge 437675-implement-background-migration-to-set-traversal_ids-and-archived-columns-for-the-existing into master
What does this MR do and why?
Implement a background migration which fills in the archived
and traversal_ids
for existing vulnerability_read records from the respective owning project
and namespace
.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- Configure a repo with existing vulnerabilities and vuln reads and archive it
- Load this branch and run the migration
- Confirm all vulnerability_reads records have
archived
andtraversal_ids
are set correctly:- First to confirm that the archived projects archived value has been propagated correctly, this should be false:
Vulnerabilities::Read.where(project_id: <project_id>).where(archived: false).any?
- Then to confirm that all Traversal Ids have been set, this should be false too: (edited)
Vulnerabilities::Read.where(traversal_ids: []).any?
- First to confirm that the archived projects archived value has been propagated correctly, this should be false:
Related to #437675 (closed)
Edited by Mehmet Emin INAC