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

Implement the /api/errorreports/report endpoint #12259

Closed
Tracked by #12214
akolson opened this issue Jun 10, 2024 · 3 comments
Closed
Tracked by #12214

Implement the /api/errorreports/report endpoint #12259

akolson opened this issue Jun 10, 2024 · 3 comments
Assignees
Labels
DEV: backend Python, databases, networking, filesystem... gsoc A GSoC project task

Comments

@akolson
Copy link
Member

akolson commented Jun 10, 2024

Overview

This issue creates an API endpoint /api/errorreports/report to capture and store reports from the frontend

Description and outcomes

  • Create a new API that will store all the errors from frontend to the database.
  • The API should consist of:
    • Endpoint: /api/errorreports/report
    • Method: POST
    • Request Body:
    {
        "error_message": "OperationalError",
        "traceback": "Traceback (most recent call last): File \"main.py\", line 9, in <module> do_stuff() File \"main.py\", line 5, in do_stuff raise Exception(\"test exception\") Exception: test exception"
    }
    • Return: HTTP 200
    {
        "error_id": "9030c6ff1e43400496bbf50506a84d4f"
    }
    • View: report() view that validates the data and calls insert_or_update_error() and returns HTTP 200. error_from is defaulted to frontend for this view.
  • Create a serializer ErrorReportsSerializer that validates data in the report() view
  • Route the new API endpoint correctly

Acceptance Criteria

  • New API that captures and stores errors from frontend
  • API routed from core/api_urls.py to core/errorreports/api_urls.py to final core/errorreports/api.py:report()
  • Test case are written to ensure:
    • Errors are saved into ErrorReports when not in developer mode
    • Errors are not saved into ErrorReports when in developer mode
    • API validates data properly.

Assumptions and Dependencies

NA

Scope

  • Creating a new API endpoint
  • Routing new API endpoint
  • Test cases for new API

Out-of-Scope

  • Calling the endpoint from frontend

Accessibility Requirements

NA

Resources

@akolson akolson changed the title implement the /api/errorreports/report endpoint Implement the /api/errorreports/report endpoint Jun 10, 2024
@akolson akolson added this to the Distributed Error Reporting milestone Jun 10, 2024
@akolson akolson added DEV: backend Python, databases, networking, filesystem... gsoc A GSoC project task labels Jun 10, 2024
@akolson
Copy link
Member Author

akolson commented Jun 10, 2024

@thesujai!

@thesujai
Copy link
Contributor

All set to start this!

@akolson
Copy link
Member Author

akolson commented Jun 12, 2024

Closed by #12261

@akolson akolson closed this as completed Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DEV: backend Python, databases, networking, filesystem... gsoc A GSoC project task
Projects
None yet
Development

No branches or pull requests

2 participants