Mark Organization and Group as "not isolated"
Organizations and groups can be marked as 'isolated': the group/organization does not reference any data from other organizations.
We have cases that this isolation will break. Examples include:
- Mentioning a merge request from another organization
- Adding users that are part of another organization
For now, we will not block breaking the isolation status. We will update the isolation status to false.
Implementation
Based on the sharding key, we know to what organization a certain database record belongs.
- Updates to sharding keys are ignored: they will move the database record to another group or organization
- Updates to records that are already a part of a non-isolated group or organization, we can skip the check
- If a non-sharding column is updated:
- and the column is referencing another record: we check if the other record is part of the same organization
- and the column is not referencing another record: we can skip the check
We need to check the 'root organization' and 'root group' for a given database record. Since that operation is quite expensive, we will use a worker. The worker will only be scheduled if relevant changes are detected.
Edited by Rutger Wessels