Repository navigation
feat(notifications): Store the integration on NotificationThread - #128764
Open
alexsohn1126 wants to merge 1 commit into
Open
alexsohn1126 wants to merge 1 commit into
alexsohn1126 wants to merge 1 commit into
Conversation
alexsohn1126
force-pushed
the
alexsohn/notification-thread-object-writes
branch
from
October 26, 2026 18:30
035fc4b to
cc3dc0b
Compare
alexsohn1126
force-pushed
the
alexsohn/notification-thread-object-writes
branch
2 times, most recently
from
October 26, 2026 19:13
3b4483e to
77813d4
Compare
alexsohn1126
marked this pull request as ready for review
October 26, 2026 19:21
hobzcalvin
reviewed
Oct 27, 2026
| ) | ||
| object_id = BoundedBigIntegerField(null=True) | ||
|
|
||
| integration_id = BoundedBigIntegerField(null=True) |
Contributor
There was a problem hiding this comment.
I think there's precedent elsewhere to use a HybridCloudForeignKey which will handle the delete case for you:
integration_id = HybridCloudForeignKey("sentry.Integration", null=True, on_delete="SET_NULL")
Add a nullable integration_id column to NotificationThread, set from the target when the platform creates a thread. Add a ThreadingService helper to list the threads for an object.
alexsohn1126
force-pushed
the
alexsohn/notification-thread-object-writes
branch
from
October 29, 2026 18:02
77813d4 to
54bad49
Compare
Contributor
|
This PR has a migration; here is the generated SQL for for --
-- Add field integration_id to notificationthread
--
ALTER TABLE "notifications_notificationthread" ADD COLUMN "integration_id" bigint NULL;
CREATE INDEX CONCURRENTLY "notifications_notificationthread_integration_id_a4a80f02" ON "notifications_notificationthread" ("integration_id"); |
hobzcalvin
approved these changes
Oct 29, 2026
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.
Threads the notification platform saves now remember which integration sent them, in a new nullable
integration_idcolumn. Nothing reads it yet, so nothing changes for people in Slack.A thread row only has the channel, so anything that wants to post back into a thread later couldn't tell which Slack workspace to use. The platform now takes the integration from the target when it creates a thread. Existing threads keep it empty. There's also a small helper to list the threads for an object, using the object columns #127289 started filling in.
The column is added during deploy, before the new code runs. #128771 uses both to send Seer investigation conclusions to every metric alert thread. Orgs with metric alert threading turned off don't save threads, so they only get the conclusion in the thread where someone clicked.
refs CW-2217