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

MPP-3799: Split API views by emails and privaterelay #4657

Merged
merged 5 commits into from
Apr 30, 2024

Conversation

jwhitlock
Copy link
Member

For MPP-3799, I'm going to add schema definitions to make drf_spectacular.W0002 warnings go away, which will expand the definitions of API serializers and view functions, and might change some of the implementation as well. Before I do that, I wanted to make the emails and privaterelay code mirror the phones code, without any deeper changes.

The changes in api/urls.py is a decent overview of the changes:

  • api.views.emails.py has the email-specific views:
    • DomainAddressViewSet
    • RelayAddressViewSet
    • first_forwarded_email view function
  • api.views.privaterelay.py has the general service views:
    • FlagViewSet
    • ProfileViewSet
    • UserViewSet
    • report_webcompat_issue
    • runtime_data
    • terms_accepted_user

I also moved the tests and serializers to separate files.

If this is too many changes, I can instead have view-specific PRs, that move the view and add the schema annotations. I'm open to other suggestions as well.

How to test:

  • pytest runs without issues

Copy link
Member

@groovecoder groovecoder left a comment

Choose a reason for hiding this comment

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

Good call. I didn't go line-by-line thru the code, but I looked at the number of lines moved between files and then investigated the diffs and it looks good.

@jwhitlock jwhitlock force-pushed the move-api-stuff-mpp-3799 branch from 16bf511 to 8dd29f5 Compare April 30, 2024 14:20
@jwhitlock jwhitlock added this pull request to the merge queue Apr 30, 2024
Merged via the queue into main with commit 06cf9b4 Apr 30, 2024
28 checks passed
@jwhitlock jwhitlock deleted the move-api-stuff-mpp-3799 branch April 30, 2024 15:13
Copy link

sentry-io bot commented May 8, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ SystemExit: 1 /api/v1/relayaddresses/ View Issue
  • ‼️ SystemExit: 1 /api/v1/relayaddresses/ View Issue
  • ‼️ OperationalError: the connection is closed /api/v1/relayaddresses/ View Issue
  • ‼️ IntegrityError: duplicate key value violates unique constraint "auth_user_username_key" /api/v1/terms-accepted-user/ View Issue
  • ‼️ IntegrityError: duplicate key value violates unique constraint "socialaccount_socialaccount_provider_uid_fc810c6e... /api/v1/terms-accepted-user/ View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants