-
Notifications
You must be signed in to change notification settings - Fork 428
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
Add mod_caps_rdbms #4211
Add mod_caps_rdbms #4211
Conversation
44925a2
to
165afab
Compare
elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / 165afab small_tests_25 / small_tests / 165afab small_tests_26 / small_tests / 165afab small_tests_26_arm64 / small_tests / 165afab ldap_mnesia_25 / ldap_mnesia / 165afab dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 165afab dynamic_domains_mysql_redis_26 / mysql_redis / 165afab dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 165afab ldap_mnesia_26 / ldap_mnesia / 165afab pgsql_mnesia_25 / pgsql_mnesia / 165afab dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / 165afab mysql_redis_26 / mysql_redis / 165afab pgsql_mnesia_26 / pgsql_mnesia / 165afab pgsql_cets_26 / pgsql_cets / 165afab internal_mnesia_26 / internal_mnesia / 165afab mssql_mnesia_26 / odbc_mssql_mnesia / 165afab graphql_muc_light_SUITE:admin_cli:admin_muc_light:admin_create_room_with_unprepped_id{error,
{#{what => invalid_response_code,expected_type => ok,
response_code => {exit_status,1}},
[{graphql_helper,assert_response_code,2,
[{file,"/home/circleci/project/big_tests/tests/graphql_helper.erl"},
{line,256}]},
{graphql_helper,get_ok_value,2,
[{file,"/home/circleci/project/big_tests/tests/graphql_helper.erl"},
{line,239}]},
{graphql_muc_light_SUITE,admin_create_room_with_unprepped_id,1,
[{file,
"/home/circleci/project/big_tests/tests/graphql_muc_light_SUITE.erl"},
{line,1156}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1302}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1234}]}]}} graphql_muc_light_SUITE:domain_admin:domain_admin_muc_light:admin_create_room_with_unprepped_id{error,
{{badmatch,null},
[{graphql_muc_light_SUITE,admin_create_room_with_unprepped_id,1,
[{file,
"/home/circleci/project/big_tests/tests/graphql_muc_light_SUITE.erl"},
{line,1155}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1302}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1234}]}]}} |
165afab
to
4e259b1
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #4211 +/- ##
==========================================
- Coverage 84.32% 84.31% -0.02%
==========================================
Files 549 552 +3
Lines 33432 33458 +26
==========================================
+ Hits 28191 28209 +18
- Misses 5241 5249 +8 ☔ View full report in Codecov by Sentry. |
elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / 4e259b1 small_tests_25 / small_tests / 4e259b1 small_tests_26 / small_tests / 4e259b1 small_tests_26_arm64 / small_tests / 4e259b1 ldap_mnesia_25 / ldap_mnesia / 4e259b1 ldap_mnesia_26 / ldap_mnesia / 4e259b1 dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 4e259b1 dynamic_domains_mysql_redis_26 / mysql_redis / 4e259b1 dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 4e259b1 internal_mnesia_26 / internal_mnesia / 4e259b1 dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / 4e259b1 pgsql_cets_26 / pgsql_cets / 4e259b1 pgsql_mnesia_25 / pgsql_mnesia / 4e259b1 mysql_redis_26 / mysql_redis / 4e259b1 pgsql_mnesia_26 / pgsql_mnesia / 4e259b1 mssql_mnesia_26 / odbc_mssql_mnesia / 4e259b1 internal_mnesia_26 / internal_mnesia / 4e259b1 |
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 all seems fine, but if we're introducing schema changes, it'd be sure they're final, before then one day in the future we decide to optimise this and then we'll have to request our users to migrate data they already have. No need to ensure this now, but, would be good before a future release
big_tests/tests/muc_helper.erl
Outdated
@@ -66,7 +66,7 @@ load_muc(HostType) -> | |||
hibernated_room_timeout => 2000, | |||
access => muc, access_create => muc_create}, | |||
LogOpts = #{outdir => "/tmp/muclogs", access_log => muc}, | |||
dynamic_modules:start(HostType, mod_muc, make_opts(Opts)), | |||
Res = dynamic_modules:start(HostType, mod_muc, make_opts(Opts)), |
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.
What's this needed for?
big_tests/tests/pep_SUITE.erl
Outdated
HostType = domain_helper:host_type(), | ||
Backend = mongoose_helper:get_backend_mnesia_rdbms(HostType), | ||
[{mod_caps, config_parser_helper:mod_config(mod_caps, #{backend => Backend})}, |
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.
This feels repetitive across suites, don't we have some helper for this somewhere else? If we don't then no need to change, but if there's one it'd be good to use 🤔
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.
sadly we do not, could add some mod_config_with_auto_backend/2
somewhere...
src/mod_caps.erl
Outdated
@@ -115,10 +110,13 @@ config_spec() -> | |||
items = #{<<"cache_size">> => #option{type = integer, | |||
validate = positive}, | |||
<<"cache_life_time">> => #option{type = integer, | |||
validate = positive} | |||
validate = positive}, | |||
<<"backend">> => #option{type = atom, |
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.
Indentation 👀
elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / a6cd240 small_tests_25 / small_tests / a6cd240 small_tests_26 / small_tests / a6cd240 small_tests_26_arm64 / small_tests / a6cd240 ldap_mnesia_25 / ldap_mnesia / a6cd240 sm_SUITE:ping_timeout{error,
{{badmatch,
[{xmlel,<<"iq">>,
[{<<"type">>,<<"error">>},
{<<"to">>,<<"localhost">>},
{<<"from">>,
<<"alice_ping_timeout_1859@localhost/escalus-default-resource">>},
{<<"id">>,<<"96a3597d436e3a4d">>}],
[{xmlel,<<"ping">>,[{<<"xmlns">>,<<"urn:xmpp:ping">>}],[]},
{xmlel,<<"error">>,
[{<<"code">>,<<"503">>},{<<"type">>,<<"cancel">>}],
[{xmlel,<<"service-unavailable">>,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>}],
[]},
{xmlel,<<"text">>,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>}],
[{xmlcdata,<<"Route offline">>}]}]}]},
{xmlel,<<"iq">>,
[{<<"type">>,<<"error">>},
{<<"to">>,<<"localhost">>},
{<<"from">>,
<<"alice_ping_timeout_1859@localhost/escalus-default-resource">>},
{<<"id">>,<<"396603b92f7e9af0">>}],
[{xmlel,<<"ping">>,[{<<"xmlns">>,<<"urn:xmpp:ping">>}],[]},
{xmlel,<<"error">>,
[{<<"code">>,<<"503">>},{<<"type">>,<<"cancel">>}],
[{xmlel,<<"service-unavailable">>,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>}],
[]},
{xmlel,<<"text">>,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-stanzas">>}],
[{xmlcdata,<<"Route offline">>}]}]}]}]},
[{sm_SUITE,ping_timeout,1,
[{file,"/home/ci... ldap_mnesia_26 / ldap_mnesia / a6cd240 dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / a6cd240 dynamic_domains_mysql_redis_26 / mysql_redis / a6cd240 dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / a6cd240 internal_mnesia_26 / internal_mnesia / a6cd240 dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / a6cd240 graphql_muc_light_SUITE:admin_http:admin_muc_light:end_per_group{error,
{{unregistering_failed,
{amount,2},
{unregistered_items,
[{{<<"_admin_send_message_to_room_1071">>,
[{escalus_event_mgr,<0.23671.0>},
{tc_name,admin_send_message_to_room},
{escalus_cleaner,<0.23670.0>},
{watchdog,<0.23669.0>},
{muc_light_host,<<"muclight.domain.example.com">>},
{secondary_muc_light_host,<<"muclight.domain.example.org">>},
{protocol,http},
{schema_endpoint,admin},
{listener_opts,
#{module => mongoose_graphql_handler,path => "/api/graphql",
host => "localhost",username => <<"admin">>,
password => <<"secret">>,schema_endpoint => admin,
sse_idle_timeout => 3600000}},
{{ejabberd_cwd,mongooseim@localhost},
"/home/circleci/project/_build/mim1/rel/mongooseim"},
{preset,"odbc_mssql_mnesia"},
{mim_data_dir,
"/home/circleci/project/big_tests/tests/graphql_muc_light_SUITE_data"},
{tc_logfile,
"https://circleci-mim-results.s3.eu-central-1.amazonaws.com/PR/4211/205565/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%40a53e8931426c.2024-01-15_14.27.51/big_tests.tests.graphql_muc_light_SUITE.logs/run.2024-01-15_14.32.52/graphql_muc_light_suite.admin_send_message_to_room.html"},
{tc_group_properties,[{name,admin_muc_light}]},
{tc_group_path,[[{name,admin_http}]]},
{data_dir,
"/home/circleci/project/big_tests/_build/default/lib/mongoose_tests/ebin/graphql_muc_light_SUITE_data/"},
{priv_dir,
"https://circleci-mim-results.s3.eu-central-1.amazonaws.com/PR/4211/205565/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%40a53e8931426c.2024-01-15_14.27.51/big_tests.tests.graphql_muc_light... graphql_muc_light_SUITE:admin_cli:admin_muc_light:end_per_group{error,
{{unregistering_failed,
{amount,2},
{unregistered_items,
[{{<<"_admin_get_room_config_1110">>,
[{escalus_event_mgr,<0.24380.0>},
{tc_name,admin_get_room_config},
{escalus_cleaner,<0.24379.0>},
{watchdog,<0.24378.0>},
{muc_light_host,<<"muclight.domain.example.com">>},
{secondary_muc_light_host,<<"muclight.domain.example.org">>},
{protocol,cli},
{schema_endpoint,admin},
{{ejabberd_cwd,mongooseim@localhost},
"/home/circleci/project/_build/mim1/rel/mongooseim"},
{preset,"odbc_mssql_mnesia"},
{mim_data_dir,
"/home/circleci/project/big_tests/tests/graphql_muc_light_SUITE_data"},
{tc_logfile,
"https://circleci-mim-results.s3.eu-central-1.amazonaws.com/PR/4211/205565/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%40a53e8931426c.2024-01-15_14.27.51/big_tests.tests.graphql_muc_light_SUITE.logs/run.2024-01-15_14.32.52/graphql_muc_light_suite.admin_get_room_config.63362.html"},
{tc_group_properties,[{name,admin_muc_light}]},
{tc_group_path,[[{name,admin_cli}]]},
{data_dir,
"/home/circleci/project/big_tests/_build/default/lib/mongoose_tests/ebin/graphql_muc_light_SUITE_data/"},
{priv_dir,
"https://circleci-mim-results.s3.eu-central-1.amazonaws.com/PR/4211/205565/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%40a53e8931426c.2024-01-15_14.27.51/big_tests.tests.graphql_muc_light_SUITE.logs/run.2024-01-15_14.32.52/log_private/"},
{{saved_modules,mongooseim@localhost,<<"test type">>},
#{mod_vcard =>
#{matches => 30,
host => {prefix,<<"vjud.">>},
search => true,backend => rdbms,iqdisc => par... pgsql_cets_26 / pgsql_cets / a6cd240 mysql_redis_26 / mysql_redis / a6cd240 pgsql_mnesia_25 / pgsql_mnesia / a6cd240 pgsql_mnesia_26 / pgsql_mnesia / a6cd240 mssql_mnesia_26 / odbc_mssql_mnesia / a6cd240 graphql_muc_light_SUITE:domain_admin:domain_admin_muc_light:admin_create_room_with_unprepped_id{error,
{{badmatch,null},
[{graphql_muc_light_SUITE,admin_create_room_with_unprepped_id,1,
[{file,
"/home/circleci/project/big_tests/tests/graphql_muc_light_SUITE.erl"},
{line,1155}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1302}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1234}]}]}} |
a6cd240
to
eba748b
Compare
elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / eba748b small_tests_26 / small_tests / eba748b small_tests_25 / small_tests / eba748b small_tests_26_arm64 / small_tests / eba748b ldap_mnesia_26 / ldap_mnesia / eba748b ldap_mnesia_25 / ldap_mnesia / eba748b dynamic_domains_mysql_redis_26 / mysql_redis / eba748b dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / eba748b internal_mnesia_26 / internal_mnesia / eba748b dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / eba748b dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / eba748b amp_big_SUITE:mam:mam_success:notify_deliver_to_unknown_domain_test{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"alice_notify_deliver_to_unknown_domain_test_154@domain.example.com/res1">>,
escalus_tcp,<0.3886.0>,
[{event_manager,<0.3733.0>},
{server,<<"domain.example.com">>},
{username,
<<"alicE_notify_deliver_to_unknown_domain_test_154">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.3733.0>},
{server,<<"domain.example.com">>},
{username,
<<"alicE_notify_deliver_to_unknown_domain_test_154">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,
<<"alice_notify_deliver_to_unknown_domain_test_154">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,
<<"alicE_notify_deliver_to_unknown_domain_test_154">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"2bb64ca32b83c687">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{amp_big_SUITE,client_receives_generic_error,3,
[{file,
"/home/circleci/project/big_t... pgsql_cets_26 / pgsql_cets / eba748b mysql_redis_26 / mysql_redis / eba748b pgsql_mnesia_26 / pgsql_mnesia / eba748b pgsql_mnesia_25 / pgsql_mnesia / eba748b mssql_mnesia_26 / odbc_mssql_mnesia / eba748b dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / eba748b elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / eba748b small_tests_25 / small_tests / eba748b small_tests_26 / small_tests / eba748b small_tests_26_arm64 / small_tests / eba748b ldap_mnesia_25 / ldap_mnesia / eba748b dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / eba748b ldap_mnesia_26 / ldap_mnesia / eba748b dynamic_domains_mysql_redis_26 / mysql_redis / eba748b dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / eba748b internal_mnesia_26 / internal_mnesia / eba748b dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / eba748b pgsql_cets_26 / pgsql_cets / eba748b pgsql_mnesia_26 / pgsql_mnesia / eba748b mysql_redis_26 / mysql_redis / eba748b pgsql_mnesia_25 / pgsql_mnesia / eba748b mssql_mnesia_26 / odbc_mssql_mnesia / eba748b graphql_muc_light_SUITE:admin_cli:admin_muc_light:end_per_group{error,
{{unregistering_failed,
{amount,1},
{unregistered_items,
[{{<<"_admin_send_message_to_room_1115">>,
[{escalus_event_mgr,<0.24518.0>},
{tc_name,admin_send_message_to_room},
{escalus_cleaner,<0.24517.0>},
{watchdog,<0.24516.0>},
{muc_light_host,<<"muclight.localhost">>},
{secondary_muc_light_host,<<"muclight.localhost.bis">>},
{protocol,cli},
{schema_endpoint,admin},
{{ejabberd_cwd,mongooseim@localhost},
"/home/circleci/project/_build/mim1/rel/mongooseim"},
{preset,"odbc_mssql_mnesia"},
{mim_data_dir,
"/home/circleci/project/big_tests/tests/graphql_muc_light_SUITE_data"},
{tc_logfile,
"https://circleci-mim-results.s3.eu-central-1.amazonaws.com/PR/4211/205671/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%4099589c7fe1a8.2024-01-15_15.36.38/big_tests.tests.graphql_muc_light_SUITE.logs/run.2024-01-15_15.41.06/graphql_muc_light_suite.admin_send_message_to_room.57346.html"},
{tc_group_properties,[{name,admin_muc_light}]},
{tc_group_path,[[{name,admin_cli}]]},
{data_dir,
"/home/circleci/project/big_tests/_build/default/lib/mongoose_tests/ebin/graphql_muc_light_SUITE_data/"},
{priv_dir,
"https://circleci-mim-results.s3.eu-central-1.amazonaws.com/PR/4211/205671/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%4099589c7fe1a8.2024-01-15_15.36.38/big_tests.tests.graphql_muc_light_SUITE.logs/run.2024-01-15_15.41.06/log_private/"},
{{saved_modules,mongooseim@localhost,<<"localhost">>},
#{mod_vcard =>
#{matches => 30,
host => {prefix,<<"vjud.">>},
search => true,backend => rdbms,iqdisc => pa... elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / eba748b small_tests_25 / small_tests / eba748b small_tests_26 / small_tests / eba748b small_tests_26_arm64 / small_tests / eba748b ldap_mnesia_25 / ldap_mnesia / eba748b ldap_mnesia_26 / ldap_mnesia / eba748b pubsub_SUITE:dag+basic:create_delete_node_test{error,{{badmatch,false},
[{pubsub_tools,check_response,2,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,444}]},
{pubsub_tools,receive_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,434}]},
{pubsub_tools,receive_and_check_response,4,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,424}]},
{escalus_story,story,4,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1302}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1234}]}]}} dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / eba748b dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / eba748b dynamic_domains_mysql_redis_26 / mysql_redis / eba748b internal_mnesia_26 / internal_mnesia / eba748b pgsql_cets_26 / pgsql_cets / eba748b dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / eba748b pgsql_mnesia_25 / pgsql_mnesia / eba748b mysql_redis_26 / mysql_redis / eba748b pgsql_mnesia_26 / pgsql_mnesia / eba748b mssql_mnesia_26 / odbc_mssql_mnesia / eba748b ldap_mnesia_26 / ldap_mnesia / eba748b |
... codecov fails again |
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.
LGTM (for now xD)
-spec write(mongooseim:host_type(), mod_caps:node_pair(), | ||
mod_caps:maybe_pending_features()) -> ok. | ||
write(HostType, {Node, SubNode}, Features) -> | ||
Encoded = jiffy:encode(Features), |
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.
I'm amazed jiffy just works here 🙄
This PR addresses MIM-2067.
Proposed changes include:
We do not try to refactor/optimize or make reasonable caps logic in this PR though, just persist data in RDBMS instead of mnesia here. For example, data removal is not tested and it is not called from anywhere in the main module to begin with...