Skip to content

Refactor Gitlab::CurrentSettings so it has less ApplicationSetting-specific code

We are adding OrganizationSettings. These will be migrated from ApplicationSettings. Currently, settings are read using Gitlab::CurrentSetting.<setting_name>. We expect that this syntax does not need to be changed. So in a next step, we can change Gitlab::Currentsetting` so it will read from both OrganizationSettings and ApplicationSettings, which will make migration of settings more easy.

Currently, the CurrentSetting class is not only caching and returning settings but also has logic that takes care of availability of settings in case of missing database connection, missing application setting record and application settings for test environment.

Implementation

There will be two MR's:

  • First MR will move the cached_application_settings logic to a new ApplicationSettingFetcher class
  • Second MR will take care of the uncached_application_settings logic and moves it to the same class

If we have those two MR's merged, we can work on #434507 (closed)

Edited by Rutger Wessels