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

Convert mod_mam to gen_hook #3841

Merged
merged 6 commits into from
Nov 15, 2022
Merged

Convert mod_mam to gen_hook #3841

merged 6 commits into from
Nov 15, 2022

Conversation

kamilwaz
Copy link
Contributor

@kamilwaz kamilwaz commented Nov 3, 2022

Convert mod_mam to gen_hook.

@mongoose-im

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Base: 83.10% // Head: 83.12% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (af2a2a4) compared to base (7c74198).
Patch coverage: 81.04% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3841      +/-   ##
==========================================
+ Coverage   83.10%   83.12%   +0.01%     
==========================================
  Files         534      534              
  Lines       34049    34086      +37     
==========================================
+ Hits        28297    28333      +36     
- Misses       5752     5753       +1     
Impacted Files Coverage Δ
.../event_pusher/mod_event_pusher_hook_translator.erl 88.88% <ø> (ø)
src/gen_hook.erl 87.50% <ø> (ø)
src/global_distrib/mod_global_distrib_mapping.erl 97.72% <ø> (ø)
src/http_upload/mod_http_upload.erl 97.64% <ø> (ø)
src/inbox/mod_inbox.erl 87.62% <ø> (ø)
src/inbox/mod_inbox_muc.erl 91.42% <ø> (ø)
src/jingle_sip/mod_jingle_sip.erl 79.92% <ø> (ø)
src/mam/mod_mam_pm.erl 89.11% <ø> (ø)
src/mod_adhoc.erl 81.03% <ø> (ø)
src/mod_amp.erl 95.34% <ø> (ø)
... and 41 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.

@kamilwaz kamilwaz force-pushed the hooks/mod_mam branch 2 times, most recently from 781238a to b0de2c7 Compare November 7, 2022 11:25
@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.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@kamilwaz kamilwaz marked this pull request as ready for review November 8, 2022 10:05
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.

Just a few comments from an unfinished review.

big_tests/tests/amp_big_SUITE.erl Outdated Show resolved Hide resolved
big_tests/tests/amp_big_SUITE.erl Outdated Show resolved Hide resolved
big_tests/tests/amp_big_SUITE.erl Outdated Show resolved Hide resolved
src/mam/ejabberd_gen_mam_archive.erl Outdated Show resolved Hide resolved
src/mam/ejabberd_gen_mam_prefs.erl Outdated Show resolved Hide resolved
src/mongoose_hooks.erl Outdated Show resolved Hide resolved
src/mongoose_hooks.erl Outdated Show resolved Hide resolved
src/mam/mod_mam_cassandra_prefs.erl Show resolved Hide resolved
src/mam/mod_mam_pm.erl Outdated Show resolved Hide resolved
src/mam/mod_mam_pm.erl Outdated Show resolved Hide resolved
@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

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.

While executable code is perfectly correct, lots of type information are lost or not given. Below a few comments, but same applies to many function specs.

big_tests/tests/amp_big_SUITE.erl Outdated Show resolved Hide resolved
src/mam/mod_mam_cassandra_arch.erl Outdated Show resolved Hide resolved
src/mam/mod_mam_muc_rdbms_arch.erl Outdated Show resolved Hide resolved
src/mam/mod_mam_rdbms_arch.erl Outdated Show resolved Hide resolved
src/mam/mod_mam_riak_timed_arch_yz.erl Outdated Show resolved Hide resolved
src/metrics/mongoose_metrics_mam_hooks.erl Show resolved Hide resolved
src/metrics/mongoose_metrics_mam_hooks.erl Outdated Show resolved Hide resolved
src/mongoose_hooks.erl Outdated Show resolved Hide resolved
@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

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.

Just a few very hidden typos and forgotten types 😄

src/mam/mod_mam_elasticsearch_arch.erl Show resolved Hide resolved
src/mongoose_hooks.erl Outdated Show resolved Hide resolved
src/mongoose_hooks.erl Outdated Show resolved Hide resolved
src/metrics/mongoose_metrics_mam_hooks.erl Outdated Show resolved Hide resolved
@mongoose-im

This comment was marked as outdated.

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.

Just two more comments 😄
This PR has so many changes, mostly mechanical ones, that it gets quite confusing to review, sorry for not noticing these few more errors before 😅

src/metrics/mongoose_metrics_mam_hooks.erl Outdated Show resolved Hide resolved
src/metrics/mongoose_metrics_mam_hooks.erl Outdated Show resolved Hide resolved
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.

💪🏽 💪🏽

@mongoose-im

This comment was marked as outdated.

Acc :: any(),
Params :: #{message_count := integer()},
Acc :: ok,
Params :: map(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also here it is also count := integer(), no losing the type information better

@mongoose-im
Copy link
Collaborator

mongoose-im commented Nov 15, 2022

small_tests_24 / small_tests / af2a2a4
Reports root / small


small_tests_25 / small_tests / af2a2a4
Reports root / small


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / af2a2a4
Reports root/ big
OK: 4008 / Failed: 1 / User-skipped: 88 / Auto-skipped: 0

graphql_roster_SUITE:admin_roster_http:admin_decline_subscription_ask
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,
          <<"bob_admin_decline_subscription_ask_1120@domain.example.com/res1">>,
          escalus_tcp,<0.29007.0>,
          [{event_manager,<0.29005.0>},
           {server,<<"domain.example.com">>},
           {username,<<"bOb_admin_decline_subscription_ask_1120">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.29005.0>},
            {server,<<"domain.example.com">>},
            {username,
              <<"bOb_admin_decline_subscription_ask_1120">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,<<"bob_admin_decline_subscription_ask_1120">>},
           {server,<<"domain.example.com">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,{escalus_auth,auth_plain}},
           {wspath,undefined},
           {username,<<"bOb_admin_decline_subscription_ask_1120">>},
           {server,<<"domain.example.com">>},
           {host,<<"localhost">>},
           {password,<<"makrolika">>},
           {stream_id,<<"e51894e8c0170be0">>}]},
        1],
       [{file,
          "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {graphql_roster_SUITE,admin_decline_subscription_ask_story,3,
       [{file,
          "/home/circleci/project/big_tests/tests/graphql_roster_SUITE.erl"},
        {line,255}]},
     {e...

Report log


ldap_mnesia_24 / ldap_mnesia / af2a2a4
Reports root/ big
OK: 2118 / Failed: 0 / User-skipped: 784 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / af2a2a4
Reports root/ big
OK: 2118 / Failed: 0 / User-skipped: 784 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / af2a2a4
Reports root/ big
OK: 3983 / Failed: 0 / User-skipped: 114 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / af2a2a4
Reports root/ big
OK: 4009 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / af2a2a4
Reports root/ big
OK: 4009 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / af2a2a4
Reports root/ big
OK: 2596 / Failed: 0 / User-skipped: 641 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / af2a2a4
Reports root/ big
OK: 2254 / Failed: 0 / User-skipped: 648 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / af2a2a4
Reports root/ big
OK: 4383 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / af2a2a4
Reports root/ big
OK: 2442 / Failed: 0 / User-skipped: 627 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / af2a2a4
Reports root/ big
OK: 4369 / Failed: 0 / User-skipped: 111 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / af2a2a4
Reports root/ big
OK: 4394 / Failed: 1 / User-skipped: 97 / Auto-skipped: 0

pep_SUITE:pep_tests:unsubscribe_after_presence_unsubscription
{error,
  {{badmatch,
     [{xmlel,<<"message">>,
        [{<<"from">>,
        <<"alice_unsubscribe_after_presence_unsubscription_2632@localhost">>},
         {<<"to">>,
        <<"bob_unsubscribe_after_presence_unsubscription_2632@localhost/res1">>},
         {<<"type">>,<<"headline">>}],
        [{xmlel,<<"event">>,
           [{<<"xmlns">>,
           <<"http://jabber.org/protocol/pubsub#event">>}],
           [{xmlel,<<"items">>,
            [{<<"node">>,<<"tmh4IOYAhpEM8FsngDzsnw==">>}],
            [{xmlel,<<"item">>,
               [{<<"id">>,<<"salmon">>}],
               [{xmlel,<<"entry">>,
                  [{<<"xmlns">>,
                  <<"http://www.w3.org/2005/Atom">>}],
                  []}]}]}]},
         {xmlel,<<"headers">>,
           [{<<"xmlns">>,<<"http://jabber.org/protocol/shim">>}],
           []}]}]},
   [{pep_SUITE,'-unsubscribe_after_presence_unsubscription/1-fun-0-',2,
      [{file,"/home/circleci/project/big_tests/tests/pep_SUITE.erl"},
       {line,384}]},
    {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,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


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / af2a2a4
Reports root/ big
OK: 4008 / Failed: 1 / User-skipped: 88 / Auto-skipped: 0

bosh_SUITE:essential:accept_higher_hold_value
{error,
  {{assertEqual,
     [{module,bosh_SUITE},
      {line,251},
      {expression,"get_bosh_sessions ( )"},
      {expected,[]},
      {value,
        [{bosh_session,<<"1c478a9cd568834093618bcb7a0bc4774287b440">>,
           <8834.6012.0>}]}]},
   [{bosh_SUITE,accept_higher_hold_value,1,
      [{file,"/home/circleci/project/big_tests/tests/bosh_SUITE.erl"},
       {line,251}]},
    {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

@NelsonVides NelsonVides merged commit c3383bc into master Nov 15, 2022
@NelsonVides NelsonVides deleted the hooks/mod_mam branch November 15, 2022 11:05
@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.

None yet

4 participants