Skip to content
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

Issue 178 healy: Upsert user email to database #336

Merged
merged 20 commits into from
Nov 18, 2024
Merged

Conversation

BigOleHealz
Copy link
Collaborator

@BigOleHealz BigOleHealz commented Oct 22, 2024

What does this PR do?

Makes API request to github API based on username to get email. If email is received, it upserts to users table on installation and updates on create_user_request

PR checklist

Test Cases

Here is the list of test cases:

  • under line 87 in gitauto_handler.py, set the email equal to something else. Then run create create_user_request. Your email address should be updated in the Users table of supabase
  • under line 42 in webhook_handler.py, set the email equal to something else. Then run create create_installation. Your email address should be updated in the Users table of supabase

Evidence

Here is the list of Loom video URL(s):

Environment Variables Setting

Here is the list of configurations and screenshots where we have changes other than code:

  • GitHub Actions
  • OpenAI Console
  • Stripe Admin Console
  • Stripe Webhook
  • Supabase Admin Console
  • Supabase Database
  • AWS Lambda Console
  • Vercel Hosting Console
  • Sentry Console

Summary by Sourcery

Fetch user email from GitHub API and update the users table in the database during installation and user request creation. Add tests to ensure correct email handling.

New Features:

  • Implement fetching of user email from GitHub API based on username.

Enhancements:

  • Update user email in the database during installation and user request creation if it differs from the stored email.

Tests:

  • Add tests to verify email handling during user request creation and installation processes.

sourcery-ai[bot]

This comment was marked as resolved.

@gitauto-ai gitauto-ai bot added the gitauto label Oct 23, 2024
@hiroshinishio hiroshinishio changed the title Issue 178 healy Issue 178 healy: Upsert user email to database Oct 24, 2024
@gitautoai gitautoai deleted a comment from sourcery-ai bot Oct 24, 2024
services/github/github_manager.py Outdated Show resolved Hide resolved
services/github/github_manager.py Outdated Show resolved Hide resolved
services/github/github_manager.py Outdated Show resolved Hide resolved
services/github/github_manager.py Outdated Show resolved Hide resolved
services/github/github_manager.py Outdated Show resolved Hide resolved
services/supabase/users_manager.py Outdated Show resolved Hide resolved
tests/services/supabase/test_gitauto_manager.py Outdated Show resolved Hide resolved
tests/services/supabase/test_gitauto_manager.py Outdated Show resolved Hide resolved
tests/services/supabase/test_users_manager.py Outdated Show resolved Hide resolved
tests/services/supabase/test_users_manager.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@hiroshinishio hiroshinishio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also update the branch too!

@hiroshinishio hiroshinishio merged commit dd5868c into main Nov 18, 2024
2 checks passed
@hiroshinishio hiroshinishio deleted the issue_178_healy branch November 18, 2024 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants