Skip to content

feat(np): migrate legacy issue alerts to np - #127289

Merged
shayna-ch merged 13 commits into
masterfrom
shayna-ch/np-legacy-issue-alerts
Oct 26, 2026
Merged

shayna-ch merged 13 commits into
masterfrom
shayna-ch/np-legacy-issue-alerts

Conversation

@shayna-ch

@shayna-ch shayna-ch commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

migrates legacy issue alerts to np for teams, slack, and discord.

  • Shared send logic: metric and issue alerts now share the code that builds the send target, decides whether to thread, and sends with failure logging.
  • Threading: follow-up alerts for the same issue reply in the original Slack thread and are also posted to the channel, matching legacy. Uptime and metric issues get a new thread for each open period.
  • Activity updates: resolve, assign, archive and similar updates are now also posted in Slack threads created by the platform. For uptime issues they go only to the current open period's thread.
  • Seer autofix: Slack threads from platform alerts are registered for Seer autofix updates, always using the thread's root message.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 13, 2026
@shayna-ch
shayna-ch changed the base branch from master to shayna-ch/connect-legacy-new-renderer October 13, 2026 18:33
@shayna-ch
shayna-ch added this pull request to stack #127290 October 13, 2026 18:33
@shayna-ch shayna-ch changed the title connect legacy alert ot new renderer issue alerts Oct 13, 2026
@shayna-ch
shayna-ch force-pushed the shayna-ch/np-legacy-issue-alerts branch from 8adb8dc to 2fa4031 Compare October 13, 2026 18:36
Base automatically changed from shayna-ch/connect-legacy-new-renderer to master October 15, 2026 16:53
@shayna-ch
shayna-ch force-pushed the shayna-ch/np-legacy-issue-alerts branch 2 times, most recently from da00165 to ef77a1e Compare October 19, 2026 16:09
Comment thread src/sentry/integrations/slack/service.py Outdated
Comment thread src/sentry/notifications/notification_action/platform_dispatch.py Outdated
@shayna-ch

Copy link
Copy Markdown
Member Author

bugbot run

@shayna-ch shayna-ch changed the title issue alerts feat(np): migrate legacy issue alerts to np Oct 19, 2026

@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.

Stale Bugbot comment from a previous run.

Comment thread src/sentry/notifications/notification_action/platform_dispatch.py
@shayna-ch

Copy link
Copy Markdown
Member Author

bugbot run

@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.

Stale Bugbot comment from a previous run.

Comment thread src/sentry/integrations/slack/service.py
Comment thread src/sentry/integrations/slack/service.py
@shayna-ch

Copy link
Copy Markdown
Member Author

bugbot run

@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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2aff789. Configure here.

Comment thread src/sentry/notifications/notification_action/platform_dispatch.py
@shayna-ch
shayna-ch marked this pull request as ready for review October 19, 2026 20:07
@shayna-ch
shayna-ch requested review from a team as code owners October 19, 2026 20:07
@shayna-ch
shayna-ch requested a review from hobzcalvin October 19, 2026 20:07

@hobzcalvin hobzcalvin 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.

I'm not too familiar with the existing threading behavior, so some of these questions may not make sense. 😆

Comment thread src/sentry/integrations/slack/service.py Outdated
Comment thread src/sentry/integrations/slack/service.py Outdated
Comment thread src/sentry/integrations/slack/service.py
Comment thread src/sentry/integrations/slack/service.py Outdated
Comment thread src/sentry/notifications/notification_action/platform_dispatch.py Outdated
Comment thread src/sentry/notifications/notification_action/platform_dispatch.py
Comment thread src/sentry/notifications/notification_action/platform_dispatch.py
Comment thread src/sentry/notifications/platform/slack/provider.py Outdated
@shayna-ch
shayna-ch requested a review from hobzcalvin October 21, 2026 21:18
Comment on lines +162 to +165
ThreadOptionKey = Literal[
"sentry:issue_alerts_thread_flag",
"sentry:metric_alerts_thread_flag",
]

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.

I was thinking this could live somewhere tied to OrganizationOption? Like I actually don't need a type just for this one specific file/use-case (kinda consider it overkill), but I was more surprised the OrganizationOption stuff didn't have anything to enforce the sorts of strings that go in there.

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.

agreed, switched it back to how it was originally. Tying it to OrganizationOption seems like it would be a bigger change, so I made a follow up ticket ISWF-3631, i dont think its quite urgent enough to postpone the rollout more

@hobzcalvin hobzcalvin 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.

thanks for all the back and forth; looking good! I think there are few lingering comments to resolve, otherwise good to ship.

@shayna-ch
shayna-ch marked this pull request as ready for review October 23, 2026 21:30
@sentry-junior
sentry-junior Bot force-pushed the shayna-ch/np-legacy-issue-alerts branch from cd3ac3b to f6e1b38 Compare October 26, 2026 15:19
@sentry

sentry Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 760 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

shayna-ch and others added 13 commits October 26, 2026 16:20
Co-Authored-By: Shayna Chambless <shayna.chambless@sentry.io>
Co-Authored-By: Shayna Chambless <shayna.chambless@sentry.io>
Co-Authored-By: Shayna Chambless <shayna.chambless@sentry.io>
Co-Authored-By: Shayna Chambless <shayna.chambless@sentry.io>
Co-Authored-By: Shayna Chambless <shayna.chambless@sentry.io>
Co-Authored-By: Shayna Chambless <shayna.chambless@sentry.io>
Co-Authored-By: Shayna Chambless <shayna.chambless@sentry.io>
Co-Authored-By: Shayna Chambless <shayna.chambless@sentry.io>
Co-Authored-By: Shayna Chambless <shayna.chambless@sentry.io>
…_with_response

The method is also used for non-threaded sends because it's the one that
returns the provider response (e.g. Slack's message ts). Name it for that.

Co-Authored-By: Shayna Chambless <shayna.chambless@sentry.io>
Thread creators set ThreadKey.object_id (the group ID for issue and metric
alert threads) and it's saved on new threads. The issue activity path now
finds every platform thread for an issue by (key_type, object_id) instead
of searching key_data.

Co-Authored-By: Shayna Chambless <shayna.chambless@sentry.io>
…ype and object_id

Platform threads now record the kind of object they're about alongside
object_id, and activity replies find issue threads by (object_type, object_id),
which the new index covers.

Co-Authored-By: Shayna Chambless <shayna.chambless@sentry.io>
Drop the file-specific ThreadOptionKey Literal; OrganizationOption keys are plain strings everywhere else. Shared key typing is tracked separately.

Co-Authored-By: Shayna Chambless <shayna.chambless@sentry.io>
@sentry-junior
sentry-junior Bot force-pushed the shayna-ch/np-legacy-issue-alerts branch from f6e1b38 to 986dc7a Compare October 26, 2026 16:21
@shayna-ch
shayna-ch merged commit 732ca5b into master Oct 26, 2026
81 checks passed
@shayna-ch
shayna-ch deleted the shayna-ch/np-legacy-issue-alerts branch October 26, 2026 16:34
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.

3 participants