Skip to content

Backfill traversal_ids and archived for existing `vulnerability_reads`

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

  1. Configure a repo with existing vulnerabilities and vuln reads and archive it
  2. Load this branch and run the migration
  3. Confirm all vulnerability_reads records have archived and traversal_ids are set correctly:
    1. First to confirm that the archived projects archived value has been propagated correctly, this should be false:
      1. Vulnerabilities::Read.where(project_id: <project_id>).where(archived: false).any?
    2. Then to confirm that all Traversal Ids have been set, this should be false too: (edited) 
      1. Vulnerabilities::Read.where(traversal_ids: []).any?

Related to #437675 (closed)

Edited by Mehmet Emin INAC

Merge request reports