Skip to content

Commit df6a235

Browse files
author
GitLab Bot
committed
Automatic merge of gitlab-org/omnibus-gitlab master
2 parents 61d7698 + 362603a commit df6a235

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

files/gitlab-cookbooks/package/libraries/deprecations.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,12 @@ def applicable_deprecations(incoming_version, existing_config, type)
550550
# Getting settings from gitlab.rb that are in deprecations list and
551551
# has been removed in incoming or a previous version.
552552
current_deprecations = list(existing_config).select { |deprecation| version >= Gem::Version.new(deprecation[type]) }
553-
current_deprecations.select { |deprecation| !existing_config.dig(*deprecation[:config_keys]).nil? }
553+
554+
# If the value of the configuration is `nil` or an empty hash (in case
555+
# of root configurations where ConfigMash logic in SettingsDSL will set
556+
# an empty Hash as the default value), then the configuration is a
557+
# valid deprecation that user has to be warned about.
558+
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?)) }
554559
end
555560

556561
def check_config(incoming_version, existing_config, type = :removal)

0 commit comments

Comments
 (0)