Implement public report endpoint with models and rate limiting#6
Open
Implement public report endpoint with models and rate limiting#6
Conversation
- Add 5MB size limit to base64 attachments to prevent OOM OOM errors - Wrap report and attachments creation in database transaction (`transaction.atomic`) - Register Application, Issue, and IssueAttachment models in Django Admin - Add comprehensive E2E tests for PublicReportCreateView
There was a problem hiding this comment.
Pull request overview
Adds a new reports Django app that exposes a public, rate-limited endpoint for submitting bug reports (issues) with optional attachments, and persists them in the database for later moderation/integration work.
Changes:
- Introduces
Application,Issue, andIssueAttachmentmodels (+ initial migration) and registers them in Django admin. - Implements
POST /report/<uuid:app_id>public API endpoint with DRF serializer validation, atomic DB writes, and anonymous throttling. - Adds APITestCase coverage for happy-path creation, validation errors, and throttling behavior; wires app + URLs + DRF settings into the project.
Reviewed changes
Copilot reviewed 10 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
reports/views.py |
Adds the public report creation API view and custom throttle classes. |
reports/urls.py |
Routes the public report creation endpoint. |
reports/serializers.py |
Adds request validation for reports and attachment inputs (size/type/base64). |
reports/models.py |
Defines the core persistence models for applications, issues, and attachments. |
reports/migrations/0001_initial.py |
Creates initial database schema for the new reports app. |
reports/admin.py |
Adds admin views for managing applications/issues/attachments. |
reports/apps.py |
Declares the Django app config. |
reports/tests/test_report_create.py |
Adds API tests for create, validation, and throttling. |
backend_solvro_feedback/urls.py |
Includes the reports URLConf at the project root. |
backend_solvro_feedback/settings.py |
Adds rest_framework, reports, and DRF throttle rate settings. |
.gitignore |
Adds Zed editor folder to ignored files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 15 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Adds a new
reportsDjango app that exposes a public, rate-limited endpoint for submitting bug reports (issues) with optional attachments, and persists them in the database for later moderation/integration work.Changes:
Application,Issue, andIssueAttachmentmodels (+ initial migration) and registers them in Django admin.POST /report/<uuid:app_id>public API endpoint with DRF serializer validation, atomic DB writes, and anonymous throttling.