Vulnerability UUID Migration Phase 2: Backfill new_uuid for existing vulnerabilities
Problem
After Phase 1 (#587624) starts populating new_uuid for new vulnerabilities, existing vulnerabilities will still have NULL values in the new_uuid column. We need to backfill these with definition-level UUIDs.
Background
UUID composition for Vulnerability (definition - location-agnostic):
- Report type
- Primary identifier fingerprint
- Project ID
NOT included:
- Location fingerprint
- Security_project_tracked_context_id
Implementation
- Create a batched background migration (BBM) to backfill
new_uuidfor all vulnerabilities wherenew_uuid IS NULL - The migration should:
- Process rows in batches to avoid locking issues
- Calculate the definition-level UUID using
Security::VulnerabilityUUID(without location) - Join to findings to get primary identifier fingerprint
- Add migration tracking and monitoring
- Verify completion before proceeding to Phase 3
Acceptance Criteria
- BBM created and tested
-
All existing vulnerabilities have
new_uuidpopulated - Migration completes successfully on GitLab.com
- No performance degradation during migration
Dependencies
- Blocked by #587624 (Phase 1 must be complete first)
Related
- Part of Vulnerability UUID migration series
- #587624 - Phase 1: Start populating new_uuid
- Related to #587625 (closed) (Finding UUID - context-aware)