Implement logic to reset `traversal_ids` and `archived` columns of the `sbom_occurrences` table
Why are we doing this work
As we are adding the traversal_ids
and archived
columns to the sbom_occurrences
table, we need a way to reset those attributes if the project moves from one namespace to another, or if the project's archived status changes, or if the namespace moves from one namespace to another.
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 reset the archived
column of thesbom_occurrences
table when that attribute changes for the project-
Create a worker which subscribes to Projects::ProjectArchivedEvent
and updates all thesbom_occurrence
records for the project (discussion)
-
-
backend Implement logic to reset the traversal_ids
column of thesbom_occurrences
table when the project moves from one namespace to another-
Create a worker which subscribes to Namespaces::TraveralIdsChangedEvent
and updates all thesbom_occurrences
for the namespace and its descendents
-
-
backend Implement logic to reset the traversal_ids
column of thesbom_occurrences
table when the namespace moves from one to another.-
Create a worker which subscribes to Projects::TraversalIdsChangedEvent
and updates all thesbom_occurrences
in the project.
-
Verification steps
TBD
Edited by Brian Williams