Keep vulnerability_statistics.traversal_ids in sync
Why are we doing this work
As part of #512592 (closed) we're adding a new traversal_ids column to the vulnerability_statistics table. This column must be kept in sync with the projects and namespaces tables. To do so, we register new workers that respond to ProjectTransferedEvent and GroupTransferedEvent. Alternatively, we can reuse existing workers that are already registered for these events. See register_threat_insights_subscribers.
Relevant links
Non-functional requirements
DocumentationFeature flag-
Performance: SQL queries -
Testing: specs
Implementation plan
Very similar to the current implementation of UpdateNamespaceIdsOfVulnerabilityReadsWorker
Also refer to #513028 (comment 2295959180)
Verification steps
-
Move a test project that has vulnerabilities and vulnerability_statisticsrecord. -
Check the log, and look for a successful "update traversal ids" job. -
Check the database, and see whether traversal_idshas been updated for theproject_id.
Edited by Fabien Catteau