Skip to content

Commit 14ae1b5

Browse files
committed
rabbit_feature_flags: Initialize registry in rabbit_ff_registry:inventory/0
With the way the registry is used in the feature flags controller, the registry was never initialized if `feature_flags_v2` was enabled out-of-the-box (i.e. once marked as required). The bug was discovered after marking `feature_flags_v2` as required and removing the v1 code: the `feature_flags_v2_SUITE` testsuite failed because the controller got an empty inventory when it called `rabbit_ff_registry:inventory()`.
1 parent 356da26 commit 14ae1b5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

deps/rabbit/src/rabbit_ff_registry.erl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,11 @@ is_registry_written_to_disk() ->
165165
-spec inventory() -> rabbit_feature_flags:inventory().
166166

167167
inventory() ->
168-
#{applications => [],
169-
feature_flags => #{},
170-
states => #{}}.
168+
rabbit_ff_registry_factory:initialize_registry(),
169+
Inventory = #{applications => [],
170+
feature_flags => #{},
171+
states => #{}},
172+
?convince_dialyzer(?MODULE:inventory(), Inventory, Inventory).
171173

172174
always_return_true() ->
173175
%% This function is here to trick Dialyzer. We want some functions

0 commit comments

Comments
 (0)