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

Support dynamic domains in mod_last #3188

Merged
merged 16 commits into from
Jul 28, 2021
Merged

Conversation

chrzaszcz
Copy link
Member

@chrzaszcz chrzaszcz commented Jul 15, 2021

Add support for dynamic domains to mod_last and its backends.

Side changes:

  • Fix error handling when updating last info. Previously the error tuple would result in badmatch as Acc was expected in both hooks.

This PR does not include:

  • Supporting remove_domain.
  • Migration guide.

Both tasks will be done separately.

@mongoose-im

This comment has been minimized.

@codecov
Copy link

codecov bot commented Jul 15, 2021

Codecov Report

Merging #3188 (21c00e5) into master (f351a3d) will increase coverage by 0.00%.
The diff coverage is 87.69%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3188   +/-   ##
=======================================
  Coverage   80.29%   80.30%           
=======================================
  Files         397      397           
  Lines       32453    32459    +6     
=======================================
+ Hits        26059    26066    +7     
+ Misses       6394     6393    -1     
Impacted Files Coverage Δ
src/auth/ejabberd_auth_external.erl 29.00% <0.00%> (ø)
src/mod_last_mnesia.erl 83.33% <ø> (ø)
src/mongoose_hooks.erl 95.10% <ø> (ø)
src/admin_extra/service_admin_extra_accounts.erl 90.66% <83.33%> (+0.25%) ⬆️
src/mod_last.erl 87.87% <96.77%> (+0.57%) ⬆️
src/admin_extra/service_admin_extra_last.erl 75.00% <100.00%> (+3.57%) ⬆️
src/mod_last_rdbms.erl 95.83% <100.00%> (+4.16%) ⬆️
src/mod_last_riak.erl 95.23% <100.00%> (ø)
src/elasticsearch/mongoose_elasticsearch.erl 76.92% <0.00%> (-7.70%) ⬇️
src/event_pusher/mod_event_pusher_sns.erl 84.21% <0.00%> (-5.27%) ⬇️
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f351a3d...21c00e5. Read the comment docs.

@mongoose-im

This comment has been minimized.

@mongoose-im

This comment has been minimized.

@chrzaszcz chrzaszcz force-pushed the mod-last-with-dynamic-domains branch from a6eaf5d to 9676977 Compare July 26, 2021 14:07
@mongoose-im

This comment has been minimized.

@mongoose-im

This comment has been minimized.

@mongoose-im

This comment has been minimized.

@chrzaszcz chrzaszcz force-pushed the mod-last-with-dynamic-domains branch from 6c8bb5c to 9ee98c8 Compare July 27, 2021 09:58
@mongoose-im

This comment has been minimized.

chrzaszcz added 12 commits July 27, 2021 14:33
Also: update the index to allow counting users per server (as in the API)
  There was no such index for MSSQL yet.
Use the new 'server' column as well.
Do it in a simple way as it would require a significant rework
  to minimize the amount of 'get_domain_host_type' calls.
the rework will be done later.
Also: use host types when testing modules that support them
@chrzaszcz chrzaszcz force-pushed the mod-last-with-dynamic-domains branch from 9ee98c8 to 90d6156 Compare July 27, 2021 12:33
@mongoose-im

This comment has been minimized.

@chrzaszcz chrzaszcz marked this pull request as ready for review July 27, 2021 13:41
Copy link
Collaborator

@NelsonVides NelsonVides left a comment

Choose a reason for hiding this comment

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

Simply neat, just one small comment 👌🏽

src/auth/ejabberd_auth_external.erl Outdated Show resolved Hide resolved
@mongoose-im
Copy link
Collaborator

mongoose-im commented Jul 28, 2021

small_tests_24 / small_tests / 21c00e5
Reports root / small


internal_mnesia_24 / internal_mnesia / 21c00e5
Reports root/ big
OK: 1588 / Failed: 0 / User-skipped: 286 / Auto-skipped: 0


dynamic_domains_23 / pgsql_mnesia / 21c00e5
Reports root/ big
OK: 1619 / Failed: 0 / User-skipped: 111 / Auto-skipped: 0


dynamic_domains_24 / pgsql_mnesia / 21c00e5
Reports root/ big
OK: 1619 / Failed: 0 / User-skipped: 111 / Auto-skipped: 0


small_tests_22 / small_tests / 21c00e5
Reports root / small


small_tests_23 / small_tests / 21c00e5
Reports root / small


ldap_mnesia_24 / ldap_mnesia / 21c00e5
Reports root/ big
OK: 1515 / Failed: 0 / User-skipped: 359 / Auto-skipped: 0


ldap_mnesia_22 / ldap_mnesia / 21c00e5
Reports root/ big
OK: 1515 / Failed: 0 / User-skipped: 359 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 21c00e5
Reports root/ big
OK: 1515 / Failed: 0 / User-skipped: 359 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 21c00e5
Reports root/ big
OK: 3085 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


pgsql_mnesia_23 / pgsql_mnesia / 21c00e5
Reports root/ big
OK: 3085 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 21c00e5
Reports root/ big
OK: 1898 / Failed: 1 / User-skipped: 282 / Auto-skipped: 0

sm_SUITE:parallel_manual_ack_freq_1:resume_session_state_send_message
{error,
  {{assertion_failed,assert,is_presence,
     {xmlel,<<"message">>,
       [{<<"from">>,
         <<"bOb_resume_session_state_send_message_13.442196@localhost/escalus-default-resource">>},
        {<<"to">>,
         <<"alicE_resume_session_state_send_message_13.472899@localhost">>},
        {<<"xml:lang">>,<<"en">>},
        {<<"type">>,<<"chat">>}],
       [{xmlel,<<"body">>,[],[{xmlcdata,<<"msg-3">>}]},
        {xmlel,<<"delay">>,
          [{<<"xmlns">>,<<"urn:xmpp:delay">>},
           {<<"stamp">>,<<"2021-07-28T06:48:33.555325Z">>},
           {<<"from">>,<<"localhost">>}],
          [{xmlcdata,<<"Offline Storage">>}]}]},
     "<message from='bOb_resume_session_state_send_message_13.442196@localhost/escalus-default-resource' to='alicE_resume_session_state_send_message_13.472899@localhost' xml:lang='en' type='chat'><body>msg-3</body><delay xmlns='urn:xmpp:delay' stamp='2021-07-28T06:48:33.555325Z' from='localhost'>Offline Storage</delay></message>"},
   [{escalus_new_assert,assert_true,2,
      [{file,
         "/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
       {line,84}]},
    {sm_SUITE,resume_session_state_send_message,1,
      [{file,"/home/circleci/app/big_tests/tests/sm_SUITE.erl"},
       {line,727}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1783}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_server.erl"},{line,1292}]},
    {test_server,run_test_case_eval,9,
      [{file,"test_serve...

Report log


mysql_redis_24 / mysql_redis / 21c00e5
Reports root/ big
OK: 3068 / Failed: 0 / User-skipped: 201 / Auto-skipped: 0


pgsql_mnesia_22 / pgsql_mnesia / 21c00e5
Reports root/ big
OK: 3085 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / 21c00e5
Reports root/ big
OK: 3096 / Failed: 1 / User-skipped: 184 / Auto-skipped: 0

carboncopy_SUITE:all:unavailable_resources_dont_get_carbons
{error,{{assertion_failed,assert_many,false,[is_presence,is_presence],[],[]},
    [{escalus_new_assert,assert_true,2,
               [{file,"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
                {line,84}]},
     {escalus_story,story,4,
            [{file,"/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
             {line,72}]},
     {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1783}]},
     {test_server,run_test_case_eval1,6,
            [{file,"test_server.erl"},{line,1292}]},
     {test_server,run_test_case_eval,9,
            [{file,"test_server.erl"},{line,1224}]}]}}

Report log


riak_mnesia_24 / riak_mnesia / 21c00e5
Reports root/ big
OK: 1738 / Failed: 0 / User-skipped: 285 / Auto-skipped: 0

@vkatsuba vkatsuba merged commit 9a3cd46 into master Jul 28, 2021
@vkatsuba vkatsuba deleted the mod-last-with-dynamic-domains branch July 28, 2021 07:17
@Premwoik Premwoik added this to the 5.0.0 milestone Oct 5, 2021
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.

5 participants