Merge pull request #8359 from ieQu1/bpapi-fix-check
fix(bpapi): Don't check forward compatibility from old release
This commit is contained in:
commit
3df86508bc
|
@ -106,9 +106,10 @@ check_compat(DumpFilenames) ->
|
||||||
|
|
||||||
%% Note: sets nok flag
|
%% Note: sets nok flag
|
||||||
-spec check_compat(fulldump(), fulldump()) -> ok.
|
-spec check_compat(fulldump(), fulldump()) -> ok.
|
||||||
check_compat(Dump1, Dump2) ->
|
check_compat(Dump1 = #{release := Rel1}, Dump2 = #{release := Rel2}) ->
|
||||||
check_api_immutability(Dump1, Dump2),
|
check_api_immutability(Dump1, Dump2),
|
||||||
typecheck_apis(Dump1, Dump2).
|
Rel2 >= Rel1 andalso
|
||||||
|
typecheck_apis(Dump1, Dump2).
|
||||||
|
|
||||||
%% It's not allowed to change BPAPI modules. Check that no changes
|
%% It's not allowed to change BPAPI modules. Check that no changes
|
||||||
%% have been made. (sets nok flag)
|
%% have been made. (sets nok flag)
|
||||||
|
@ -202,10 +203,15 @@ typecheck_rpc(Caller, Callee) ->
|
||||||
-spec get_param_types(dialyzer_dump(), emqx_bpapi:call()) -> param_types().
|
-spec get_param_types(dialyzer_dump(), emqx_bpapi:call()) -> param_types().
|
||||||
get_param_types(Signatures, {M, F, A}) ->
|
get_param_types(Signatures, {M, F, A}) ->
|
||||||
Arity = length(A),
|
Arity = length(A),
|
||||||
#{{M, F, Arity} := {_RetType, AttrTypes}} = Signatures,
|
case Signatures of
|
||||||
% assert
|
#{{M, F, Arity} := {_RetType, AttrTypes}} ->
|
||||||
Arity = length(AttrTypes),
|
% assert
|
||||||
maps:from_list(lists:zip(A, AttrTypes)).
|
Arity = length(AttrTypes),
|
||||||
|
maps:from_list(lists:zip(A, AttrTypes));
|
||||||
|
_ ->
|
||||||
|
logger:critical("Call ~p:~p/~p is not found in PLT~n", [M, F, Arity]),
|
||||||
|
error(badkey)
|
||||||
|
end.
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
%% Functions related to BPAPI dumping
|
%% Functions related to BPAPI dumping
|
||||||
|
|
Loading…
Reference in New Issue