Backfill vulnerability risk_score on vulnerability ES index for Dedicated

Overview

With the implementation of the vulnerability_finding_risk_scores table backfill in MR !208437 (merged) , we now have calculated risk scores stored in the database for all vulnerability findings. However, existing documents in the Elasticsearch vulnerability index do not contain the risk_score field

Proposed Solution

Create an Elasticsearch migration to backfill the risk_score field for existing vulnerability documents in the ES index.

Implementation Approach

The migration will use the ::Search::Elastic::MigrationReindexBasedOnSchemaVersion helper. The backfill should only be run for Gitlab Dedicated deployment using skip_if directive

Edited by Schmil Monderer