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

Refactor/roster #4209

Merged
merged 16 commits into from
Feb 21, 2024
Merged

Refactor/roster #4209

merged 16 commits into from
Feb 21, 2024

Conversation

NelsonVides
Copy link
Collaborator

@NelsonVides NelsonVides commented Jan 12, 2024

This modernises a bit code in mod_roster, by using exml_query, preferring tagged jids for type information, and most importantly, refactoring RDBMS operations to be transactional and use primary keys, see for example how priv/pg.sql#L56 has no use of primary keys and lots of redundant indexes.

@mongoose-im

This comment was marked as outdated.

Base automatically changed from refactor/presences to master January 19, 2024 10:22
@mongoose-im

This comment was marked as outdated.

Copy link

codecov bot commented Jan 19, 2024

Codecov Report

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

Comparison is base (1ada930) 84.33% compared to head (6ace2c0) 84.34%.
Report is 16 commits behind head on master.

Files Patch % Lines
src/roster/mod_roster.erl 86.00% 7 Missing ⚠️
src/roster/mod_shared_roster_ldap.erl 50.00% 2 Missing ⚠️
src/roster/mod_roster_rdbms.erl 96.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4209      +/-   ##
==========================================
+ Coverage   84.33%   84.34%   +0.01%     
==========================================
  Files         552      552              
  Lines       33436    33413      -23     
==========================================
- Hits        28198    28182      -16     
+ Misses       5238     5231       -7     

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

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@NelsonVides NelsonVides marked this pull request as ready for review January 23, 2024 08:56
Copy link
Member

@pawlooss1 pawlooss1 left a comment

Choose a reason for hiding this comment

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

Thank you for the refactor ❤️ I left some comments with my thoughts to consider.

src/roster/mod_roster_rdbms.erl Outdated Show resolved Hide resolved
src/roster/mod_roster.erl Outdated Show resolved Hide resolved
src/roster/mod_roster.erl Show resolved Hide resolved
src/roster/mod_roster.erl Outdated Show resolved Hide resolved
@mongoose-im

This comment was marked as outdated.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Feb 20, 2024

elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / 6ace2c0
Reports root/ big
OK: 382 / Failed: 0 / User-skipped: 40 / Auto-skipped: 0


small_tests_25 / small_tests / 6ace2c0
Reports root / small


small_tests_26 / small_tests / 6ace2c0
Reports root / small


small_tests_26_arm64 / small_tests / 6ace2c0
Reports root / small


ldap_mnesia_25 / ldap_mnesia / 6ace2c0
Reports root/ big
OK: 2275 / Failed: 0 / User-skipped: 856 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 6ace2c0
Reports root/ big
OK: 4288 / Failed: 0 / User-skipped: 111 / Auto-skipped: 0


dynamic_domains_mysql_redis_26 / mysql_redis / 6ace2c0
Reports root/ big
OK: 4255 / Failed: 0 / User-skipped: 144 / Auto-skipped: 0


ldap_mnesia_26 / ldap_mnesia / 6ace2c0
Reports root/ big
OK: 2275 / Failed: 0 / User-skipped: 856 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 6ace2c0
Reports root/ big
OK: 4288 / Failed: 0 / User-skipped: 111 / Auto-skipped: 0


internal_mnesia_26 / internal_mnesia / 6ace2c0
Reports root/ big
OK: 2415 / Failed: 0 / User-skipped: 716 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / 6ace2c0
Reports root/ big
OK: 4284 / Failed: 1 / User-skipped: 114 / Auto-skipped: 0

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}]}]}}

Report log

graphql_muc_light_SUITE:domain_admin:domain_admin_muc_light:end_per_group
{error,
 {{unregistering_failed,
   {amount,3},
   {unregistered_items,
  [{{<<"_domain_admin_create_room_no_permission_1104">>,
     [{escalus_event_mgr,<0.24704.0>},
    {tc_name,domain_admin_create_room_no_permission},
    {escalus_cleaner,<0.24703.0>},
    {watchdog,<0.24702.0>},
    {muc_light_host,<<"muclight.domain.example.com">>},
    {secondary_muc_light_host,<<"muclight.domain.example.org">>},
    {protocol,http},
    {domain_admin,{<<"admin@domain.example.com">>,<<"a3ff986d55adb21d">>}},
    {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/4209/208236/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%40606610c9432f.2024-02-20_20.11.10/big_tests.tests.graphql_muc_light_SUITE.logs/run.2024-02-20_20.15.24/graphql_muc_light_suite.domain_admin_create_room_no_permission.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/4209/208236/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%40606610c9432f.2024-02-20_20.11.10/big_tests.tests.graphql_muc_light_SUITE.logs/run.2024-02-20_20.15.24/log_private/"},
    {{saved_modules,mongooseim@localhost,<<"test type"...

Report log


pgsql_cets_26 / pgsql_cets / 6ace2c0
Reports root/ big
OK: 4261 / Failed: 0 / User-skipped: 178 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 6ace2c0
Reports root/ big
OK: 4677 / Failed: 0 / User-skipped: 118 / Auto-skipped: 0


mysql_redis_26 / mysql_redis / 6ace2c0
Reports root/ big
OK: 4656 / Failed: 0 / User-skipped: 139 / Auto-skipped: 0


pgsql_mnesia_26 / pgsql_mnesia / 6ace2c0
Reports root/ big
OK: 4677 / Failed: 0 / User-skipped: 118 / Auto-skipped: 0


mssql_mnesia_26 / odbc_mssql_mnesia / 6ace2c0
Reports root/ big
OK: 4673 / Failed: 1 / User-skipped: 121 / Auto-skipped: 0

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}]}]}}

Report log


dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / 6ace2c0
Reports root/ big
OK: 4285 / Failed: 0 / User-skipped: 114 / Auto-skipped: 0


mssql_mnesia_26 / odbc_mssql_mnesia / 6ace2c0
Reports root/ big
OK: 4673 / Failed: 1 / User-skipped: 121 / Auto-skipped: 0

graphql_muc_light_SUITE:admin_cli:admin_muc_light:end_per_group
{error,
 {{unregistering_failed,
   {amount,2},
   {unregistered_items,
  [{{<<"_admin_invite_user_1074">>,
     [{escalus_event_mgr,<0.24515.0>},
    {tc_name,admin_invite_user},
    {escalus_cleaner,<0.24514.0>},
    {watchdog,<0.24513.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/4209/208251/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%40b9f6146bb6ec.2024-02-20_20.36.48/big_tests.tests.graphql_muc_light_SUITE.logs/run.2024-02-20_20.41.03/graphql_muc_light_suite.admin_invite_user.55682.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/4209/208251/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%40b9f6146bb6ec.2024-02-20_20.36.48/big_tests.tests.graphql_muc_light_SUITE.logs/run.2024-02-20_20.41.03/log_private/"},
    {{saved_modules,mongooseim@localhost,<<"localhost">>},
     #{mod_vcard =>
      #{matches => 30,
        host => {prefix,<<"vjud.">>},
        search => true,iqdisc => parallel,backend => rdbms},
       mod_roster ...

Report log

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}]}]}}

Report log


mssql_mnesia_26 / odbc_mssql_mnesia / 6ace2c0
Reports root/ big
OK: 4674 / Failed: 0 / User-skipped: 121 / Auto-skipped: 0

@pawlooss1 pawlooss1 merged commit 880776f into master Feb 21, 2024
4 checks passed
@pawlooss1 pawlooss1 deleted the refactor/roster branch February 21, 2024 09:25
@jacekwegr jacekwegr added this to the 6.2.1 milestone Apr 3, 2024
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.

4 participants