Skip to content

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

  1. Utilise the existing worker ProcessArchivedEventsWorker that updates the archived property for a project's vulnerability-reads.
  2. Create a new service (similar to UpdateArchivedOfVulnerabilityReadsService) that will update the vulnerability statistic's archived property

Verification steps

  1. Archive a project with vulnerabilities
  2. Check if the vulnerability_statistic row associated with the project has the archived column set
Edited by Arpit Gogia