AAI-302 update registration code to create database records#49
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements database record creation during user registration for BPA Data Portal and Galaxy platforms, fulfilling requirement AAI-302. The changes extend the existing Auth0-only registration to also create user records in the backend database.
- Add user record creation in registration endpoints for BPA DP and Galaxy
- Enhance test infrastructure to ensure consistent test database usage
- Update tests to verify database record creation alongside Auth0 registration
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| routers/galaxy_register.py | Adds database user creation with Galaxy platform membership |
| routers/bpa_register.py | Adds database user creation with BPA platform membership |
| db/models.py | Adds helper methods for creating users from Auth0 data and platform memberships |
| auth0/client.py | Adds create_user method to Auth0Client |
| db/setup.py | Refactors database engine initialization to be lazy-loaded |
| tests/*.py | Updates tests to use new mocked Auth0 client and verify database operations |
| tests/conftest.py | Improves test infrastructure with better database isolation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
amandazhuyilan
left a comment
Contributor
There was a problem hiding this comment.
One additional unit test requested.
amandazhuyilan
approved these changes
Aug 14, 2025
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.
Description
AAI-302: registration endpoints should now create user records in the backend database alongside registering the user in Auth0.
Changes
Checklist
How to Test Manually (if necessary)
Run
uv run pytest