From cc356c9d5467e71e38f3257efe3cd989c7e2df56 Mon Sep 17 00:00:00 2001 From: Matias Bordese Date: Tue, 21 Jan 2025 14:05:39 -0300 Subject: [PATCH] chore: capitalize Slack name references (#5421) Related to https://github.com/grafana/irm/issues/425 --- .../apps/alerts/incident_log_builder/incident_log_builder.py | 4 ++-- engine/apps/alerts/tasks/notify_user.py | 2 +- engine/apps/api/views/schedule.py | 2 +- engine/apps/slack/scenarios/resolution_note.py | 2 +- engine/apps/slack/scenarios/schedules.py | 4 ++-- engine/apps/slack/views.py | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/engine/apps/alerts/incident_log_builder/incident_log_builder.py b/engine/apps/alerts/incident_log_builder/incident_log_builder.py index 70410d96..a4f550ef 100644 --- a/engine/apps/alerts/incident_log_builder/incident_log_builder.py +++ b/engine/apps/alerts/incident_log_builder/incident_log_builder.py @@ -536,7 +536,7 @@ class IncidentLogBuilder: ) else: plan_line = ( - f'escalation step "{escalation_policy_snapshot.step_display}" is slack specific. ' f"Skipping" + f'escalation step "{escalation_policy_snapshot.step_display}" is Slack specific. ' f"Skipping" ) escalation_plan.setdefault(timedelta, []).append({"plan_lines": [plan_line]}) @@ -597,7 +597,7 @@ class IncidentLogBuilder: ) else: plan_line = ( - f'escalation step "{escalation_policy_snapshot.step_display}" is slack specific. Skipping' + f'escalation step "{escalation_policy_snapshot.step_display}" is Slack specific. Skipping' ) escalation_plan.setdefault(timedelta, []).append({"plan_lines": [plan_line]}) diff --git a/engine/apps/alerts/tasks/notify_user.py b/engine/apps/alerts/tasks/notify_user.py index 9e7e9e54..65ae1f44 100644 --- a/engine/apps/alerts/tasks/notify_user.py +++ b/engine/apps/alerts/tasks/notify_user.py @@ -252,7 +252,7 @@ def notify_user_task( type=UserNotificationPolicyLogRecord.TYPE_PERSONAL_NOTIFICATION_FAILED, notification_policy=notification_policy, alert_group=alert_group, - reason="Alert group slack notifications are disabled", + reason="Alert group Slack notifications are disabled", slack_prevent_posting=prevent_posting_to_thread, notification_step=notification_policy.step, notification_channel=notification_policy.notify_by, diff --git a/engine/apps/api/views/schedule.py b/engine/apps/api/views/schedule.py index 2d816211..51ead8e1 100644 --- a/engine/apps/api/views/schedule.py +++ b/engine/apps/api/views/schedule.py @@ -567,7 +567,7 @@ class ScheduleView( }, { "value": True, - "display_name": "Mention person in slack", + "display_name": "Mention person in Slack", }, ] return Response(options) diff --git a/engine/apps/slack/scenarios/resolution_note.py b/engine/apps/slack/scenarios/resolution_note.py index f1a557be..67ad4137 100644 --- a/engine/apps/slack/scenarios/resolution_note.py +++ b/engine/apps/slack/scenarios/resolution_note.py @@ -558,7 +558,7 @@ class ResolutionNoteModalStep(AlertGroupActionsMixin, scenario_step.ScenarioStep user_verbal = resolution_note.author_verbal(mention=True) message_timestamp = datetime.datetime.timestamp(resolution_note.created_at) blocks.append(DIVIDER) - source = "web" if resolution_note.source == ResolutionNote.Source.WEB else "slack" + source = "web" if resolution_note.source == ResolutionNote.Source.WEB else "Slack" blocks.append( typing.cast( diff --git a/engine/apps/slack/scenarios/schedules.py b/engine/apps/slack/scenarios/schedules.py index 61c6da61..b630bc10 100644 --- a/engine/apps/slack/scenarios/schedules.py +++ b/engine/apps/slack/scenarios/schedules.py @@ -26,8 +26,8 @@ if typing.TYPE_CHECKING: class EditScheduleShiftNotifyStep(scenario_step.ScenarioStep): notify_empty_oncall_options = {choice[0]: choice[1] for choice in OnCallSchedule.NotifyEmptyOnCall.choices} notify_oncall_shift_freq_options = {choice[0]: choice[1] for choice in OnCallSchedule.NotifyOnCallShiftFreq.choices} - mention_oncall_start_options = {1: "Mention person in slack", 0: "Inform in channel without mention"} - mention_oncall_next_options = {1: "Mention person in slack", 0: "Inform in channel without mention"} + mention_oncall_start_options = {1: "Mention person in Slack", 0: "Inform in channel without mention"} + mention_oncall_next_options = {1: "Mention person in Slack", 0: "Inform in channel without mention"} def process_scenario( self, diff --git a/engine/apps/slack/views.py b/engine/apps/slack/views.py index 859567cb..64fba9bb 100644 --- a/engine/apps/slack/views.py +++ b/engine/apps/slack/views.py @@ -586,7 +586,7 @@ class ResetSlackView(APIView): # just a placeholder value to continute uninstallation until UNIFIED_SLACK_APP_ENABLED is not enabled removed = True if not removed: - return Response({"error": "Failed to uninstall slack integration"}, status=500) + return Response({"error": "Failed to uninstall Slack integration"}, status=500) try: uninstall_slack_integration(request.user.organization, request.user)