Skip to content
Snippets Groups Projects
Commit 493b4b8f authored by Jaime Martinez's avatar Jaime Martinez
Browse files

Add deprecation notice for threshold params

Changelog: deprecated
parent 5008e953
No related branches found
No related tags found
1 merge request!137Remerge after conversion fixups
......@@ -361,6 +361,12 @@
deprecation: '16.10',
removal: '17.0',
note: "`omnibus_gitconfig` will be removed in GitLab 17.0. For details and migration instructions, please see: https://docs.gitlab.com/ee/update/versions/gitlab_16_changes.html#gitlabomnibus_gitconfig-deprecation"
},
{
config_keys: %w(registry default_notifications_threshold),
deprecation: '17.1',
removal: '18.0',
note: "`registry['default_notifications_threshold'] will be removed in 18.0. Please use `default_notifications_maxretries` instead https://gitlab.com/gitlab-org/container-registry/-/issues/1243."
}
]
......@@ -600,6 +606,14 @@
messages += deprecate_only_if_value(incoming_version, existing_config, type, ['praefect'], 'failover_election_strategy', 'sql', '13.12', '14.0', note: praefect_note, ignore_deprecation: true)
messages += deprecate_only_if_value(incoming_version, existing_config, type, ['praefect'], 'failover_election_strategy', 'local', '13.12', '14.0', note: praefect_note, ignore_deprecation: true)
grafana_note = <<~EOS
The bundled Grafana is deprecated and no longer available. We recommond following
https://docs.gitlab.com/ee/administration/monitoring/performance/grafana_configuration.html#deprecation.
EOS
messages += deprecate_only_if_value(incoming_version, existing_config, type, ['monitoring', 'grafana'], 'enable', true, '16.0', '16.3', note: grafana_note)
messages += deprecate_registry_notifications(incoming_version, existing_config, type, ['registry', 'notifications'], 'threshold', 17.1, 18.0)
messages
end
......@@ -630,6 +644,40 @@
messages
end
def deprecate_registry_notifications(incoming_version, existing_config, type, config_keys, key, deprecated_version, removed_version)
settings = existing_config.dig(*config_keys) || []
return [] if settings.empty?
notifications_note =
case key
when "threshold"
<<~EOS
Starting with GitLab 18.0, `registry['notifications'][{'threshold'=> value}] will be removed.
Please use `maxretries` instead https://gitlab.com/gitlab-org/container-registry/-/issues/1243.
EOS
else
""
end
messages = []
settings.to_a.each do |setting|
next unless setting.key?(key)
if Gem::Version.new(incoming_version) >= Gem::Version.new(removed_version) && type == :removal
message = "* #{config_keys[0]}['#{config_keys[1]}'][{#{key} => value}] has been deprecated since #{deprecated_version} and was removed in #{removed_version}."
message += " #{notifications_note}"
messages << message
elsif Gem::Version.new(incoming_version) >= Gem::Version.new(deprecated_version) && type == :deprecation
message = "*#{config_keys[0]}['#{config_keys[1]}'][{#{key} => value}] has been deprecated since #{deprecated_version} and will be removed in #{removed_version}."
message += " #{notifications_note}"
messages << message
end
end
messages
end
end
class NodeAttribute < ObjectProxy
......
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