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

Access commands in maps #3656

Merged
merged 2 commits into from
May 27, 2022
Merged

Access commands in maps #3656

merged 2 commits into from
May 27, 2022

Conversation

chrzaszcz
Copy link
Member

@chrzaszcz chrzaszcz commented May 26, 2022

Convert the configuration of command access rules to use maps with defaults.

This allows to remove the temporary prepend_key wrapper.

@chrzaszcz chrzaszcz changed the base branch from master to config-items-in-map May 26, 2022 11:05
@codecov
Copy link

codecov bot commented May 26, 2022

Codecov Report

Merging #3656 (4f53d01) into config-items-in-map (651e21a) will increase coverage by 0.03%.
The diff coverage is 90.90%.

@@                   Coverage Diff                   @@
##           config-items-in-map    #3656      +/-   ##
=======================================================
+ Coverage                81.12%   81.15%   +0.03%     
=======================================================
  Files                      433      433              
  Lines                    31901    31899       -2     
=======================================================
+ Hits                     25879    25888       +9     
+ Misses                    6022     6011      -11     
Impacted Files Coverage Δ
src/config/mongoose_config_parser_toml.erl 99.19% <ø> (-0.02%) ⬇️
src/config/mongoose_config_spec.erl 100.00% <ø> (ø)
src/ejabberd_ctl.erl 16.72% <ø> (ø)
src/ejabberd_commands.erl 90.54% <90.90%> (+2.86%) ⬆️
src/elasticsearch/mongoose_elasticsearch.erl 76.92% <0.00%> (-7.70%) ⬇️
src/mam/mod_mam_elasticsearch_arch.erl 85.08% <0.00%> (-1.76%) ⬇️
src/muc_light/mod_muc_light_db_mnesia.erl 89.47% <0.00%> (-1.06%) ⬇️
src/domain/mongoose_domain_loader.erl 89.28% <0.00%> (-0.90%) ⬇️
src/pubsub/mod_pubsub.erl 73.42% <0.00%> (+0.06%) ⬆️
src/ejabberd_c2s.erl 89.22% <0.00%> (+0.29%) ⬆️
... and 5 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 651e21a...4f53d01. Read the comment docs.

@mongoose-im
Copy link
Collaborator

mongoose-im commented May 26, 2022

small_tests_24 / small_tests / 6a224e3
Reports root / small


small_tests_23 / small_tests / 6a224e3
Reports root / small


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 6a224e3
Reports root/ big
OK: 2906 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 6a224e3
Reports root/ big
OK: 2906 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


dynamic_domains_mysql_redis_24 / mysql_redis / 6a224e3
Reports root/ big
OK: 2889 / Failed: 0 / User-skipped: 105 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 6a224e3
Reports root/ big
OK: 1507 / Failed: 0 / User-skipped: 401 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 6a224e3
Reports root/ big
OK: 1507 / Failed: 0 / User-skipped: 401 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 6a224e3
Reports root/ big
OK: 2906 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


internal_mnesia_24 / internal_mnesia / 6a224e3
Reports root/ big
OK: 1592 / Failed: 0 / User-skipped: 316 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 6a224e3
Reports root/ big
OK: 3280 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 6a224e3
Reports root/ big
OK: 1899 / Failed: 0 / User-skipped: 324 / Auto-skipped: 0


pgsql_mnesia_23 / pgsql_mnesia / 6a224e3
Reports root/ big
OK: 3280 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / 6a224e3
Reports root/ big
OK: 3282 / Failed: 1 / User-skipped: 103 / Auto-skipped: 0

pubsub_SUITE:dag+node_config:send_last_published_item_test
{error,{{badmatch,false},
    [{pubsub_tools,check_response,2,
             [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
            {line,491}]},
     {pubsub_tools,receive_response,3,
             [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
            {line,481}]},
     {pubsub_tools,receive_subscribe_response,3,
             [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
            {line,334}]},
     {pubsub_SUITE,'-send_last_published_item_test/1-fun-0-',2,
             [{file,"/home/circleci/project/big_tests/tests/pubsub_SUITE.erl"},
            {line,937}]},
     {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,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


mssql_mnesia_24 / odbc_mssql_mnesia / 6a224e3
Reports root/ big
OK: 3280 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 6a224e3
Reports root/ big
OK: 1742 / Failed: 0 / User-skipped: 323 / Auto-skipped: 0

Paweł Chrząszcz added 2 commits May 26, 2022 15:19
The logic can use the maps directly to be more straightforward.

This allows to remove the 'prepend_key' wrapper, which was temporary.
@mongoose-im
Copy link
Collaborator

mongoose-im commented May 26, 2022

small_tests_24 / small_tests / 4f53d01
Reports root / small


small_tests_23 / small_tests / 4f53d01
Reports root / small


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 4f53d01
Reports root/ big
OK: 2906 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


dynamic_domains_mysql_redis_24 / mysql_redis / 4f53d01
Reports root/ big
OK: 2889 / Failed: 0 / User-skipped: 105 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 4f53d01
Reports root/ big
OK: 2906 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 4f53d01
Reports root/ big
OK: 2906 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 4f53d01
Reports root/ big
OK: 1507 / Failed: 0 / User-skipped: 401 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 4f53d01
Reports root/ big
OK: 1507 / Failed: 0 / User-skipped: 401 / Auto-skipped: 0


internal_mnesia_24 / internal_mnesia / 4f53d01
Reports root/ big
OK: 1592 / Failed: 0 / User-skipped: 316 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 4f53d01
Reports root/ big
OK: 1899 / Failed: 0 / User-skipped: 324 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 4f53d01
Reports root/ big
OK: 3280 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


pgsql_mnesia_23 / pgsql_mnesia / 4f53d01
Reports root/ big
OK: 3291 / 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_1766@localhost">>},
         {<<"to">>,
        <<"bob_unsubscribe_after_presence_unsubscription_1766@localhost/res1">>},
         {<<"type">>,<<"headline">>}],
        [{xmlel,<<"event">>,
           [{<<"xmlns">>,
           <<"http://jabber.org/protocol/pubsub#event">>}],
           [{xmlel,<<"items">>,
            [{<<"node">>,<<"YdZ6S7PX0YjE51LsQm+zOQ==">>}],
            [{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,1754}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_server.erl"},{line,1263}]},
    {test_server,run_test_case_eval,9,
      [{file,"test_server.erl"},{line,1195}]}]}}

Report log


mysql_redis_24 / mysql_redis / 4f53d01
Reports root/ big
OK: 3286 / Failed: 1 / User-skipped: 102 / Auto-skipped: 0

pep_SUITE:pep_tests:unsubscribe_after_presence_unsubscription
{error,
  {{badmatch,
     [{xmlel,<<"message">>,
        [{<<"from">>,
        <<"alice_unsubscribe_after_presence_unsubscription_1878@localhost">>},
         {<<"to">>,
        <<"bob_unsubscribe_after_presence_unsubscription_1878@localhost/res1">>},
         {<<"type">>,<<"headline">>}],
        [{xmlel,<<"event">>,
           [{<<"xmlns">>,
           <<"http://jabber.org/protocol/pubsub#event">>}],
           [{xmlel,<<"items">>,
            [{<<"node">>,<<"5tRfcqV9uUN8B2vi7IqtCA==">>}],
            [{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,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


mssql_mnesia_24 / odbc_mssql_mnesia / 4f53d01
Reports root/ big
OK: 3280 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 4f53d01
Reports root/ big
OK: 1742 / Failed: 0 / User-skipped: 323 / Auto-skipped: 0

@chrzaszcz chrzaszcz marked this pull request as ready for review May 26, 2022 13:56
Copy link
Contributor

@Premwoik Premwoik left a comment

Choose a reason for hiding this comment

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

Looks good

Base automatically changed from config-items-in-map to master May 27, 2022 08:47
Copy link
Contributor

@arcusfelis arcusfelis left a comment

Choose a reason for hiding this comment

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

ok

@arcusfelis arcusfelis merged commit de85082 into master May 27, 2022
@arcusfelis arcusfelis deleted the access-commands-in-maps branch May 27, 2022 08:48
@Premwoik Premwoik added this to the 5.1.0 milestone Jun 6, 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