Let Gitlab::CurrentSettings read from ApplicationSetting and OrganizationSetting
Currently, Gitlab has instance-wide settings in ApplicationSetting
. Some of those settings are relevant for the instance, some for the Organization. So we expect that we will move settings to OrganizationSetting
model.
In the code base, Gitlab::CurrentSetting
is now a entry point for reading instance wide settings. We want to use that class also for OrganizationSetting
.
Implementation plan
-
Gitlab::CurrentSetting
will read setting fromApplicationSetting
- If that setting does not exist, it will read from setting
OrganizationSetting
- !135442 (merged) use Current Organization
- If we don't know the Current Organization, we return nothing (no fallback to default organization)
- For migration purposes, a setting can exist in both settings. the
ApplicationSetting
takes precedence
So the priority will not change yet. This is for performance reasons: we have more settings in ApplicationSetting
for now. In the future, we can change this and read from OrganizationSetting
first.