-
Notifications
You must be signed in to change notification settings - Fork 27
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
♻️ Moves webserver's projects api models to models_library #4425
♻️ Moves webserver's projects api models to models_library #4425
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4425 +/- ##
========================================
+ Coverage 78.5% 84.5% +5.9%
========================================
Files 820 722 -98
Lines 34967 34460 -507
Branches 627 664 +37
========================================
+ Hits 27478 29129 +1651
+ Misses 7340 5177 -2163
- Partials 149 154 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
|
afcb0f7
to
12558f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed, since we have pydantic through the basic_models in the postgres-database package I am not sure it makes sense to separate it from the postgres-repositories one.
@sanderegg check the diagram again. YOu mean this? I personally like to separate models from "functions": |
12558f6
to
a99bd30
Compare
Code Climate has analyzed commit a99bd30 and detected 0 issues on this pull request. View more on Code Climate. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
What do these changes do?
OAS include schemas for the request body, response payload, path & query parameters. These schemas are represented in the code by pydantic models. Moving these models to
models_library
has the following benefits:The schemas in
models_library
only correspond to those used by the backend services, i.e. all the APIs except for that of theapi-server
service.Highlights
This PR includes:
projects
resource in thewebserver
's APIlong_running_tasks
resource inservicelib
models_library
intoservicelib
Code Layout
I propose to define modules named like
models_library.api_schemas_$(service_or_module_name)
withbase
:$(resource-name)
module for the resource schemasDependencies
A proposal on how to extend modules intra-dependencies including
basic_types
: Create common package without any extra dependencies #4013. (discussion with @GitHK )postgres_repositories
: combines pydantic&sqlalchemy models to build repository pattern on top of the database (discussion with @sanderegg )Related issue/s
How to test
DevOps
None