From 86f078147bfb59db1032942b3a4b8e44dafbfa7c Mon Sep 17 00:00:00 2001 From: Raj Joshi Date: Tue, 29 Jul 2025 20:57:41 -0700 Subject: [PATCH 1/2] :wrench: chore: max slack plugin title length --- src/sentry_plugins/slack/plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sentry_plugins/slack/plugin.py b/src/sentry_plugins/slack/plugin.py index f329d6e6e976a9..0f82fd37425fee 100644 --- a/src/sentry_plugins/slack/plugin.py +++ b/src/sentry_plugins/slack/plugin.py @@ -24,6 +24,8 @@ status.HTTP_429_TOO_MANY_REQUESTS, ] +SLACK_PLUGIN_TITLE_LENGTH_LIMIT = 256 + class SlackPlugin(CorePluginMixin, notify.NotificationPlugin): title = "Slack" @@ -233,7 +235,7 @@ def notify(self, notification: Notification, raise_exception: bool = False) -> N "attachments": [ { "fallback": b"[%s] %s" % (project_name, title), - "title": title, + "title": title[:SLACK_PLUGIN_TITLE_LENGTH_LIMIT], "title_link": group.get_absolute_url(params={"referrer": "slack"}), "color": self.color_for_event(event), "fields": fields, From 78d2fcdb438d8d0b28e8d94e8d0252514fa82bf0 Mon Sep 17 00:00:00 2001 From: Raj Joshi Date: Tue, 29 Jul 2025 21:01:43 -0700 Subject: [PATCH 2/2] :wrench: chore: good job cursor --- src/sentry_plugins/slack/plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sentry_plugins/slack/plugin.py b/src/sentry_plugins/slack/plugin.py index 0f82fd37425fee..8c08c79e8fcd78 100644 --- a/src/sentry_plugins/slack/plugin.py +++ b/src/sentry_plugins/slack/plugin.py @@ -168,7 +168,7 @@ def notify(self, notification: Notification, raise_exception: bool = False) -> N if not self.is_configured(project): return - title = event.title.encode("utf-8") + title = event.title[:SLACK_PLUGIN_TITLE_LENGTH_LIMIT].encode("utf-8") # TODO(dcramer): we'd like this to be the event culprit, but Sentry # does not currently retain it if group.culprit: @@ -235,7 +235,7 @@ def notify(self, notification: Notification, raise_exception: bool = False) -> N "attachments": [ { "fallback": b"[%s] %s" % (project_name, title), - "title": title[:SLACK_PLUGIN_TITLE_LENGTH_LIMIT], + "title": title, "title_link": group.get_absolute_url(params={"referrer": "slack"}), "color": self.color_for_event(event), "fields": fields,