From 395977d934834c16e3faee5b30c30619c1116796 Mon Sep 17 00:00:00 2001 From: Joey Orlando Date: Tue, 5 Sep 2023 12:25:11 +0200 Subject: [PATCH] fix issue with slack_sdk call update (#2966) # What this PR does ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [x] Documentation added (or `pr:no public docs` PR label added if not required) - [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required) --- CHANGELOG.md | 9 ++++++++- engine/apps/slack/scenarios/distribute_alerts.py | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e728a6772..f656d6fc0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## v1.3.33 (2023-09-05) + +### Fixed + +- Fix issue in `apps.slack.tasks.post_or_update_log_report_message_task` task related to passing tuple to `text` arg + for `SlackClient.chat_postMessage` method by @joeyorlando ([#2966](https://github.com/grafana/oncall/pull/2966)) + ## v1.3.32 (2023-09-05) ### Added -- Add internal API endpoint for getting schedules shifts for current user by @Ferril([#2928](https://github.com/grafana/oncall/pull/2928)) +- Add internal API endpoint for getting schedules shifts for current user by @Ferril ([#2928](https://github.com/grafana/oncall/pull/2928)) ### Changed diff --git a/engine/apps/slack/scenarios/distribute_alerts.py b/engine/apps/slack/scenarios/distribute_alerts.py index fd5faf2d74..8e0301f725 100644 --- a/engine/apps/slack/scenarios/distribute_alerts.py +++ b/engine/apps/slack/scenarios/distribute_alerts.py @@ -983,15 +983,15 @@ def post_log_message(self, alert_group: AlertGroup) -> None: logger.info(f"Cannot post log message for alert_group {alert_group.pk} because SlackMessage doesn't exist") return None - text = ("Building escalation plan... :thinking_face:",) - slack_log_message = alert_group.slack_log_message if slack_log_message is None: logger.debug(f"Start posting new log message for alert_group {alert_group.pk}") try: result = self._slack_client.chat_postMessage( - channel=slack_message.channel_id, thread_ts=slack_message.slack_id, text=text + channel=slack_message.channel_id, + thread_ts=slack_message.slack_id, + text="Building escalation plan... :thinking_face:", ) except SlackAPITokenException as e: print(e)