Backfill security_policy_id in compliance_framework_security_policies

What does this MR do and why?

Currently, when a policy is scoped with a compliance framework, we store the policy reference (by policy index in YAML file) and the framework in compliance_framework_security_policies. Now with the security policy read model (&13865) we store the policy in security_policies table.

As a part of Use security policy read model for compliance f... (#481786 - closed), we want to use the read model to link the reference between a security policy and the framework. The issue will have 4 MRs:

1️⃣ Add security_policy_id to compliance_framework_... (!185962 - merged)

2️⃣ Set security_policy_id to compliance_framework_... (!186019 - merged)

3️⃣ Update compliance framework graphql type to rea... (!186080 - closed)

➡️ 4️⃣ Backfill security_policy_id in compliance_frame... (!186097 - merged)

This MR introduces a background migration to backfill security_policy_id to old rows

References

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Sashi Kumar Kumaresan

Merge request reports

Loading