diff --git a/deps/rabbit/src/rabbit_depr_ff_extra.erl b/deps/rabbit/src/rabbit_depr_ff_extra.erl index 2b4998433167..237d019449c4 100644 --- a/deps/rabbit/src/rabbit_depr_ff_extra.erl +++ b/deps/rabbit/src/rabbit_depr_ff_extra.erl @@ -58,11 +58,13 @@ cli_info0(DeprecatedFeature) -> App = maps:get(provided_by, FeatureProps), DeprecationPhase = maps:get(deprecation_phase, FeatureProps, ""), + State = maps:get(state, FeatureProps, ""), Desc = maps:get(desc, FeatureProps, ""), DocUrl = maps:get(doc_url, FeatureProps, ""), Info = #{name => FeatureName, desc => unicode:characters_to_binary(Desc), deprecation_phase => DeprecationPhase, + state => State, doc_url => unicode:characters_to_binary(DocUrl), provided_by => App}, [Info | Acc] diff --git a/deps/rabbit/src/rabbit_deprecated_features.erl b/deps/rabbit/src/rabbit_deprecated_features.erl index ffafec5757b9..119df2e2f0bd 100644 --- a/deps/rabbit/src/rabbit_deprecated_features.erl +++ b/deps/rabbit/src/rabbit_deprecated_features.erl @@ -361,9 +361,16 @@ get_warning(FeatureProps, Permitted) when is_map(FeatureProps) -> %% @returns A map of selected deprecated features. list(all) -> - maps:filter( - fun(_, FeatureProps) -> ?IS_DEPRECATION(FeatureProps) end, - rabbit_ff_registry_wrapper:list(all)); + maps:map(fun(FeatureName, FeatureProps) -> + FeatureProps#{state => case is_permitted_nolog(FeatureName) + of + true -> permitted; + false -> denied + end} + end, + maps:filter( + fun(_, FeatureProps) -> ?IS_DEPRECATION(FeatureProps) end, + rabbit_ff_registry_wrapper:list(all))); list(used) -> maps:filter( fun(FeatureName, FeatureProps) -> diff --git a/deps/rabbitmq_cli/lib/rabbitmq/cli/ctl/commands/list_deprecated_features_command.ex b/deps/rabbitmq_cli/lib/rabbitmq/cli/ctl/commands/list_deprecated_features_command.ex index e1845cce274f..fa2507341830 100644 --- a/deps/rabbitmq_cli/lib/rabbitmq/cli/ctl/commands/list_deprecated_features_command.ex +++ b/deps/rabbitmq_cli/lib/rabbitmq/cli/ctl/commands/list_deprecated_features_command.ex @@ -12,9 +12,9 @@ defmodule RabbitMQ.CLI.Ctl.Commands.ListDeprecatedFeaturesCommand do @behaviour RabbitMQ.CLI.CommandBehaviour use RabbitMQ.CLI.DefaultOutput - def formatter(), do: RabbitMQ.CLI.Formatters.Table + def formatter(), do: RabbitMQ.CLI.Formatters.PrettyTable - @info_keys ~w(name deprecation_phase provided_by desc doc_url)a + @info_keys ~w(name deprecation_phase state provided_by desc doc_url)a def info_keys(), do: @info_keys @@ -23,7 +23,7 @@ defmodule RabbitMQ.CLI.Ctl.Commands.ListDeprecatedFeaturesCommand do def switches(), do: [used: :boolean] def merge_defaults([], opts) do - {["name", "deprecation_phase"], Map.merge(%{used: false}, opts)} + {["name", "deprecation_phase", "state"], Map.merge(%{used: false}, opts)} end def merge_defaults(args, opts) do diff --git a/deps/rabbitmq_cli/test/ctl/list_deprecated_features_command_test.exs b/deps/rabbitmq_cli/test/ctl/list_deprecated_features_command_test.exs index d7bbf0f89529..240818a6fb4f 100644 --- a/deps/rabbitmq_cli/test/ctl/list_deprecated_features_command_test.exs +++ b/deps/rabbitmq_cli/test/ctl/list_deprecated_features_command_test.exs @@ -24,12 +24,12 @@ defmodule ListDeprecatedFeaturesCommandTest do @df1 => %{ desc: ~c"My deprecated feature #1", provided_by: :ListDeprecatedFeaturesCommandTest, - deprecation_phase: :permitted_by_default + deprecation_phase: :permitted_by_default, }, @df2 => %{ desc: ~c"My deprecated feature #2", provided_by: :ListDeprecatedFeaturesCommandTest, - deprecation_phase: :removed + deprecation_phase: :removed, } } @@ -47,8 +47,8 @@ defmodule ListDeprecatedFeaturesCommandTest do ] full_result = [ - [{:name, @df1}, {:deprecation_phase, :permitted_by_default}], - [{:name, @df2}, {:deprecation_phase, :removed}] + [{:name, @df1}, {:deprecation_phase, :permitted_by_default}, {:state, :permitted}], + [{:name, @df2}, {:deprecation_phase, :removed}, {:state, :denied}] ] { @@ -65,7 +65,7 @@ defmodule ListDeprecatedFeaturesCommandTest do end test "merge_defaults with no command, print just use the names" do - assert match?({["name", "deprecation_phase"], %{}}, @command.merge_defaults([], %{})) + assert match?({["name", "deprecation_phase", "state"], %{}}, @command.merge_defaults([], %{})) end test "validate: return bad_info_key on a single bad arg", context do @@ -125,7 +125,7 @@ defmodule ListDeprecatedFeaturesCommandTest do @tag test_timeout: 30000 test "run: sufficiently long timeouts don't interfere with results", context do - matches_found = @command.run(["name", "deprecation_phase"], context[:opts]) + matches_found = @command.run(["name", "deprecation_phase", "state"], context[:opts]) assert Enum.all?(context[:full_result], fn feature_name -> Enum.find(matches_found, fn found -> found == feature_name end) diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/deprecated-features.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/deprecated-features.ejs index 341d34e85dfc..610f98854ce8 100644 --- a/deps/rabbitmq_management/priv/www/js/tmpl/deprecated-features.ejs +++ b/deps/rabbitmq_management/priv/www/js/tmpl/deprecated-features.ejs @@ -24,6 +24,7 @@
<%= fmt_string(deprecated_feature.desc) %>
<% if (deprecated_feature.doc_url) { %>