WIP: Services jsonb inheritance experiment II
What does this MR do?
It evaluates the possibility to use a JSON field to store service settings and to merge those settings in order to implement settings field by field inheritance. Like described in #213568 (closed) (Option E)
Strategy
- Find a way to query a project service with all its ancestors to get all available settings.
- Find a way to merge those settings to have a valid set of inherited and overwritten settings.
- Boolean values are also settings, and they are used in queries like
project.services.push_hooks
. We need to find a way to implement the inheritance also for those settings.
Results
- This query can be used to get all services with ancestors.
- We can merge settings in ruby. This way it is also possible to use the
properties
field - If the boolean field allows
NULL
we can implement the inheritance in the merging loop. To query for those fields likeproject.services.push_hooks
, we can't use the scope anymore and need to implement a method that finds the right services on the application level
Next steps
We can try implementing this solution for a simple service that is using properties and don't have many hook options Good candidates are:
- AsanaService
- AssemblaService
- CampfireService
- EmailsOnPushService
- ExternalWikiService
- FlowdockService
- PivotaltrackerService
Edited by Andy Schoenen