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

Feature/m3o dbaas #30

Merged
merged 40 commits into from
Aug 19, 2022
Merged

Feature/m3o dbaas #30

merged 40 commits into from
Aug 19, 2022

Conversation

codecakes
Copy link
Contributor

@codecakes codecakes commented Aug 16, 2022

This feature branch implements m3o database adapter.

A good way to locally test is like

docker run -it --rm -p 8081:8080 -e LOCAL_PORT=8080 -e DOCUMENTATION_API=0.0.0.0:8080 -e M3O_API_TOKEN=$M3O_API_TOKEN -e ENV=test

where M3O_API_TOKEN is the API token from M3O account.

  • A number of smaller refactors enables it to plug a DI mapper to run service plugged to either dummy repo or m3o repo
  • Capability to add more application services alongwith their uows in the di mapper interface
  • Capability to expand on m3o repo for bulk atomic writes or revert by clearing pending bulk transactions upon failure
  • refactored start.sh to run on test or prod level;

codecakes and others added 24 commits July 27, 2022 20:22
…pi adapter with dummy repos module to test api calls. ignoring [no-any-unimported] for starlette Request
…odules in python executable and mypy config set to pyproject.toml. update mypy ignore in app.py
…. this is needed to set within project scope virtualenv. this allows setting virtualenv and installing poetry packages locally.
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Aug 16, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.08%.

Quality metrics Before After Change
Complexity 1.03 ⭐ 1.20 ⭐ 0.17 👎
Method Length 35.73 ⭐ 36.90 ⭐ 1.17 👎
Working memory 4.50 ⭐ 4.44 ⭐ -0.06 👍
Quality 88.54% 88.46% -0.08% 👎
Other metrics Before After Change
Lines 746 604 -142
Changed files Quality Before Quality After Quality Change
registrations/domain/services/application_services.py 88.16% ⭐ 88.16% ⭐ 0.00%
registrations/domain/services/hospital_registration_services.py 90.19% ⭐ 89.94% ⭐ -0.25% 👎
registrations/infrastructure/adapters/api/app.py 87.40% ⭐ 89.21% ⭐ 1.81% 👍
registrations/infrastructure/adapters/api/di_builder.py 96.67% ⭐ 94.13% ⭐ -2.54% 👎
registrations/infrastructure/adapters/api/routers/register_hospital_router.py 92.19% ⭐ 87.45% ⭐ -4.74% 👎
registrations/utils/errors.py 90.41% ⭐ 92.60% ⭐ 2.19% 👍
tests/test_registrations.py 87.41% ⭐ 87.29% ⭐ -0.12% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

codecakes and others added 3 commits August 16, 2022 17:46
* updated Structure of core project

* smaller header style

* added geolocation and added_since fields. added application service test case for added_since

* Format code with black and isort

* commented description on complex regex string

* added mypy to poetry, updated precommit. refactored and updates fastapi adapter with dummy repos module to test api calls. ignoring [no-any-unimported] for starlette Request

* no need of requirements file. updated pre-commit mypy to resolve to modules in python executable and mypy config set to pyproject.toml. update mypy ignore in app.py

* updated readme to add poetry.toml; this is not extensively documented. this is needed to set within project scope virtualenv. this allows setting virtualenv and installing poetry packages locally.

* Format code with black and isort

* shortened command is easier to reproduce, port and build in CI on external deployment services

* adding another dockerfile that works as image for cloud run. updating cors middleware on app server

* Format code with black and isort

* Add a shebang or a 'shell' directive.

* error when it errs

* Format code with black and isort

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: Sourcery AI <>
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
@codecakes codecakes self-assigned this Aug 16, 2022
@codecakes codecakes added enhancement New feature or request infrastructure dependencies Pull requests that update a dependency file refactor hospital-registration Story ticket/Issue relates to Hospital Registration Service labels Aug 16, 2022
@codecakes codecakes marked this pull request as ready for review August 18, 2022 14:19
@codecakes codecakes requested a review from nlinde August 18, 2022 14:19
@codecakes codecakes merged commit 82e3a21 into develop Aug 19, 2022
@codecakes codecakes deleted the feature/m3o-dbaas branch August 19, 2022 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request hospital-registration Story ticket/Issue relates to Hospital Registration Service infrastructure refactor
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants