Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR merges dev into stage. It primarily refactors the server backend by extracting common database query logic from core/security.py, services/auth.py, and services/admin.py into dedicated service modules (services/user.py, services/access_request.py, services/token.py). It also renames many test functions to shorter names, extracts shared test helpers into utility modules, and updates the client-side dependency @hey-api/openapi-ts to ^0.94.0 with its regenerated files. Additionally, the Zod locale configuration is added to the client entrypoint.
Changes:
- Extracted reusable DB query functions into three new service modules (
services/user.py,services/access_request.py,services/token.py) and added corresponding tests for these services - Replaced inline SQL queries in
core/security.py,services/auth.py, andservices/admin.pywith calls to the new service modules; addedhash_secret/verify_secretwrappers incore/security.py - Renamed test functions across the codebase to shorter scenario-based names, extracted shared test helpers into
utilities.pyfiles, and updated the client (@hey-api/openapi-tsto^0.94.0, added Zod locale configuration)
Reviewed changes
Copilot reviewed 82 out of 87 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
server/app/services/user.py |
New service module with user DB query functions |
server/app/services/access_request.py |
New service module with access request DB query functions |
server/app/services/token.py |
New service module with token DB query and expiry functions |
server/app/core/security.py |
Delegates DB queries to new service modules; adds hash_secret/verify_secret wrappers |
server/app/services/auth.py |
Replaces inline SQL with new service function calls |
server/app/services/admin.py |
Delegates to new service modules; incorrectly imports create_registration_token from auth |
server/app/tests/core/security/test_verify_secret.py |
New tests for verify_secret; contains a bug in the exception path test |
server/app/tests/core/security/utilities.py |
Extracted create_access_request helper |
server/app/tests/core/utilities.py |
Extracted get_admin helper |
server/app/tests/services/utilities.py |
Extracted get_admin_user_public helper |
server/app/tests/api/utilities.py |
Added get_admin helper, moved login_admin |
server/app/tests/services/admin/test_update_access_request_status.py |
Removed old tests, added new ones; test_update_access_request_not_pending has inconsistent naming |
Various test_*.py files |
Renamed test functions to shorter names throughout |
client/src/main.tsx |
Added Zod locale configuration |
client/package.json |
Updated @hey-api/openapi-ts to ^0.94.0, @types/node to ^25.3.5 |
client/src/api/generated/ |
Auto-generated client files updated for new package version |
server/app/models/database/access_request.py |
Consolidated duplicate SQLAlchemy imports |
Files not reviewed (1)
- client/package-lock.json: Language not supported
server/app/tests/services/admin/test_update_access_request_status.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.