-
Notifications
You must be signed in to change notification settings - Fork 32
WIP: ✨ Is23/po center preparation #8545
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
base: master
Are you sure you want to change the base?
WIP: ✨ Is23/po center preparation #8545
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #8545 +/- ##
===========================================
- Coverage 84.72% 66.44% -18.29%
===========================================
Files 2010 804 -1206
Lines 78561 36158 -42403
Branches 1349 175 -1174
===========================================
- Hits 66559 24024 -42535
- Misses 11598 12077 +479
+ Partials 404 57 -347
*This pull request uses carry forward flags. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR refactors user admin API query handling and adds robust ordering support for API list operations. The main changes include:
- Introduction of generic ordering infrastructure via
OrderingQueryParamswith support for comma-separated field ordering - Enhanced user account listing with validated multi-field ordering capabilities
- Improved type annotations using
annotated_types.doc()for clearer parameter documentation - Email validation improvements in invitation models with lowercase normalization
Reviewed Changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
.github/instructions/python.instructions.md |
Added guidelines for using annotated_types.doc() for parameter documentation |
packages/models-library/src/models_library/list_operations.py |
New module defining OrderDirection, OrderClause, and check_ordering_list for validated ordering operations |
packages/models-library/src/models_library/rest_ordering.py |
Refactored to add OrderingQueryParams with comma-separated string parsing support |
packages/models-library/src/models_library/invitations.py |
Updated to use Annotated types, enforce lowercase emails, and use datetime.now(tz=UTC) |
packages/models-library/src/models_library/api_schemas_webserver/users.py |
Added UserAccountOrderFields and integrated OrderingQueryParams into UsersAccountListQueryParams |
services/web/server/src/simcore_service_webserver/users/_accounts_repository.py |
Added OrderKeys, MergedUserData types, and ordering support in list_merged_pre_and_registered_users |
services/web/server/src/simcore_service_webserver/users/_accounts_service.py |
Updated documentation using annotated_types.doc() and added order_by parameter support |
services/web/server/src/simcore_service_webserver/users/_controller/rest/accounts_rest.py |
Added field mapping for ordering and integrated order_by into list endpoint |
services/web/server/src/simcore_service_webserver/users/plugin.py |
Renamed import from users_rest to profile_rest |
api/specs/web-server/_users_admin.py |
Updated to use separate query model and explicit order_by parameter |
api/specs/web-server/_common.py |
Improved assertion error message in as_query |
| Test files | Added comprehensive tests for ordering validation, invitation timestamps, and case-insensitive search |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
services/web/server/src/simcore_service_webserver/users/_controller/rest/accounts_rest.py
Outdated
Show resolved
Hide resolved
services/web/server/src/simcore_service_webserver/users/_accounts_repository.py
Show resolved
Hide resolved
…tility for retrieving literal values
…documentation and validation for order_by field
…ent excessive results
…ype and update ordering logic with OrderDirection
…d type annotations
…ype annotations; remove unused functions and imports
…tation and remove unused arguments; enhance user account listing with order mapping
5ee8462 to
6d80b2c
Compare
|



What do these changes do?
This pull request refactors user admin API query handling, and adds robust ordering support for API list operations. The main changes include enhanced ordering query parameter models, updates to user account filtering and ordering and a new convention for documenting type annotations. Additionally, invitation models now enforce lowercase emails and use more precise type annotations.
API List Operations and Ordering Support:
OrderDirection,OrderClause, andcheck_ordering_listin the newlist_operations.pymodule, providing a generic and validated way to handle multi-field ordering for API queries.rest_ordering.pyto support generic ordering viaOrderingQueryParams, parsing comma-separated strings into validated order clauses and handling duplicates/conflicts robustly. [1] [2]User Admin API Query Refactoring:
_Q) that combines filtering and pagination, and added support for anorder_byparameter for flexible sorting. [1] [2]UsersAccountListQueryParamsto inherit fromOrderingQueryParamsand define valid ordering fields, improving API consistency and validation. [1] [2]User Account Search Query Enhancements:
Invitation Model Improvements:
Annotatedfor all fields, enforce lowercase emails viaAfterValidator, and clarify docstrings. Also switched to usingdatetime.now(tz=UTC)for timestamps. [1] [2] [3] [4]Python Coding Instructions and Documentation:
.github/instructions/python.instructions.mddescribing how to useannotated_types.doc()for parameter and return type documentation, replacing traditional docstring Args/Returns sections. This encourages concise, type-driven documentation and provides usage examples.Related issue/s
How to test
Dev-ops