Geo Backend - Add "selective sync by organization" option
Problem
Geo supports selective synchronization by namespace. We should add the ability for a .com sysadmin to specify a set of organizations to replicate to a secondary site.
Proposal
-
Create a many-to-many relationship between GeoNode and Organizations::Organization. This requires a new model
GeoNodeOrganizationLink. See the GeoNodeNamespaceLink as an example. -
Update the GeoNode model to accept the new selective sync type
organizations. -
Update the replicable models
selective_sync_scopemethod to returnnonewhen theorganizationtype is selected. Implementing the query for each data type is a separate issue.Example:
Project.selective_sync_scopeoverride :selective_sync_scope def selective_sync_scope(node, **_params) return all unless node.selective_sync? if node.selective_sync_by_namespaces? where(arel_table.name => { namespace_id: node.namespaces_for_group_owned_replicables.select(:id) }) elsif node.selective_sync_by_shards? within_shards(node.selective_sync_shards) elsif node.selective_sync_by_organizations? none else none end end -
Ensure that everything is behind the
geo_selective_sync_by_organizationsfeature flag.
Next: Geo Frontend - Add "selective sync by organizat... (#570585 - closed)