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

Tag should be an atom, it's binary in ldap types #3178

Merged
merged 2 commits into from
Jul 12, 2021
Merged

Conversation

arcusfelis
Copy link
Contributor

@arcusfelis arcusfelis commented Jul 12, 2021

Also, made some ldap types in eldap_utils

===> Analyzing 405 files with "/Users/mikhailuvarov/erlang/esl/MongooseIM/_build/default/rebar3_22.3.4.10_plt"...                                                                                  [14/2732]

src/auth/ejabberd_auth_ldap.erl
 150: Invalid type specification for function ejabberd_auth_ldap:set_password/4. The success typing is (binary(),binary(),binary(),_) -> {'error','user_not_found'}
 155: The inferred return type of set_password/4 ({'error','user_not_found'}) has nothing in common with 'ok' | {'error','invalid_jid' | 'not_allowed'}, which is the expected return type for the callback
of mongoose_gen_auth behaviour
 159: The variable DN can never match since previous clauses completely covered the type 'false'
 168: Function try_register/4 has no local return
 177: The call eldap_pool:add({binary(),binary()}, DN::[byte(),...], Attrs::[{[1..255,...],[[byte()],...]},...]) will never return since it differs in the 1st argument from the success typing arguments: (
{'global' | binary(),atom()}, any(), [{_,[any()]}])
 216: The variable DN can never match since previous clauses completely covered the type 'false'
 251: The variable DN can never match since previous clauses completely covered the type 'false'
 267: The call eldap_pool:search(EldapID::{binary(),binary()}, [{'attributes',maybe_improper_list()} | {'base',binary()} | {'deref','derefAlways' | 'derefFindingBaseObj' | 'derefInSearching' | 'neverDeref
Aliases'} | {'filter',_} | {'timeout',5},...]) will never return since it differs in the 1st argument from the success typing arguments: ({'global' | binary(),atom()}, [{_,_}])
 315: The variable _DN can never match since previous clauses completely covered the type 'false'
 335: The call eldap_pool:search({binary(),binary()}, [{'attributes',maybe_improper_list()} | {'base',binary()} | {'deref','derefAlways' | 'derefFindingBaseObj' | 'derefInSearching' | 'neverDerefAliases'}
 | {'filter',_},...]) will never return since it differs in the 1st argument from the success typing arguments: ({'global' | binary(),atom()}, [{_,_}])
 390: The call eldap_pool:search({binary(),binary()}, [{'attributes',[<<_:16>>,...]} | {'base',binary()} | {'deref','derefAlways' | 'derefFindingBaseObj' | 'derefInSearching' | 'neverDerefAliases'} | {'fi
lter',_},...]) will never return since it differs in the 1st argument from the success typing arguments: ({'global' | binary(),atom()}, [{_,_}])

src/mod_shared_roster_ldap.erl
 192: The pattern [{U1, S1} | _] can never match the type []
 218: The pattern 'stop' can never match the type 'false'
 220: The pattern {'stop', 'false'} can never match the type 'false'
 232: The pattern 'stop' can never match the type 'false'
 234: The pattern {'stop', 'false'} can never match the type 'false'
 250: The pattern 'true' can never match the type 'false'
 354: The call eldap_pool:search({binary(),binary()}, [{'attributes',[binary(),...]} | {'base',binary()} | {'deref','derefAlways' | 'derefFindingBaseObj' | 'derefInSearching' | 'neverDerefAliases'} | {'fi
lter',_} | {'timeout',5},...]) will never return since it differs in the 1st argument from the success typing arguments: ({'global' | binary(),atom()}, [{_,_}])
 449: The variable LDAPEntries can never match since previous clauses completely covered the type []
 455: Function ldap_entries_to_group/6 will never be called
 458: Function ldap_entries_to_group/7 will never be called
 479: Function check_and_accumulate_member/4 will never be called
 502: The pattern [{'eldap_entry', _, Attrs} | _] can never match the type []

 src/mod_vcard_ldap.erl
 156: Matching of pattern {'eldap_entry', _, Attributes} tagged with a record name violates the declared type of 'false'
 246: Function eldap_pool_search/6 has no local return
 247: The call eldap_pool:search(EldapID::{binary(),binary()}, [{'attributes',[binary()]} | {'base',binary()} | {'deref','derefAlways' | 'derefFindingBaseObj' | 'derefInSearching' | 'neverDerefAliases'} | {'filter',_},...]) will never return since it differs in the 1st argument from the success typing arguments: ({'global' | binary(),atom()}, [{_,_}])
 257: Function ldap_attributes_to_vcard/3 will never be called
 284: Function ldap_attribute_to_vcard/2 will never be called
 387: Function limited_results/2 will never be called
 394: Function search_items/2 will never be called
 398: Function attrs_to_item_xml/2 will never be called
 409: Function make_user_item_if_exists/3 will never be called
 429: Function search_item_value/3 will never be called
 435: Function map_vcard_attr/4 will never be called
 449: Function process_pattern/3 will never be called

Also, made some ldap types in eldap_utils
@codecov
Copy link

codecov bot commented Jul 12, 2021

Codecov Report

Merging #3178 (5b35e43) into master (de27b3f) will decrease coverage by 0.01%.
The diff coverage is 68.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3178      +/-   ##
==========================================
- Coverage   80.27%   80.25%   -0.02%     
==========================================
  Files         396      396              
  Lines       32327    32335       +8     
==========================================
+ Hits        25950    25951       +1     
- Misses       6377     6384       +7     
Impacted Files Coverage Δ
src/auth/mongoose_gen_auth.erl 85.00% <ø> (ø)
src/eldap_pool.erl 90.47% <ø> (ø)
src/eldap_utils.erl 55.07% <ø> (ø)
src/auth/ejabberd_auth_ldap.erl 68.08% <57.14%> (+0.20%) ⬆️
src/mod_vcard_ldap.erl 90.69% <75.00%> (+0.10%) ⬆️
src/mod_shared_roster_ldap.erl 61.16% <100.00%> (+0.34%) ⬆️
src/mod_roster_riak.erl 81.53% <0.00%> (-15.39%) ⬇️
src/jingle_sip/mod_jingle_sip_backend.erl 80.00% <0.00%> (-5.00%) ⬇️
src/mongoose_tcp_listener.erl 76.59% <0.00%> (-4.26%) ⬇️
src/pubsub/mod_pubsub_db_mnesia.erl 92.40% <0.00%> (-0.43%) ⬇️
... and 8 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 de27b3f...5b35e43. Read the comment docs.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Jul 12, 2021

small_tests_21_3 / small_tests / b63b99f
Reports root / small


small_tests_22 / small_tests / b63b99f
Reports root / small


small_tests_23 / small_tests / b63b99f
Reports root / small


dynamic_domains / pgsql_mnesia / b63b99f
Reports root/ big
OK: 1585 / Failed: 0 / User-skipped: 111 / Auto-skipped: 0


ldap_mnesia_21 / ldap_mnesia / b63b99f
Reports root/ big
OK: 1514 / Failed: 0 / User-skipped: 359 / Auto-skipped: 0


ldap_mnesia_22 / ldap_mnesia / b63b99f
Reports root/ big
OK: 1514 / Failed: 0 / User-skipped: 359 / Auto-skipped: 0


internal_mnesia / internal_mnesia / b63b99f
Reports root/ big
OK: 1587 / Failed: 0 / User-skipped: 286 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / b63b99f
Reports root/ big
OK: 1514 / Failed: 0 / User-skipped: 359 / Auto-skipped: 0


pgsql_mnesia / pgsql_mnesia / b63b99f
Reports root/ big
OK: 3084 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


elasticsearch_and_cassandra / elasticsearch_and_cassandra_mnesia / b63b99f
Reports root/ big
OK: 1890 / Failed: 0 / User-skipped: 282 / Auto-skipped: 0


mssql_mnesia / odbc_mssql_mnesia / b63b99f
Reports root/ big
OK: 3083 / Failed: 0 / User-skipped: 184 / Auto-skipped: 1


mysql_redis / mysql_redis / b63b99f
Reports root/ big
OK: 3067 / Failed: 0 / User-skipped: 201 / Auto-skipped: 0


riak_mnesia / riak_mnesia / b63b99f
Reports root/ big
OK: 1737 / Failed: 0 / User-skipped: 285 / 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.

LGTM

Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

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

The code looks good, I only have a few comments.

src/mod_vcard_ldap.erl Outdated Show resolved Hide resolved
src/mod_vcard_ldap.erl Outdated Show resolved Hide resolved
@mongoose-im
Copy link
Collaborator

mongoose-im commented Jul 12, 2021

small_tests_21_3 / small_tests / 5b35e43
Reports root / small


dynamic_domains / pgsql_mnesia / 5b35e43
Reports root/ big
OK: 1585 / Failed: 0 / User-skipped: 111 / Auto-skipped: 0


small_tests_22 / small_tests / 5b35e43
Reports root / small


small_tests_23 / small_tests / 5b35e43
Reports root / small


ldap_mnesia_21 / ldap_mnesia / 5b35e43
Reports root/ big
OK: 1514 / Failed: 0 / User-skipped: 359 / Auto-skipped: 0


ldap_mnesia_22 / ldap_mnesia / 5b35e43
Reports root/ big
OK: 1514 / Failed: 0 / User-skipped: 359 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 5b35e43
Reports root/ big
OK: 1514 / Failed: 0 / User-skipped: 359 / Auto-skipped: 0


internal_mnesia / internal_mnesia / 5b35e43
Reports root/ big
OK: 1587 / Failed: 0 / User-skipped: 286 / Auto-skipped: 0


elasticsearch_and_cassandra / elasticsearch_and_cassandra_mnesia / 5b35e43
Reports root/ big
OK: 1890 / Failed: 0 / User-skipped: 282 / Auto-skipped: 0


mysql_redis / mysql_redis / 5b35e43
Reports root/ big
OK: 3067 / Failed: 0 / User-skipped: 201 / Auto-skipped: 0


pgsql_mnesia / pgsql_mnesia / 5b35e43
Reports root/ big
OK: 3084 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


mssql_mnesia / odbc_mssql_mnesia / 5b35e43
Reports root/ big
OK: 3102 / Failed: 1 / User-skipped: 184 / Auto-skipped: 0

inbox_SUITE:one_to_one:carbons_are_not_stored
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,
          <<"bOb_carbons_are_not_stored_81.433411@localhost/res1">>,
          escalus_tcp,<0.17888.0>,
          [{event_manager,<0.17753.0>},
           {server,<<"localhost">>},
           {username,<<"bOb_carbons_are_not_stored_81.433411">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.17753.0>},
            {server,<<"localhost">>},
            {username,<<"bOb_carbons_are_not_stored_81.433411">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,<<"bOb_carbons_are_not_stored_81.433411">>},
           {server,<<"localhost">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,{escalus_auth,auth_plain}},
           {wspath,undefined},
           {username,<<"bOb_carbons_are_not_stored_81.433411">>},
           {server,<<"localhost">>},
           {password,<<"makrolika">>},
           {stream_id,<<"51f3592f2f140535">>}]},
        5000],
       [{file,
          "/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {inbox_helper,get_inbox,3,
       [{file,"/home/circleci/app/big_tests/tests/inbox_helper.erl"},
        {line,219}]},
     {inbox_helper,check_inbox,4,
       [{file,"/home/circleci/app/big_tests/tests/inbox_helper.erl"},
        {line,165}]},
     {escalus_story,story,4,
       [{file,
      ...

Report log


riak_mnesia / riak_mnesia / 5b35e43
Reports root/ big
OK: 1737 / Failed: 0 / User-skipped: 285 / Auto-skipped: 0


small_tests_22 / small_tests / 5b35e43
Reports root / small

@chrzaszcz chrzaszcz merged commit 2a6381f into master Jul 12, 2021
@chrzaszcz chrzaszcz deleted the mu-fix-ldap-types branch July 12, 2021 11:52
@Premwoik Premwoik added this to the 5.0.0 milestone Oct 5, 2021
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

5 participants