-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix(np): Adds attachment to Slack render type, updates metric renderer #112312
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
Changes from all commits
fec8704
265df6e
67615a8
4c1f2bf
6748c2d
81d8965
a272d72
2b27e5e
969ec6d
0b40258
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,7 +114,12 @@ def send_notification( | |
| client = self.get_client() | ||
| try: | ||
| client.chat_postMessage( | ||
| channel=target.resource_id, blocks=payload["blocks"], text=payload["text"] | ||
| channel=target.resource_id, | ||
| blocks=payload["blocks"] if len(payload["blocks"]) > 0 else None, | ||
| text=payload["text"], | ||
| attachments=payload.get("attachments"), | ||
| unfurl_links=False, | ||
| unfurl_media=False, | ||
| ) | ||
| except SlackApiError as e: | ||
| translate_slack_api_error(e) | ||
|
|
@@ -132,8 +137,11 @@ def send_notification_with_threading( | |
| ) | ||
| kwargs: dict[str, Any] = dict( | ||
| channel=target.resource_id, | ||
| blocks=payload["blocks"], | ||
| blocks=payload["blocks"] if len(payload["blocks"]) > 0 else None, | ||
| text=payload["text"], | ||
| attachments=payload.get("attachments"), | ||
| unfurl_links=False, | ||
| unfurl_media=False, | ||
| ) | ||
|
|
||
| if threading_context.thread_ts is not None: | ||
|
|
@@ -159,8 +167,9 @@ def send_threaded_message( | |
| try: | ||
| client.chat_postMessage( | ||
| channel=channel_id, | ||
| blocks=renderable["blocks"], | ||
| blocks=renderable["blocks"] if len(renderable["blocks"]) > 0 else None, | ||
| text=renderable["text"], | ||
| attachments=renderable.get("attachments"), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent unfurl flags across Slack message methodsLow Severity This commit adds Additional Locations (1)Reviewed by Cursor Bugbot for commit 0b40258. Configure here.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Diverging code paths used by different callers with different expectations. |
||
| thread_ts=thread_ts, | ||
| ) | ||
| except SlackApiError as e: | ||
|
|
@@ -178,7 +187,8 @@ def send_threaded_ephemeral_message( | |
| try: | ||
| client.chat_postEphemeral( | ||
| channel=channel_id, | ||
| blocks=renderable["blocks"], | ||
| blocks=renderable["blocks"] if len(renderable["blocks"]) > 0 else None, | ||
| attachments=renderable.get("attachments"), | ||
| text=renderable["text"], | ||
| thread_ts=thread_ts, | ||
| user=slack_user_id, | ||
|
|
@@ -199,7 +209,10 @@ def update_message( | |
| channel=channel_id, | ||
| ts=message_ts, | ||
| text=renderable["text"], | ||
| blocks=renderable["blocks"], | ||
| blocks=renderable["blocks"] if len(renderable["blocks"]) > 0 else None, | ||
| attachments=renderable.get("attachments"), | ||
| unfurl_links=False, | ||
| unfurl_media=False, | ||
| ) | ||
| except SlackApiError as e: | ||
| translate_slack_api_error(e) | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.