-
Notifications
You must be signed in to change notification settings - Fork 32
♻️ Refactor Models, Schema Validation, and DB Utilities (Spin-off 1 from PR #8141) #8360
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
♻️ Refactor Models, Schema Validation, and DB Utilities (Spin-off 1 from PR #8141) #8360
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8360 +/- ##
==========================================
+ Coverage 87.88% 87.90% +0.01%
==========================================
Files 1944 1945 +1
Lines 75603 75620 +17
Branches 1316 1316
==========================================
+ Hits 66447 66470 +23
+ Misses 8759 8753 -6
Partials 397 397
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
🧪 CI InsightsHere's what we observed from your CI run for c6903cd. ❌ Job Failures
✅ Passed Jobs With Interesting Signals
|
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.
Thanks, added a few comments.
packages/models-library/src/models_library/api_schemas_webserver/projects.py
Show resolved
Hide resolved
packages/postgres-database/src/simcore_postgres_database/utils_projects_nodes.py
Outdated
Show resolved
Hide resolved
packages/postgres-database/src/simcore_postgres_database/utils_projects_nodes.py
Outdated
Show resolved
Hide resolved
packages/postgres-database/tests/test_models_projects_to_jobs.py
Outdated
Show resolved
Hide resolved
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.
Thanks
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.
Please have a look at my concerns
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.
We reviewed offline
@mergify queue |
🟠 Waiting for conditions to match
|
|
I created #8365 to follow up on the fields marked as deprecated in the |
What do these changes do?
This pull request is a spin-off from PR #8141, which focuses on refactoring the
project.workbench
and therefore includes many many changes. This PR can be merged independently and will help reduce the size of the original PR and therefore make it easier to review. The changes here are mostly enhancements and utilities and do not introduce critical modifications to existing features.Model Validation and Schema Improvements
description
andthumbnail
fields inProjectGet
andBaseProjectModel
to use Pydantic'sBeforeValidator
for handlingNone
and empty strings, and removed legacy field validators for cleaner codeprogress
field inNode
fromfloat | None
toint | None
for stricter type enforcement, and added a newrequired_resources
field toNode
.Node
by marking them withdeprecated=True
in the field metadata.Database Utility Enhancements
exists
method toProjectsRepo
for checking project existence in the database, using a newpass_or_acquire_connection
helper.ProjectNodesRepo.add
to simplify value preparation and ensure correct model dumping, and addedinputs_required
toProjectNodeCreate
.model_dump_as_node
methods to bothProjectNodeCreate
andProjectNode
for converting database models to API models, excluding database-specific fields.Testing and Helper Improvements
assert_equal_ignoring_none
for flexible dictionary comparison in tests.test_models_projects_to_jobs
test to handle default column values and JSON serialization for dictionary fields, ensuring compatibility with schema changes.Type Alias and Import Cleanups
NodeID
as a type alias forUUID
, and cleaned up imports in several modules for clarity and correctness.Related issue/s
projects_nodes
table instead ofprojects.workbench
(🗃️) #8141 ready to mergeHow to test
Dev-ops
None