✨ feat(users): add registration filter to user account queries and tests#9024
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #9024 +/- ##
==========================================
+ Coverage 87.25% 89.26% +2.00%
==========================================
Files 2038 1631 -407
Lines 79984 67745 -12239
Branches 1371 542 -829
==========================================
- Hits 69794 60470 -9324
+ Misses 9792 7136 -2656
+ Partials 398 139 -259
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
b75927d to
c2c26ec
Compare
There was a problem hiding this comment.
Pull request overview
Adds a registered query filter to the admin user-accounts listing so admins can distinguish between pre-registered (no platform account yet) and registered users, and restructures/extends the related test suite.
Changes:
- Add
registered: bool | Noneto the list endpoint query params and propagate it through controller → service → repository to filter by presence of a linkeduser_id. - Update the merged users query to apply the registration filter before pagination/counting.
- Split the previously large registration REST test file into a folder with focused modules and shared fixtures; bump API version and OpenAPI spec accordingly.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| services/web/server/src/simcore_service_webserver/users/_controller/rest/accounts_rest.py | Passes registered query param into the account listing service call. |
| services/web/server/src/simcore_service_webserver/users/_accounts_service.py | Adds filter_registered parameter and forwards it to repository. |
| services/web/server/src/simcore_service_webserver/users/_accounts_repository.py | Applies filter_registered on the merged (pre-reg + users) view prior to distinct/pagination/count. |
| packages/models-library/src/models_library/api_schemas_webserver/users.py | Extends UsersForAdminListFilter / UsersAccountListQueryParams with registered. |
| services/web/server/src/simcore_service_webserver/api/v0/openapi.json | Bumps version and documents registered query parameter for the list endpoint. |
| services/web/server/VERSION | Bumps service version to 0.82.0. |
| services/web/server/setup.cfg | Updates bumpversion current_version to 0.82.0. |
| services/web/server/tests/unit/with_dbs/03/users/test_users_accounts_repository.py | Adds repository-level test coverage for filter_registered combined with status filters. |
| services/web/server/tests/unit/with_dbs/03/invitations/test_users_accounts_rest_registration/conftest.py | Introduces shared fixtures/mocks and DB cleanup for the split registration REST tests. |
| services/web/server/tests/unit/with_dbs/03/invitations/test_users_accounts_rest_registration/test_users_accounts_rest_registration_list.py | Adds list endpoint tests covering review_status + registered combinations and pagination totals. |
| services/web/server/tests/unit/with_dbs/03/invitations/test_users_accounts_rest_registration/test_users_accounts_rest_registration_search.py | Moves/keeps search endpoint tests in a dedicated module. |
| services/web/server/tests/unit/with_dbs/03/invitations/test_users_accounts_rest_registration/test_users_accounts_rest_registration_preview.py | Moves/keeps preview endpoint tests in a dedicated module. |
| services/web/server/tests/unit/with_dbs/03/invitations/test_users_accounts_rest_registration/test_users_accounts_rest_registration_move.py | Moves/keeps move endpoint tests in a dedicated module. |
| services/web/server/tests/unit/with_dbs/03/invitations/test_users_accounts_rest_registration/test_users_accounts_rest_registration_approve_reject.py | Moves/keeps approve/reject flow tests in a dedicated module. |
| services/web/server/tests/unit/with_dbs/03/invitations/test_users_accounts_rest_registration.py | Removes the old monolithic test module after splitting. |
| .github/skills/run-python-tests/SKILL.md | Expands skill description to include static analysis. |
| .github/instructions/python-tests.instructions.md | Clarifies test splitting guidance and adds a “unique test filenames across tree” rule. |
| .github/PULL_REQUEST_TEMPLATE.md | Improves guidance for adding OpenAPI ReDoc badge links in PRs. |
GitHK
left a comment
There was a problem hiding this comment.
Looks good. Please consider my comments on the instructions
4fe77fb to
ad45a63
Compare
…rameters and fixtures
- Implement tests for listing user accounts with various filters including review status and registration status. - Add tests for moving user accounts to different products, ensuring proper error handling for unknown products. - Create tests for previewing approval and rejection notifications for pre-registered users, including edge cases for non-existent users. - Implement search functionality tests for user accounts, ensuring access control based on user roles and verifying correct responses for registered and pre-registered users.
…unts registration tests
2398fa8 to
2636e3c
Compare
|
@mergify queue |
Merge Queue Status
Waiting for:
All conditions
|
|



What do these changes do?
Add a new
registeredquery parameter filter to theGET /v0/admin/user-accountsendpoint, enabling admins (i.e. >=PO_USERand support group) to filter user accounts by registration status:registered=true→ users with accountsregistered=false→ pre-registered users pending account creationExample query:
Returns pending users who have not yet created their accounts, useful for tracking registration pipeline.
Updates include:
UsersForAdminListFilteruserstableRelated issue/s
How to test
registeredfield in API responses indicates account status (trueorfalse)Dev-ops