AAI-326#69
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a job scheduling system using APScheduler to sync user data between Auth0 and the local database, focusing on email_verified status synchronization.
- Add
email_verifiedfield to the user database with migration - Implement APScheduler-based job queue with SQLAlchemy jobstore for periodic Auth0 sync
- Create scheduled tasks to fetch users from Auth0 and update database records when needed
Reviewed Changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
db/models.py |
Add email_verified field and update methods for Auth0 data synchronization |
migrations/versions/1546c07b9d78_user_email_verified.py |
Database migration to add email_verified column with default false |
scheduled_tasks/scheduler.py |
Configure APScheduler with SQLAlchemy jobstore and event listeners |
scheduled_tasks/tasks.py |
Implement Auth0 user sync and individual user update tasks |
run_scheduler.py |
Main scheduler application with signal handling and job scheduling |
tests/scheduled_tasks/test_tasks.py |
Unit tests for sync and update tasks |
pyproject.toml |
Add APScheduler, loguru, and pytest-asyncio dependencies |
| Various test files | Update tests to handle new email_verified field and engine mocking |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
amandazhuyilan
approved these changes
Sep 16, 2025
amandazhuyilan
left a comment
Contributor
There was a problem hiding this comment.
Tested changes locally :) thanks!
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-326: set up a job scheduling system that can be used for regular syncing of data between Auth0 and our user database.
Note that currently, the only data we expect to differ between Auth0 and the DB is
email_verifiedstatusChanges
email_verifiedstatus to the user databaseapscheduleras a job queue - needs to be run separately from the main FastAPI appChecklist
How to Test Manually (if necessary)
Run
uv run python run_scheduler.pyto run the scheduler - example logs: