New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: use string type for server and servers #9614
Conversation
e2737b7
to
168dd71
Compare
|
||
-export([resolve_dns/2]). | ||
|
||
%% @doc Mostly for meck. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: using the unstick
option doesn't work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a sticky module.
The issue of mocking inet_res
is it has too large of a scope which may cause the tests to become flaky.
end. | ||
|
||
%% HOCON tries to be very informative about all the detailed errors | ||
%% it's maybe too much when reporting to the user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be interesting to have a way to disable this compaction when more info is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah.
don't feel like it's a high prio at the moment.
168dd71
to
7e00fa0
Compare
@@ -18,151 +18,135 @@ | |||
|
|||
-include_lib("eunit/include/eunit.hrl"). | |||
|
|||
-define(DEFAULT_MONGO_PORT, 27017). | |||
srv_record_test() -> | |||
with_dns_mock( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also emqx_common_test_helpers:with_mock/4
.
this is to make dialyzer happy
c2b67c1
to
b30f2ea
Compare
Fixes https://emqx.atlassian.net/browse/EMQX-8600
Refactor the
server
andservers
fields schema to usestring()
type for better code reuss.Also better readability: the
server()
type was alist()
.This PR also included an enhancement to allow setting
host.name:port
from environment variable.Prior to this change, the
env EMQX_BRIDGES__MQTT__AAA__SERVER='localhost:1883'
is parsed as#{<<"server">> => #{<<"localhost" => 1883}}
then end up in a type check failure.This has caused quite some confusion for users who don't know that the value has to be quoted.
After this fix, the
converter
forserver
andservers
will try to format the map back to comma-separatedhost.name:port
list.PR Checklist
Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:
changes/
dir