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

Remove imports, use library function [refactor] #3809

Merged
merged 3 commits into from
Oct 13, 2022

Conversation

arcusfelis
Copy link
Contributor

This PR addresses "just found some code which is a bit weird".

Proposed changes include:

  • use jid:are_bare_equal instead of writing the same function in the modules.
  • don't use imports in mam to make code a bit cleaner - we usually use the imported function only once.

@codecov
Copy link

codecov bot commented Oct 13, 2022

Codecov Report

Base: 81.29% // Head: 82.91% // Increases project coverage by +1.61% 🎉

Coverage data is based on head (5d14895) compared to base (a3e1e56).
Patch coverage: 87.17% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3809      +/-   ##
==========================================
+ Coverage   81.29%   82.91%   +1.61%     
==========================================
  Files         529      529              
  Lines       33844    33840       -4     
==========================================
+ Hits        27513    28057     +544     
+ Misses       6331     5783     -548     
Impacted Files Coverage Δ
src/mam/mod_mam_muc.erl 74.88% <72.22%> (-0.35%) ⬇️
...hql/user/mongoose_graphql_stanza_user_mutation.erl 95.23% <100.00%> (-0.42%) ⬇️
src/mam/mod_mam_pm.erl 89.64% <100.00%> (-0.05%) ⬇️
src/mod_private.erl 84.21% <100.00%> (+1.15%) ⬆️
src/mongoose_tcp_listener.erl 68.08% <0.00%> (-4.26%) ⬇️
src/rdbms/mongoose_rdbms.erl 66.31% <0.00%> (-0.71%) ⬇️
src/pubsub/mod_pubsub.erl 73.23% <0.00%> (+0.18%) ⬆️
src/pubsub/mod_pubsub_db_rdbms.erl 95.34% <0.00%> (+0.25%) ⬆️
src/ejabberd_c2s.erl 89.23% <0.00%> (+0.29%) ⬆️
src/pubsub/mod_pubsub_db_mnesia.erl 92.82% <0.00%> (+0.42%) ⬆️
... and 18 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.

@esl esl deleted a comment from mongoose-im Oct 13, 2022
@mongoose-im
Copy link
Collaborator

mongoose-im commented Oct 13, 2022

pgsql_mnesia_25 / pgsql_mnesia / e850ec7
Reports root/ big
OK: 4340 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / e850ec7
Reports root/ big
OK: 4325 / Failed: 1 / User-skipped: 111 / 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,<<"c17855a25e701e62c2820779ce6ab3a69737217b">>,
           <9158.6096.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,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


mssql_mnesia_25 / odbc_mssql_mnesia / e850ec7
Reports root/ big
OK: 4340 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / e850ec7
Reports root/ big
OK: 2406 / Failed: 0 / User-skipped: 620 / Auto-skipped: 0

@mongoose-im
Copy link
Collaborator

mongoose-im commented Oct 13, 2022

small_tests_24 / small_tests / 5d14895
Reports root / small


small_tests_25 / small_tests / 5d14895
Reports root / small


ldap_mnesia_24 / ldap_mnesia / 5d14895
Reports root/ big
OK: 2090 / Failed: 0 / User-skipped: 769 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 5d14895
Reports root/ big
OK: 3966 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / 5d14895
Reports root/ big
OK: 2090 / Failed: 0 / User-skipped: 769 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 5d14895
Reports root/ big
OK: 3966 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / 5d14895
Reports root/ big
OK: 2226 / Failed: 0 / User-skipped: 633 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / 5d14895
Reports root/ big
OK: 3940 / Failed: 0 / User-skipped: 114 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 5d14895
Reports root/ big
OK: 4340 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 5d14895
Reports root/ big
OK: 2566 / Failed: 0 / User-skipped: 628 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 5d14895
Reports root/ big
OK: 3965 / Failed: 1 / User-skipped: 88 / Auto-skipped: 0

muc_SUITE:hibernation:hibernated_room_can_be_queried_for_archive
{error,{{assertion_failed,assert,is_groupchat_message,
              [<<"Restorable message">>],
              undefined,"undefined"},
    [{escalus_new_assert,assert_true,2,
               [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
                {line,84}]},
     {muc_SUITE,wait_for_mam_result,3,
          [{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
           {line,4394}]},
     {muc_SUITE,'-hibernated_room_can_be_queried_for_archive/1-fun-0-',3,
          [{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
           {line,4130}]},
     {escalus_story,story,4,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
             {line,72}]},
     {muc_SUITE,hibernated_room_can_be_queried_for_archive,1,
          [{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
           {line,4126}]},
     {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


riak_mnesia_24 / riak_mnesia / 5d14895
Reports root/ big
OK: 2406 / Failed: 0 / User-skipped: 620 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 5d14895
Reports root/ big
OK: 4340 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / 5d14895
Reports root/ big
OK: 4326 / Failed: 0 / User-skipped: 111 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / 5d14895
Reports root/ big
OK: 4340 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0

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.

I like these kinds of fast PRs 😛

@NelsonVides NelsonVides merged commit 2aa0aa7 into master Oct 13, 2022
@NelsonVides NelsonVides deleted the mu-mam-small-refactor branch October 13, 2022 10:58
@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