Skip to content

Commit 362603a

Browse files
Robert Marshallbalasankarc
andcommitted
Merge branch 'fix-omnibus-gitconfig-deprecation' into 'master'
Fix deprecation warnings for root configurations See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7501 Merged-by: Robert Marshall <[email protected]> Approved-by: Robert Marshall <[email protected]> Reviewed-by: Ryan Egesdahl <[email protected]> Co-authored-by: Balasankar 'Balu' C <[email protected]>
2 parents 454718e + fca4d4f commit 362603a

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)