Project push rules: Move push rules inheritance logic in services and finders
Context
The following discussion from !188997 (merged) should be addressed:
-
@vyaklushinstarted a discussion: (+2 comments)thought (non-blocking):
PushRuleentity currently represents both:- A simple ActiveRecord instance
- Some weird interface to read/write calculated push rules
We might need to refactor this in the future, as it gets very complicated if we apply the same approach for
OrganizationPushRuleandGroupPushRule.Here's what I'm thinking:
- Extract read/write complex attributes logic from
PushRuleinto services and finders - Use pure ActiveRecord objects to only represent project, group and organization rows in the database
- Handle the logic of calculating push rules (considering inheritance) in services and finders
Edited by 🤖 GitLab Bot 🤖