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

Implement GraphQL MUC Light user queries #3563

Merged
merged 14 commits into from
Mar 3, 2022

Conversation

Premwoik
Copy link
Contributor

@Premwoik Premwoik commented Feb 25, 2022

This PR implements the user part of the MUC Light category. The user API is basically the admin API without a user argument in queries and the user is taken from the context. User tests are mostly adapted admin tests.

In addition, this PR introduces a blocking list management API both for users and admin. It also adds a NonEmptyString scalar that validates if the given string is not empty.

I also provide here some admin part improvements:

  • Return passed page size as a limit field in the StanzaPayload type.
  • Use macro paths in admin tests.
  • Other minor fixes.

@codecov
Copy link

codecov bot commented Feb 25, 2022

Codecov Report

Merging #3563 (52f77be) into feature/graphql (28f484f) will increase coverage by 0.11%.
The diff coverage is 95.65%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           feature/graphql    #3563      +/-   ##
===================================================
+ Coverage            81.36%   81.47%   +0.11%     
===================================================
  Files                  454      456       +2     
  Lines                32955    33068     +113     
===================================================
+ Hits                 26814    26943     +129     
+ Misses                6141     6125      -16     
Impacted Files Coverage Δ
src/graphql/mongoose_graphql.erl 91.11% <ø> (ø)
...ngoose_client_api/mongoose_client_api_messages.erl 92.06% <ø> (ø)
src/graphql/mongoose_graphql_scalar.erl 66.66% <50.00%> (-5.56%) ⬇️
src/graphql/mongoose_graphql_enum.erl 58.82% <87.50%> (+22.45%) ⬆️
src/muc_light/mod_muc_light_api.erl 97.03% <94.91%> (+1.98%) ⬆️
...dmin/mongoose_graphql_muc_light_admin_mutation.erl 100.00% <100.00%> (ø)
...l/admin/mongoose_graphql_muc_light_admin_query.erl 100.00% <100.00%> (ø)
src/graphql/mongoose_graphql_muc_light_helper.erl 100.00% <100.00%> (ø)
.../user/mongoose_graphql_muc_light_user_mutation.erl 100.00% <100.00%> (ø)
...hql/user/mongoose_graphql_muc_light_user_query.erl 100.00% <100.00%> (ø)
... and 17 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 28f484f...52f77be. Read the comment docs.

@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
Copy link
Collaborator

mongoose-im commented Mar 1, 2022

small_tests_24 / small_tests / 48283d4
Reports root / small


small_tests_23 / small_tests / 48283d4
Reports root / small


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 48283d4
Reports root/ big
OK: 2793 / Failed: 0 / User-skipped: 238 / Auto-skipped: 0


dynamic_domains_mysql_redis_24 / mysql_redis / 48283d4
Reports root/ big
OK: 2776 / Failed: 0 / User-skipped: 255 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 48283d4
Reports root/ big
OK: 2793 / Failed: 0 / User-skipped: 238 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 48283d4
Reports root/ big
OK: 2793 / Failed: 0 / User-skipped: 238 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 48283d4
Reports root/ big
OK: 1568 / Failed: 0 / User-skipped: 424 / Auto-skipped: 0


internal_mnesia_24 / internal_mnesia / 48283d4
Reports root/ big
OK: 1614 / Failed: 0 / User-skipped: 378 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 48283d4
Reports root/ big
OK: 1568 / Failed: 0 / User-skipped: 424 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 48283d4
Reports root/ big
OK: 1920 / Failed: 0 / User-skipped: 379 / Auto-skipped: 0


pgsql_mnesia_23 / pgsql_mnesia / 48283d4
Reports root/ big
OK: 3180 / Failed: 0 / User-skipped: 247 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / 48283d4
Reports root/ big
OK: 3175 / Failed: 0 / User-skipped: 252 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 48283d4
Reports root/ big
OK: 3180 / Failed: 0 / User-skipped: 247 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / 48283d4
Reports root/ big
OK: 3180 / Failed: 0 / User-skipped: 247 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 48283d4
Reports root/ big
OK: 1768 / Failed: 0 / User-skipped: 377 / Auto-skipped: 0

@Premwoik Premwoik marked this pull request as ready for review March 2, 2022 07:54
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.

It all looks really good in general. I added a few minor comments.

big_tests/tests/graphql_muc_light_SUITE.erl Outdated Show resolved Hide resolved
big_tests/tests/graphql_muc_light_SUITE.erl Outdated Show resolved Hide resolved
big_tests/tests/graphql_muc_light_SUITE.erl Show resolved Hide resolved
big_tests/tests/graphql_muc_light_SUITE.erl Outdated Show resolved Hide resolved
big_tests/tests/graphql_muc_light_SUITE.erl Outdated Show resolved Hide resolved
big_tests/tests/graphql_muc_light_SUITE.erl Outdated Show resolved Hide resolved
big_tests/tests/graphql_muc_light_SUITE.erl Outdated Show resolved Hide resolved
priv/graphql/schemas/global/muc.gql Outdated Show resolved Hide resolved
src/muc_light/mod_muc_light_api.erl Outdated Show resolved Hide resolved
Base automatically changed from graphql/muc-light-api to feature/graphql March 2, 2022 16:44
Separate creating a room with generated id from creating a room with the given one.
@mongoose-im

This comment was marked as outdated.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Mar 3, 2022

small_tests_24 / small_tests / 52f77be
Reports root / small


small_tests_23 / small_tests / 52f77be
Reports root / small


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 52f77be
Reports root/ big
OK: 2793 / Failed: 0 / User-skipped: 238 / Auto-skipped: 0


dynamic_domains_mysql_redis_24 / mysql_redis / 52f77be
Reports root/ big
OK: 2776 / Failed: 0 / User-skipped: 255 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 52f77be
Reports root/ big
OK: 2793 / Failed: 0 / User-skipped: 238 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 52f77be
Reports root/ big
OK: 2793 / Failed: 0 / User-skipped: 238 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 52f77be
Reports root/ big
OK: 1568 / Failed: 0 / User-skipped: 424 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 52f77be
Reports root/ big
OK: 1568 / Failed: 0 / User-skipped: 424 / Auto-skipped: 0


internal_mnesia_24 / internal_mnesia / 52f77be
Reports root/ big
OK: 1614 / Failed: 0 / User-skipped: 378 / Auto-skipped: 0


pgsql_mnesia_23 / pgsql_mnesia / 52f77be
Reports root/ big
OK: 3180 / Failed: 0 / User-skipped: 247 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / 52f77be
Reports root/ big
OK: 3180 / Failed: 0 / User-skipped: 247 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / 52f77be
Reports root/ big
OK: 3175 / Failed: 0 / User-skipped: 252 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 52f77be
Reports root/ big
OK: 3180 / Failed: 0 / User-skipped: 247 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 52f77be
Reports root/ big
OK: 1920 / Failed: 0 / User-skipped: 379 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 52f77be
Reports root/ big
OK: 1768 / Failed: 0 / User-skipped: 377 / Auto-skipped: 0

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.

All great 👍

@chrzaszcz chrzaszcz merged commit 08f95fa into feature/graphql Mar 3, 2022
@chrzaszcz chrzaszcz deleted the graphql/muc-light-api-user branch March 3, 2022 10:24
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants