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