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

REST and CLI API for domains #3058

Merged
merged 27 commits into from
Mar 26, 2021
Merged

Conversation

arcusfelis
Copy link
Contributor

@arcusfelis arcusfelis commented Mar 18, 2021

This PR addresses "REST and CLI API for domains".

Proposed changes include:

  • insert_domain
  • enable/disable
  • select_domain over REST.

@arcusfelis arcusfelis marked this pull request as draft March 18, 2021 08:22
@codecov
Copy link

codecov bot commented Mar 18, 2021

Codecov Report

Merging #3058 (e7bef6d) into multi-tenancy-phase-1 (f991ee2) will increase coverage by 0.60%.
The diff coverage is 90.41%.

Impacted file tree graph

@@                    Coverage Diff                    @@
##           multi-tenancy-phase-1    #3058      +/-   ##
=========================================================
+ Coverage                  78.09%   78.70%   +0.60%     
=========================================================
  Files                        374      387      +13     
  Lines                      31219    31576     +357     
=========================================================
+ Hits                       24382    24851     +469     
+ Misses                      6837     6725     -112     
Impacted Files Coverage Δ
src/admin_extra/service_admin_extra.erl 100.00% <ø> (ø)
src/auth/ejabberd_auth_anonymous.erl 48.75% <0.00%> (-1.25%) ⬇️
src/domain/mongoose_domain_utils.erl 0.00% <0.00%> (ø)
src/ejabberd_gen_sm.erl 90.90% <ø> (ø)
src/ejabberd_local.erl 62.68% <0.00%> (-1.50%) ⬇️
src/muc_light/mod_muc_light_db_mnesia.erl 89.47% <ø> (+4.47%) ⬆️
src/offline/mod_offline_mnesia.erl 51.47% <0.00%> (ø)
src/pubsub/pubsub_form_utils.erl 56.60% <0.00%> (+1.04%) ⬆️
src/rdbms/rdbms_queries_mssql.erl 100.00% <ø> (ø)
src/rdbms/mongoose_rdbms_odbc.erl 75.78% <45.45%> (-1.86%) ⬇️
... and 96 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 3626394...e7bef6d. Read the comment docs.

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'm afraid that mongoose_domain_h and service_admin_extra_domain are insanely similar to each other, I'm sad about the repeated code 😿 But I don't care about that, I'm mostly concerned, why basically not a single error-path has test coverage? Are we only testing happy cases? Can that be improved?

rel/files/mongooseim.toml Outdated Show resolved Hide resolved
src/domain/mongoose_domain_h.erl Outdated Show resolved Hide resolved
@arcusfelis arcusfelis marked this pull request as ready for review March 24, 2021 07:23
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.

Test coverage is much better now, but codecov shows some missing coverage for deleting domains errors, can we throw a bunch of tests there as well?

doc/developers-guide/domain_management.md Outdated Show resolved Hide resolved
doc/developers-guide/domain_management.md Outdated Show resolved Hide resolved
doc/developers-guide/domain_management.md Outdated Show resolved Hide resolved
arcusfelis and others added 2 commits March 24, 2021 16:00
Co-authored-by: Nelson Vides <nelson.vides@erlang-solutions.com>
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.

Looks good. I added a few minor remarks. There are two more observations:

  • Adding tests for unhappy paths in the REST API would be good. This can be done later.
  • Newly added modules are missing specs, adding them in subsequent PR's would be nice as well.

big_tests/tests/service_domain_db_SUITE.erl Outdated Show resolved Hide resolved
big_tests/tests/service_domain_db_SUITE.erl Outdated Show resolved Hide resolved
doc/developers-guide/domain_management.md Outdated Show resolved Hide resolved
src/domain/service_admin_extra_domain.erl Show resolved Hide resolved
src/domain/service_admin_extra_domain.erl Show resolved Hide resolved
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.

Good work! A lot of tests! Only one comment from me.

doc/developers-guide/domain_management.md 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.

All fine. Tests could have been organised to run in parallel when possible and then cut suite time, but anyway, we can leave that for the future.

@NelsonVides NelsonVides merged commit bfc788d into multi-tenancy-phase-1 Mar 26, 2021
@NelsonVides NelsonVides deleted the mu-domain-service-api branch March 26, 2021 17:29
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.

3 participants