Skip to content

feat(issues): Upload videos to issue comments - #131741

Open
nithinrgaddam wants to merge 4 commits into
getsentry:masterfrom
nithinrgaddam:issue-comment-video-attachments-backend
Open

nithinrgaddam wants to merge 4 commits into
getsentry:masterfrom
nithinrgaddam:issue-comment-video-attachments-backend

Conversation

@nithinrgaddam

@nithinrgaddam nithinrgaddam commented Nov 19, 2026 •

Copy link
Copy Markdown

Issue comments are plain markdown, so there is no way to share a screen recording of a bug next to the discussion. Teams end up uploading the video somewhere else and pasting a link. This PR adds the backend for attaching videos to issue comments. The UI comes in a follow-up PR.

Endpoints (org-scoped only)

  • POST /api/0/organizations/{org}/issues/{issue_id}/comment-attachments/: multipart file upload. Returns {id, name, size, contentType, url}.
  • GET /api/0/organizations/{org}/issues/{issue_id}/comment-attachments/{attachment_id}/: streams the video inline.

Limits

  • Only browser-playable video types are accepted: video/mp4, video/quicktime, video/webm and video/ogg. Anything else gets a 400.
  • The size cap is the new issues.comment-attachments.max-size option. It defaults to 95 MB, which leaves room for the multipart framing under self-hosted nginx's 100 MB body limit. Larger files get a 413 that includes maxSize.
  • Both endpoints are gated behind the new organizations:issue-comment-attachments flag and return 404 when it's off.

Storage and access

  • Uploads are stored as File rows with type issue.comment.attachment. The issue id is kept in the file headers and checked on every read, so a file can only be fetched through the issue it was uploaded to. This avoids a new model and migration.
  • Uploading needs event:write on the issue's project and reading needs event:read, through the existing GroupPermission.

Playback

  • The download sends Content-Disposition: inline, X-Content-Type-Options: nosniff and Accept-Ranges: bytes.
  • It supports single byte ranges (206 and 416), so videos can seek and play in Safari, which needs range support for video.

API clients

Not in this PR

  • Uploads aren't tied to a comment yet, so deleting a comment leaves its file behind. Happy to add cleanup if the approach looks right.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Add org-scoped endpoints to upload a video for an issue comment and to
stream it back:

- POST /organizations/{org}/issues/{issue_id}/comment-attachments/
- GET  /organizations/{org}/issues/{issue_id}/comment-attachments/{id}/

Uploads are limited to browser-playable video types and to the new
issues.comment-attachments.max-size option (100 MB by default, the
self-hosted nginx body limit). Files are stored as File rows tagged with
the issue they belong to, and reads check that tag. The download supports
single byte ranges so videos can seek and play in Safari.

Gated behind organizations:issue-comment-attachments.
@nithinrgaddam
nithinrgaddam requested review from a team as code owners November 19, 2026 00:57
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 19, 2026
Uploading needs event:write and reading needs event:read, so API clients
such as the CLI and MCP server can use the endpoints with a token.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 89bbb59. Configure here.

Merging moves comments to the surviving issue, but the file still names
the issue it was uploaded to. Follow the merge redirects from that issue
so the video plays from the issue it now lives on.

Also add the new routes to knownSentryApiUrls.generated.ts, which CI
cannot commit to a fork.
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 19, 2026
- Default the upload cap to 95 MB: a 100 MB file plus its multipart
  framing is over self-hosted nginx's 100 MB body limit, so nginx
  rejected it before Sentry could.
- A Range bound too long for int() is unsatisfiable (416), not a 500.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant