Skip to content
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

Muclight config fix #4178

Merged
merged 3 commits into from
Nov 23, 2023
Merged

Muclight config fix #4178

merged 3 commits into from
Nov 23, 2023

Conversation

NelsonVides
Copy link
Collaborator

This PR addresses #4173

@NelsonVides NelsonVides linked an issue Nov 22, 2023 that may be closed by this pull request
@mongoose-im
Copy link
Collaborator

mongoose-im commented Nov 22, 2023

elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / 29d8186
Reports root/ big
OK: 369 / Failed: 0 / User-skipped: 38 / Auto-skipped: 0


small_tests_25 / small_tests / 29d8186
Reports root / small


small_tests_26 / small_tests / 29d8186
Reports root / small


small_tests_26_arm64 / small_tests / 29d8186
Reports root / small


ldap_mnesia_25 / ldap_mnesia / 29d8186
Reports root/ big
OK: 2312 / Failed: 0 / User-skipped: 867 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 29d8186
Reports root/ big
OK: 4279 / Failed: 0 / User-skipped: 112 / Auto-skipped: 0


dynamic_domains_mysql_redis_26 / mysql_redis / 29d8186
Reports root/ big
OK: 4247 / Failed: 0 / User-skipped: 144 / Auto-skipped: 0


ldap_mnesia_26 / ldap_mnesia / 29d8186
Reports root/ big
OK: 2312 / Failed: 0 / User-skipped: 867 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 29d8186
Reports root/ big
OK: 4279 / Failed: 0 / User-skipped: 112 / Auto-skipped: 0


pgsql_cets_26 / pgsql_cets / 29d8186
Reports root/ big
OK: 4328 / Failed: 0 / User-skipped: 119 / Auto-skipped: 0


internal_mnesia_26 / internal_mnesia / 29d8186
Reports root/ big
OK: 2462 / Failed: 0 / User-skipped: 717 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / 29d8186
Reports root/ big
OK: 4276 / Failed: 0 / User-skipped: 115 / Auto-skipped: 0

graphql_muc_light_SUITE:domain_admin:domain_admin_muc_light:end_per_group
{error,
 {{unregistering_failed,
   {amount,2},
   {unregistered_items,
  [{{<<"_admin_blocking_list_1121">>,
     [{escalus_event_mgr,<0.25152.0>},
    {tc_name,admin_blocking_list},
    {escalus_cleaner,<0.25151.0>},
    {watchdog,<0.25150.0>},
    {muc_light_host,<<"muclight.domain.example.com">>},
    {secondary_muc_light_host,<<"muclight.domain.example.org">>},
    {protocol,http},
    {domain_admin,{<<"admin@domain.example.com">>,<<"7c9e4a00fa854d17">>}},
    {schema_endpoint,domain_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/4178/200643/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%40f47bf9b3b009.2023-11-22_16.32.45/big_tests.tests.graphql_muc_light_SUITE.logs/run.2023-11-22_16.36.58/graphql_muc_light_suite.admin_blocking_list.64002.html"},
    {tc_group_properties,[{name,domain_admin_muc_light}]},
    {tc_group_path,[[{name,domain_admin}]]},
    {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/4178/200643/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%40f47bf9b3b009.2023-11-22_16.32.45/big_tests.tests.graphql_muc_light_SUITE.logs/run.2023-11-22_16.36.58/log_private/"},
    {{saved_modules,mongooseim@localhost,<<"test type">>},
     #{mod_vcard =>
      #{matches => 30,
   ...

Report log


pgsql_mnesia_26 / pgsql_mnesia / 29d8186
Reports root/ big
OK: 4668 / Failed: 0 / User-skipped: 119 / Auto-skipped: 0


mysql_redis_26 / mysql_redis / 29d8186
Reports root/ big
OK: 4648 / Failed: 0 / User-skipped: 139 / Auto-skipped: 0


mssql_mnesia_26 / odbc_mssql_mnesia / 29d8186
Reports root/ big
OK: 4665 / Failed: 0 / User-skipped: 122 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 29d8186
Reports root/ big
OK: 4667 / Failed: 1 / User-skipped: 119 / Auto-skipped: 0

sm_SUITE:ping_timeout
{error,
  {{badmatch,
     [{xmlel,<<"iq">>,
        [{<<"type">>,<<"error">>},
         {<<"to">>,<<"localhost">>},
         {<<"from">>,
        <<"alice_ping_timeout_3303@localhost/escalus-default-resource">>},
         {<<"id">>,<<"8f66bed901f349b5">>}],
        [{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_3303@localhost/escalus-default-resource">>},
         {<<"id">>,<<"ae0c4a8cb39b4858">>}],
        [{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...

Report log


pgsql_mnesia_25 / pgsql_mnesia / 29d8186
Reports root/ big
OK: 4668 / Failed: 0 / User-skipped: 119 / Auto-skipped: 0

Copy link

codecov bot commented Nov 22, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (07c2263) 84.03% compared to head (29d8186) 84.03%.

Files Patch % Lines
src/muc_light/mod_muc_light_room_config.erl 83.33% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4178   +/-   ##
=======================================
  Coverage   84.03%   84.03%           
=======================================
  Files         564      564           
  Lines       34064    34065    +1     
=======================================
+ Hits        28625    28628    +3     
+ Misses       5439     5437    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@NelsonVides NelsonVides marked this pull request as ready for review November 22, 2023 18:05
Copy link
Contributor

@arcusfelis arcusfelis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks ok I guess.

%%====================================================================
take_next_binary_kv([{Key, ValBin} | RRawConfig], [{KeyBin, _Default, Key, Type} | RSchema]) ->
try {value, RRawConfig, RSchema, {KeyBin, value2b(ValBin, Type)}}
catch _:_ -> {error, {KeyBin, type_error}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to write "Why so complicated" and I after I see the old take_next_kv doing the same.
{error, _} is not covered by tests even :)

take_next logic is kinda hard to follow, in the perfect world it should be just simple maps:merge(NewConfig, maps:merge(OldConfig, Default))
or something.

@arcusfelis arcusfelis merged commit 79f5206 into master Nov 23, 2023
4 checks passed
@arcusfelis arcusfelis deleted the muclight_config_fix branch November 23, 2023 09:51
end;
take_next_binary_kv(RawConfig, [{KeyBin, Default, _Key, _Type} | RSchema]) ->
{default, RawConfig, RSchema, {KeyBin, Default}};
take_next_binary_kv([{KeyBin, _} | _], _) ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor naming inconsistency

Suggested change
take_next_binary_kv([{KeyBin, _} | _], _) ->
take_next_binary_kv([{Key, _} | _], _) ->

@chrzaszcz chrzaszcz added this to the 6.2.0 milestone Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change config in muclight replacing old config
4 participants