Merge pull request #14227 from rabbitmq/show-deprecated-feature-state
Test (make) / Build and Xref (1.18, 26) (push) Waiting to run
Details
Test (make) / Build and Xref (1.18, 27) (push) Waiting to run
Details
Test (make) / Build and Xref (1.18, 28) (push) Waiting to run
Details
Test (make) / Test (1.18, 28, khepri) (push) Waiting to run
Details
Test (make) / Test (1.18, 28, mnesia) (push) Waiting to run
Details
Test (make) / Test mixed clusters (1.18, 28, khepri) (push) Waiting to run
Details
Test (make) / Test mixed clusters (1.18, 28, mnesia) (push) Waiting to run
Details
Test (make) / Type check (1.18, 28) (push) Waiting to run
Details
Trigger a 4.2.x alpha release build / trigger_alpha_build (push) Has been cancelled
Details
Test Authentication/Authorization backends via mutiple messaging protocols / selenium (chrome, 1.17.3, 27.3) (push) Has been cancelled
Details
Test Management UI with Selenium / selenium (chrome, 1.17.3, 27.3) (push) Has been cancelled
Details
Test Authentication/Authorization backends via mutiple messaging protocols / summary-selenium (push) Has been cancelled
Details
Test (make) / Build and Xref (1.18, 26) (push) Waiting to run
Details
Test (make) / Build and Xref (1.18, 27) (push) Waiting to run
Details
Test (make) / Build and Xref (1.18, 28) (push) Waiting to run
Details
Test (make) / Test (1.18, 28, khepri) (push) Waiting to run
Details
Test (make) / Test (1.18, 28, mnesia) (push) Waiting to run
Details
Test (make) / Test mixed clusters (1.18, 28, khepri) (push) Waiting to run
Details
Test (make) / Test mixed clusters (1.18, 28, mnesia) (push) Waiting to run
Details
Test (make) / Type check (1.18, 28) (push) Waiting to run
Details
Trigger a 4.2.x alpha release build / trigger_alpha_build (push) Has been cancelled
Details
Test Authentication/Authorization backends via mutiple messaging protocols / selenium (chrome, 1.17.3, 27.3) (push) Has been cancelled
Details
Test Management UI with Selenium / selenium (chrome, 1.17.3, 27.3) (push) Has been cancelled
Details
Test Authentication/Authorization backends via mutiple messaging protocols / summary-selenium (push) Has been cancelled
Details
Show current state of deprecated features
This commit is contained in:
commit
cdd9ba1bb6
|
@ -58,11 +58,13 @@ cli_info0(DeprecatedFeature) ->
|
||||||
|
|
||||||
App = maps:get(provided_by, FeatureProps),
|
App = maps:get(provided_by, FeatureProps),
|
||||||
DeprecationPhase = maps:get(deprecation_phase, FeatureProps, ""),
|
DeprecationPhase = maps:get(deprecation_phase, FeatureProps, ""),
|
||||||
|
State = maps:get(state, FeatureProps, ""),
|
||||||
Desc = maps:get(desc, FeatureProps, ""),
|
Desc = maps:get(desc, FeatureProps, ""),
|
||||||
DocUrl = maps:get(doc_url, FeatureProps, ""),
|
DocUrl = maps:get(doc_url, FeatureProps, ""),
|
||||||
Info = #{name => FeatureName,
|
Info = #{name => FeatureName,
|
||||||
desc => unicode:characters_to_binary(Desc),
|
desc => unicode:characters_to_binary(Desc),
|
||||||
deprecation_phase => DeprecationPhase,
|
deprecation_phase => DeprecationPhase,
|
||||||
|
state => State,
|
||||||
doc_url => unicode:characters_to_binary(DocUrl),
|
doc_url => unicode:characters_to_binary(DocUrl),
|
||||||
provided_by => App},
|
provided_by => App},
|
||||||
[Info | Acc]
|
[Info | Acc]
|
||||||
|
|
|
@ -361,9 +361,16 @@ get_warning(FeatureProps, Permitted) when is_map(FeatureProps) ->
|
||||||
%% @returns A map of selected deprecated features.
|
%% @returns A map of selected deprecated features.
|
||||||
|
|
||||||
list(all) ->
|
list(all) ->
|
||||||
maps:filter(
|
maps:map(fun(FeatureName, FeatureProps) ->
|
||||||
fun(_, FeatureProps) -> ?IS_DEPRECATION(FeatureProps) end,
|
FeatureProps#{state => case is_permitted_nolog(FeatureName)
|
||||||
rabbit_ff_registry_wrapper:list(all));
|
of
|
||||||
|
true -> permitted;
|
||||||
|
false -> denied
|
||||||
|
end}
|
||||||
|
end,
|
||||||
|
maps:filter(
|
||||||
|
fun(_, FeatureProps) -> ?IS_DEPRECATION(FeatureProps) end,
|
||||||
|
rabbit_ff_registry_wrapper:list(all)));
|
||||||
list(used) ->
|
list(used) ->
|
||||||
maps:filter(
|
maps:filter(
|
||||||
fun(FeatureName, FeatureProps) ->
|
fun(FeatureName, FeatureProps) ->
|
||||||
|
|
|
@ -12,9 +12,9 @@ defmodule RabbitMQ.CLI.Ctl.Commands.ListDeprecatedFeaturesCommand do
|
||||||
@behaviour RabbitMQ.CLI.CommandBehaviour
|
@behaviour RabbitMQ.CLI.CommandBehaviour
|
||||||
use RabbitMQ.CLI.DefaultOutput
|
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
|
def info_keys(), do: @info_keys
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ defmodule RabbitMQ.CLI.Ctl.Commands.ListDeprecatedFeaturesCommand do
|
||||||
def switches(), do: [used: :boolean]
|
def switches(), do: [used: :boolean]
|
||||||
|
|
||||||
def merge_defaults([], opts) do
|
def merge_defaults([], opts) do
|
||||||
{["name", "deprecation_phase"], Map.merge(%{used: false}, opts)}
|
{["name", "deprecation_phase", "state"], Map.merge(%{used: false}, opts)}
|
||||||
end
|
end
|
||||||
|
|
||||||
def merge_defaults(args, opts) do
|
def merge_defaults(args, opts) do
|
||||||
|
|
|
@ -24,12 +24,12 @@ defmodule ListDeprecatedFeaturesCommandTest do
|
||||||
@df1 => %{
|
@df1 => %{
|
||||||
desc: ~c"My deprecated feature #1",
|
desc: ~c"My deprecated feature #1",
|
||||||
provided_by: :ListDeprecatedFeaturesCommandTest,
|
provided_by: :ListDeprecatedFeaturesCommandTest,
|
||||||
deprecation_phase: :permitted_by_default
|
deprecation_phase: :permitted_by_default,
|
||||||
},
|
},
|
||||||
@df2 => %{
|
@df2 => %{
|
||||||
desc: ~c"My deprecated feature #2",
|
desc: ~c"My deprecated feature #2",
|
||||||
provided_by: :ListDeprecatedFeaturesCommandTest,
|
provided_by: :ListDeprecatedFeaturesCommandTest,
|
||||||
deprecation_phase: :removed
|
deprecation_phase: :removed,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,8 +47,8 @@ defmodule ListDeprecatedFeaturesCommandTest do
|
||||||
]
|
]
|
||||||
|
|
||||||
full_result = [
|
full_result = [
|
||||||
[{:name, @df1}, {:deprecation_phase, :permitted_by_default}],
|
[{:name, @df1}, {:deprecation_phase, :permitted_by_default}, {:state, :permitted}],
|
||||||
[{:name, @df2}, {:deprecation_phase, :removed}]
|
[{:name, @df2}, {:deprecation_phase, :removed}, {:state, :denied}]
|
||||||
]
|
]
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -65,7 +65,7 @@ defmodule ListDeprecatedFeaturesCommandTest do
|
||||||
end
|
end
|
||||||
|
|
||||||
test "merge_defaults with no command, print just use the names" do
|
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
|
end
|
||||||
|
|
||||||
test "validate: return bad_info_key on a single bad arg", context do
|
test "validate: return bad_info_key on a single bad arg", context do
|
||||||
|
@ -125,7 +125,7 @@ defmodule ListDeprecatedFeaturesCommandTest do
|
||||||
|
|
||||||
@tag test_timeout: 30000
|
@tag test_timeout: 30000
|
||||||
test "run: sufficiently long timeouts don't interfere with results", context do
|
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 ->
|
assert Enum.all?(context[:full_result], fn feature_name ->
|
||||||
Enum.find(matches_found, fn found -> found == feature_name end)
|
Enum.find(matches_found, fn found -> found == feature_name end)
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= fmt_sort('Name', 'name') %></th>
|
<th><%= fmt_sort('Name', 'name') %></th>
|
||||||
<th><%= fmt_sort('Deprecation phase', 'deprecation_phase') %></th>
|
<th><%= fmt_sort('Deprecation phase', 'deprecation_phase') %></th>
|
||||||
|
<th><%= fmt_sort('Current Configuration', 'state') %></th>
|
||||||
<th>Description</th>
|
<th>Description</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -43,6 +44,7 @@
|
||||||
<abbr class="status-<%= fmt_string(state_color) %>">In use</abbr>
|
<abbr class="status-<%= fmt_string(state_color) %>">In use</abbr>
|
||||||
<% } %>
|
<% } %>
|
||||||
<%= fmt_deprecation_phase(deprecated_feature.deprecation_phase, DEPRECATION_PHASES) %></td>
|
<%= fmt_deprecation_phase(deprecated_feature.deprecation_phase, DEPRECATION_PHASES) %></td>
|
||||||
|
<td><%= fmt_string(deprecated_feature.state) %></td>
|
||||||
<td>
|
<td>
|
||||||
<p><%= fmt_string(deprecated_feature.desc) %></p>
|
<p><%= fmt_string(deprecated_feature.desc) %></p>
|
||||||
<% if (deprecated_feature.doc_url) { %>
|
<% if (deprecated_feature.doc_url) { %>
|
||||||
|
|
Loading…
Reference in New Issue