Populate `first_pipeline_id` and `latest_pipeline_id` for findings
Context
We want to drop the vulnerability_occurrence_pipelines table. In order to do this, we still need the first and latest pipeline ID stored somewhere to support the existing feature-set
We added columns to to the vulnerability_occurrences table
to accomplish this in #422382 (closed)
What does this MR do and why?
This change updates the vulnerability ingestion pipeline to start populating these columns.
It does this by:
- Making the
initial_pipeline_idcolumn a read-only attribute at the model layer with active record- This means we don't need any conditional logic in the task with regards to
initial_pipeline_idas AR sets read-only attributes only while creating the records and ignores them from updates
- This means we don't need any conditional logic in the task with regards to
- Updates the
#to_hashmethod inSecurity::Ingestion::FindingMapandSecurity::VulnerabilityScanning::FindingMapto set these attributes - Also sets these value in the
#build_vulnerability_findingmethod of theconcerns/vulnerability_finding_helpers
Related to #422384 (closed)
Resolves #449145 (closed)
Edited by Michael Becker