Skip to content

Project push rules: Move push rules inheritance logic in services and finders

Context

The following discussion from !188997 (merged) should be addressed:

  • @vyaklushin started a discussion: (+2 comments)

    thought (non-blocking): PushRule entity currently represents both:

    1. A simple ActiveRecord instance
    2. 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 OrganizationPushRule and GroupPushRule.

    Here's what I'm thinking:

    • Extract read/write complex attributes logic from PushRule into 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 🤖