Skip to content

Refactor security policy read model to use PORO for policy content

Why are we doing this work

With Use database read model for merge request appr... (&9971 - closed) we create security_policies table to persist the policy YAML content. But the model class(Security::Policy) has methods related to all policy types, which would reduce the code quality once new policy types are introduced. Currently, reading the policy content is also not modular, as the policy content are read as JSON hash from content jsonb column.

As a part of this issue, we want to create PORO classes for each of the policy types to make the accessibility of policy content in a modular way. We also want to move the model methods specific to each policy type into individual classes.

Relevant links

Non-functional requirements

  • Documentation:
  • Feature flag:
  • Performance:
  • Testing:

Implementation plan

Verification steps

Edited by 🤖 GitLab Bot 🤖