Skip to content

fix(snapshots): Use org/project-scoped object keys for snapshot uploads#3186

Merged
lcian merged 1 commit intomasterfrom
lcian/fix/snapshots-object-key
Mar 4, 2026
Merged

fix(snapshots): Use org/project-scoped object keys for snapshot uploads#3186
lcian merged 1 commit intomasterfrom
lcian/fix/snapshots-object-key

Conversation

@lcian
Copy link
Member

@lcian lcian commented Mar 4, 2026

Changes the objectstore key format from {hash} to {org_id}/{project_id}/{hash} for snapshot image uploads.

This is needed because the the ProjectPreprodArtifactImageEndpoint https://github.com/getsentry/sentry/blob/948dfedb37bd20bda491a233568f5e711899368a/src/sentry/preprod/api/endpoints/project_preprod_artifact_image.py expects this format, including org and project id in the key, not just the hash.
That endpoint is also used by app icons which were using roughly the same format, so we cannot easily change it.

The org and project IDs are extracted from the objectstore scopes that are already provided in the upload options, with explicit validation that both are present.
This creates an implicit contract on the snapshots upload options endpoint, requiring it to always return organization and project IDs as scopes in the ObjectstoreUploadOptions struct.
This is not ideal, but in practice this should always be the case and there's no logical reason for that to change over time. It would be a breaking change for anything else that needs to read or write the snapshots.

@lcian lcian requested review from a team as code owners March 4, 2026 17:46
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Fixes

- Use org/project-scoped object keys for snapshot uploads ([#3186](https://github.com/getsentry/sentry-cli/pull/3186))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against effb34b

Copy link

@cursor cursor bot left a comment

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.

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

@lcian lcian changed the base branch from master to lcian/bump-objectstore-client March 4, 2026 17:50
@lcian lcian requested a review from szokeasaurusrex as a code owner March 4, 2026 18:04
@lcian lcian force-pushed the lcian/fix/snapshots-object-key branch from 528e76d to 805e229 Compare March 4, 2026 18:05
Base automatically changed from lcian/bump-objectstore-client to master March 4, 2026 18:44
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lcian lcian force-pushed the lcian/fix/snapshots-object-key branch from 805e229 to effb34b Compare March 4, 2026 18:45
@lcian
Copy link
Member Author

lcian commented Mar 4, 2026

Same as #3185 (comment), merging this to unblock and I can explain tomorrow @szokeasaurusrex

@lcian lcian merged commit 52848dd into master Mar 4, 2026
24 of 25 checks passed
@lcian lcian deleted the lcian/fix/snapshots-object-key branch March 4, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants