-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
feat(subscriptions): Send the organization id for all subscriptions #122733
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
Closed
+11
−0
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: A deployment order dependency could cause subscription creation to fail if Snuba rejects the new
organization_idfield before it's updated to support it.Severity: MEDIUM
Suggested Fix
To mitigate the deployment order risk, consider adding a feature flag or another form of forward compatibility check. This would allow the new
organization_idfield to be sent only when the corresponding Snuba version is known to be deployed, preventing subscription creation failures if Sentry is deployed first.Prompt for AI Agent
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified against current Snuba
master(dffa2b529) — this is a false positive, and Sentry-first deploy is safe.SnQLSubscriptionData.from_dicthas no allowlist rejection path. Unrecognized keys are swept intometadatarather than refused:The
/subscriptionsendpoint does no JSON-schema validation of the body either — it just callsSubscriptionDataCodec.decode. I ran the payload this PR sends against unmodified Snuba master:So no 4xx, no
SnubaError, no subscriptions stuck in CREATING. Old Snuba silently ignores the field, which makes this inert-until-supported rather than breaking.Deploy order still matters for correctness (not safety): until getsentry/snuba#8400 lands, Snuba ignores
organization_idfor the events entity, so attribution keeps using the placeholder. That PR also adds anAddColumnConditionfallback so the metrics entities accept either key. It should merge first, but a Sentry-first deploy degrades gracefully rather than failing.