feat(np): Adds renderer for MSTeams issue alerts - #124860
Conversation
7572f39 to
9333505
Compare
9333505 to
d975181
Compare
d975181 to
acda67c
Compare
Sentry Snapshot Testing
|
f62fa24 to
ee745d1
Compare
ee745d1 to
742a552
Compare
742a552 to
34cbd30
Compare
34cbd30 to
477eb0e
Compare
477eb0e to
5c46be1
Compare
ad19702 to
d198ff5
Compare
There was a problem hiding this comment.
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.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d198ff5. Configure here.
| if not isinstance(data, IssueNotificationData): | ||
| raise ValueError(f"IssueMSTeamsRenderer does not support {data.__class__.__name__}") | ||
|
|
||
| from sentry.integrations.msteams.card_builder.base import MSTeamsMessageBuilder |
There was a problem hiding this comment.
think this would be better at the top unless its causing an import error
There was a problem hiding this comment.
Yeah, I never want inline imports, but there's a big complex set of reasons why it works out this way, involving other renderers, the jira-app-id that comes from sentry options...at least this is building on precedent from other renderers.
d198ff5 to
91bce24
Compare
Annotates _build_expected_card as returning an AdaptiveCard and types its actions list, resolving mypy errors in the MSTeams issue renderer tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
`sentry.notifications.apps.Config.ready` imports this renderer, and importing any `sentry.integrations.msteams` submodule executes that package's `__init__`, which reaches `sentry.notifications.notification_action` and from there the Jira action validator. That module reads `system.url-prefix` at import time, which asserts because `ready()` runs during `django.setup()`, before `bind_cache_to_option_store()`. Matches the Discord and Slack renderers. Co-authored-by: Cursor <cursoragent@cursor.com>
91bce24 to
c51c820
Compare

Stacked on #124857 (
gp/add_renderer_registry). Supersedes #112890, which could not be reopened after the branch was rebased.Summary
Adds
IssueMSTeamsRenderer, so issue alerts sent through the notification platform produce the same Adaptive Card the legacyMSTeamsIssueMessageBuilderpath produces today. The renderer registers itself for(MSTEAMS, ISSUE)with the registry from the parent PR rather than adding aget_rendereroverride to the provider.Original work by @GabeVillalobos; rebased onto current master and adapted to the registry.
Actions are limited to a single "View Issue" link. The legacy card also offers resolve/archive/assign, which need the
RpcIntegrationfor action webhook routing; that is coming in #125160