diff --git a/files/gitlab-cookbooks/package/libraries/deprecations.rb b/files/gitlab-cookbooks/package/libraries/deprecations.rb index a03e6c9b33d970ba1e2f06c7e268492b7545ed3c_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9wYWNrYWdlL2xpYnJhcmllcy9kZXByZWNhdGlvbnMucmI=..deecf1eceaa8290767ba5747e82a835d788b9973_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9wYWNrYWdlL2xpYnJhcmllcy9kZXByZWNhdGlvbnMucmI= 100644 --- a/files/gitlab-cookbooks/package/libraries/deprecations.rb +++ b/files/gitlab-cookbooks/package/libraries/deprecations.rb @@ -550,7 +550,12 @@ # Getting settings from gitlab.rb that are in deprecations list and # has been removed in incoming or a previous version. current_deprecations = list(existing_config).select { |deprecation| version >= Gem::Version.new(deprecation[type]) } - current_deprecations.select { |deprecation| !existing_config.dig(*deprecation[:config_keys]).nil? } + + # If the value of the configuration is `nil` or an empty hash (in case + # of root configurations where ConfigMash logic in SettingsDSL will set + # an empty Hash as the default value), then the configuration is a + # valid deprecation that user has to be warned about. + current_deprecations.select { |deprecation| !(existing_config.dig(*deprecation[:config_keys]).nil? || (existing_config.dig(*deprecation[:config_keys]).is_a?(Hash) && existing_config.dig(*deprecation[:config_keys])&.empty?)) } end def check_config(incoming_version, existing_config, type = :removal)