Keep vulnerability_statistics.archived in sync
Why are we doing this work
As part of #512592 (closed) we're adding a new archived column to the vulnerability_statistics table. This column must be kept in sync with the projects table. To do so, we register new workers that respond to ProjectArchivedEvent. Alternatively, we can reuse existing workers that are already registered for these events. See register_threat_insights_subscribers.
Relevant links
Non-functional requirements
-
Documentation: -
Feature flag: -
Performance: -
Testing:
Implementation plan
- Utilise the existing worker
ProcessArchivedEventsWorkerthat updates thearchivedproperty for a project's vulnerability-reads. - Create a new service (similar to
UpdateArchivedOfVulnerabilityReadsService) that will update the vulnerability statistic's archived property
Verification steps
- Archive a project with vulnerabilities
- Check if the
vulnerability_statisticrow associated with the project has thearchivedcolumn set
Edited by Arpit Gogia