Implement logic to reset `traversal_ids` and `archived` columns of the `vulnerability_reads` table
Why are we doing this work
As we are denormalizing our schema and copying the traversal_ids
and archived
columns to the vulnerability_reads
table, we need to implement a way to keep these columns in sync with the original versions.
Implementation plan
Important: Please keep in mind cases like moving the project to archived status and then non-archived status immediately while implementing the solutions for the following cases.
-
backend Implement logic to keep the archived
column of thevulnerability_reads
table in sync when that attribute changes for the project -
backend Implement logic to keep the traversal_ids
column of thevulnerability_reads
table in sync when the project moves from one namespace to another -
backend Implement logic to keep the traversal_ids
column of thevulnerability_reads
table in sync when the namespace moves from one to another -
backend Subscribe the event listeners once they have been deployed through the rollout of their feature flags #441433 (closed) and #442061 (closed)
Verification steps
-
The related vulnerability_reads
records of a project move to archived when the project is archived -
The related vulnerability_reads
records of an archived project move to unarchived when the project is not archived anymore -
The related vulnerability_reads
records of a project have the correcttraversal_ids
when the project moves to another namespace -
The related vulnerability_reads
records of a namespace have the correcttraversal_ids
when the namespace moves to another namespace
Edited by Gregory Havenga