Skip to content
Snippets Groups Projects
Commit 1c966dfd6e0b authored by Balasankar 'Balu' C's avatar Balasankar 'Balu' C
Browse files

Fix deprecation warnings for root configurations


Do not warn if nothing is set and the default empty
hash is returned for some configurations.

Signed-off-by: default avatarBalasankar 'Balu' C <balasankar@gitlab.com>
parent a03e6c9b33d9
3 merge requests!128heptapod#1534: making 1.5 the oldstable,!125heptapod#1494: make 1.5 the new stable,!124Upstream 16.11 quasi branching point
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment