Migrate scan_result_policy_reads service callers to approval_policy_source

What does this MR do and why?

This MR is the second step in moving away from the legacy policy data table. MR1 introduced the adapter that can read from either the old or new table. This MR goes through every service that previously reached into the old table directly and rewires them to use the adapter instead. After this change, these services no longer care which table the data comes from — the adapter handles the routing transparently based on the feature flag.

MR Chain

This is part 2 of 4 in the scan_result_policies deprecation chain:

  1. !231013 (merged) — Foundation: ApprovalPolicySource adapter, feature flag, ApprovalRuleLike integration
  2. !231014 (merged) — Service callers (this MR): Migrate ~10 services/libs from scan_result_policy_read to approval_policy_source
  3. !231015 — Project queries: Flag-aware has_approval_policy_rules? and approval_policy_rules_targeting_commits on Project
  4. !231016 — Violation FK handling: Flag-gated violation create/delete using approval_policy_rule_id

References

#510281

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.

Related to #510281

Edited by Sashi Kumar Kumaresan

Merge request reports

Loading