Skip to content

ref(difs): Preserve storage when cloning ProGuard - #121064

Open
lcian wants to merge 12 commits into
ref/objectstore-debugfiles-dif-storagefrom
lcian/ref/proguard-clone-create-dif-from-id
Open

ref(difs): Preserve storage when cloning ProGuard#121064
lcian wants to merge 12 commits into
ref/objectstore-debugfiles-dif-storagefrom
lcian/ref/proguard-clone-create-dif-from-id

Conversation

@lcian

@lcian lcian commented Aug 3, 2026

Copy link
Copy Markdown
Member

Stacked on: #120183

ProGuard reuploads now preserve the source DIF's storage model instead of routing every clone through create_dif_from_id.
File-backed sources reuse their existing File, while Objectstore-backed sources create a separate Objectstore copy when needed (so, dual-written rows remain dual-written), independent of the migration -read/-write or -exclusive-write flags.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 3, 2026
@lcian
lcian changed the base branch from master to ref/objectstore-debugfiles-dif-storage August 3, 2026 14:22
@lcian lcian changed the title ref(difs): Don't call create_dif_from_id when cloning ProGuard ref(difs): Preserve storage when cloning ProGuard Aug 3, 2026
@lcian
lcian marked this pull request as ready for review August 4, 2026 13:47
@lcian
lcian requested review from a team as code owners August 4, 2026 13:47
@lcian
lcian requested a review from jan-auer August 4, 2026 13:47

@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 2 potential issues.

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 8c7e115. Configure here.

Comment thread src/sentry/api/endpoints/debug_files.py Outdated
Comment thread src/sentry/api/endpoints/debug_files.py Outdated
Comment thread src/sentry/api/endpoints/debug_files.py Outdated
Comment thread src/sentry/api/endpoints/debug_files.py
with tempfile.TemporaryFile() as temporary_file:
shutil.copyfileobj(source_fileobj, temporary_file)
temporary_file.seek(0)
storage_path = upload_dif_to_objectstore(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

upload_dif_to_objectstore requires the stream to be seekable when using multipart uploads.
I've tried to enforce this through the typing system, but apparently that's not feasible, runtime checks are needed.
This requirement will anyways go away when we remove the usage of multipart uploads, so I'm leaving this as is for now.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant