Repository navigation
feat(issues): Upload videos to issue comments - #131741
Open
nithinrgaddam wants to merge 4 commits into
Open
nithinrgaddam wants to merge 4 commits into
nithinrgaddam wants to merge 4 commits into
Conversation
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.
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.
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
- 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
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.

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/: multipartfileupload. Returns{id, name, size, contentType, url}.GET /api/0/organizations/{org}/issues/{issue_id}/comment-attachments/{attachment_id}/: streams the video inline.Limits
video/mp4,video/quicktime,video/webmandvideo/ogg. Anything else gets a 400.issues.comment-attachments.max-sizeoption. 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 includesmaxSize.organizations:issue-comment-attachmentsflag and return 404 when it's off.Storage and access
Filerows with typeissue.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.event:writeon the issue's project and reading needsevent:read, through the existingGroupPermission.Playback
Content-Disposition: inline,X-Content-Type-Options: nosniffandAccept-Ranges: bytes.API clients
event:writeand read needsevent:read, with tests for each.Not in this PR
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.