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

Refactored hook handlers in mod_caps module #3811

Merged
merged 3 commits into from
Oct 18, 2022
Merged

Conversation

pawlooss1
Copy link
Member

This PR changes all hook handlers in mod_caps module to gen_hook format.

@mongoose-im

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Oct 13, 2022

Codecov Report

Base: 82.99% // Head: 83.05% // Increases project coverage by +0.05% 🎉

Coverage data is based on head (c1bfa5b) compared to base (a9ee17f).
Patch coverage: 94.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3811      +/-   ##
==========================================
+ Coverage   82.99%   83.05%   +0.05%     
==========================================
  Files         529      529              
  Lines       33834    33862      +28     
==========================================
+ Hits        28081    28124      +43     
+ Misses       5753     5738      -15     
Impacted Files Coverage Δ
src/mod_caps.erl 76.44% <83.33%> (+0.64%) ⬆️
src/ejabberd_c2s.erl 88.95% <100.00%> (+0.01%) ⬆️
src/ejabberd_sm.erl 87.33% <100.00%> (+0.12%) ⬆️
src/mongoose_hooks.erl 97.05% <100.00%> (+0.17%) ⬆️
src/mongoose_cleaner.erl 60.00% <0.00%> (-10.00%) ⬇️
src/inbox/mod_inbox_rdbms_async.erl 72.05% <0.00%> (-1.48%) ⬇️
src/mod_muc_log.erl 62.82% <0.00%> (ø)
src/mod_muc_room.erl 78.68% <0.00%> (+0.17%) ⬆️
src/mod_roster.erl 79.42% <0.00%> (+0.23%) ⬆️
src/mam/mod_mam_elasticsearch_arch.erl 88.39% <0.00%> (+1.78%) ⬆️
... and 5 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Oct 18, 2022

small_tests_24 / small_tests / c1bfa5b
Reports root / small


small_tests_25 / small_tests / c1bfa5b
Reports root / small


ldap_mnesia_24 / ldap_mnesia / c1bfa5b
Reports root/ big
OK: 2096 / Failed: 0 / User-skipped: 775 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / c1bfa5b
Reports root/ big
OK: 3978 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / c1bfa5b
Reports root/ big
OK: 3978 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / c1bfa5b
Reports root/ big
OK: 2096 / Failed: 0 / User-skipped: 775 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / c1bfa5b
Reports root/ big
OK: 3952 / Failed: 0 / User-skipped: 114 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / c1bfa5b
Reports root/ big
OK: 2232 / Failed: 0 / User-skipped: 639 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / c1bfa5b
Reports root/ big
OK: 3978 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / c1bfa5b
Reports root/ big
OK: 4352 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / c1bfa5b
Reports root/ big
OK: 2570 / Failed: 2 / User-skipped: 634 / Auto-skipped: 0

graphql_server_SUITE:admin_http:clustering_http_tests:remove_node_test
{error,{{badmatch,{error,econnrefused}},
    [{rest_helper,fusco_request,7,
            [{file,"/home/circleci/project/big_tests/tests/rest_helper.erl"},
             {line,185}]},
     {rest_helper,make_request,1,
            [{file,"/home/circleci/project/big_tests/tests/rest_helper.erl"},
             {line,114}]},
     {rest_helper,make_request,1,
            [{file,"/home/circleci/project/big_tests/tests/rest_helper.erl"},
             {line,121}]},
     {graphql_server_SUITE,remove_node_test,1,
                 [{file,"/home/circleci/project/big_tests/tests/graphql_server_SUITE.erl"},
                {line,210}]},
     {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
     {test_server,run_test_case_eval1,6,
            [{file,"test_server.erl"},{line,1291}]},
     {test_server,run_test_case_eval,9,
            [{file,"test_server.erl"},{line,1223}]}]}}

Report log

graphql_server_SUITE:admin_http:clustering_http_tests:stop_node_test
{error,{{badmatch,{error,econnrefused}},
    [{rest_helper,fusco_request,7,
            [{file,"/home/circleci/project/big_tests/tests/rest_helper.erl"},
             {line,185}]},
     {rest_helper,make_request,1,
            [{file,"/home/circleci/project/big_tests/tests/rest_helper.erl"},
             {line,114}]},
     {rest_helper,make_request,1,
            [{file,"/home/circleci/project/big_tests/tests/rest_helper.erl"},
             {line,121}]},
     {graphql_server_SUITE,stop_node_test,1,
                 [{file,"/home/circleci/project/big_tests/tests/graphql_server_SUITE.erl"},
                {line,215}]},
     {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
     {test_server,run_test_case_eval1,6,
            [{file,"test_server.erl"},{line,1291}]},
     {test_server,run_test_case_eval,9,
            [{file,"test_server.erl"},{line,1223}]}]}}

Report log


pgsql_mnesia_25 / pgsql_mnesia / c1bfa5b
Reports root/ big
OK: 4352 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / c1bfa5b
Reports root/ big
OK: 4338 / Failed: 0 / User-skipped: 111 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / c1bfa5b
Reports root/ big
OK: 4352 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / c1bfa5b
Reports root/ big
OK: 2418 / Failed: 0 / User-skipped: 620 / Auto-skipped: 0


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / c1bfa5b
Reports root/ big
OK: 2572 / Failed: 0 / User-skipped: 634 / Auto-skipped: 0

@pawlooss1 pawlooss1 marked this pull request as ready for review October 18, 2022 11:20
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.

LGTM 👌🏽

We probably need to check in the future if mod_caps is using the most efficient algorithms, I already skimmed through some gb_trees and some more usages of dropping keys to stop a hook, but that's work for a future different refactoring, just taking notes for now 😁

@NelsonVides NelsonVides merged commit de99d44 into master Oct 18, 2022
@NelsonVides NelsonVides deleted the hooks/mod_caps branch October 18, 2022 12:53
@chrzaszcz chrzaszcz added this to the 6.0.0 milestone Dec 12, 2022
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