Skip to content

Conversation

@jennafauconnier
Copy link
Contributor

Implement Notifications for Incident Opening and Creation Links in Slack

Description

This PR introduces two new message classes for handling notifications related to incident management in the Slack application. The first class provides a warning when a user is in the process of opening an incident, while the second class informs users when a new incident has been created.

Changes Made

✅ Created SlackMessageIncidentOpeningWarning to notify users when an incident is being opened.
✅ Created SlackMessageIncidentCreationRedirection to inform users of a new incident creation.
✅ Updated IDs for both classes to ensure they are distinct and descriptive.

Motivation and Context

These changes are important to improve user experience by preventing multiple incident creations and guiding users to newly created incidents. By providing timely notifications, we can enhance communication and efficiency within the team.

How to Test

  1. Trigger the /open command in a Slack channel to test the SlackMessageIncidentOpeningWarning.
  2. Verify that the warning message appears correctly and mentions the user who initiated the action.
  3. Create a new incident and ensure that the SlackMessageIncidentCreationRedirection message is sent to the channel.
  4. Check that the message correctly refers to the newly created incident and provides accurate channel information.

Checklist

  • I have tested my changes
  • My code follows the style guidelines of this project

@codecov-commenter
Copy link

codecov-commenter commented Oct 28, 2024

Codecov Report

Attention: Patch coverage is 42.30769% with 15 lines in your changes missing coverage. Please review.

Project coverage is 62.75%. Comparing base (60a7836) to head (ac1fe92).

Files with missing lines Patch % Lines
src/firefighter/slack/messages/slack_messages.py 57.14% 6 Missing ⚠️
src/firefighter/slack/views/modals/open.py 25.00% 6 Missing ⚠️
...hter/slack/signals/create_incident_conversation.py 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #115      +/-   ##
==========================================
- Coverage   62.83%   62.75%   -0.08%     
==========================================
  Files         215      215              
  Lines        9587     9613      +26     
  Branches     1289     1289              
==========================================
+ Hits         6024     6033       +9     
- Misses       3354     3371      +17     
  Partials      209      209              
Flag Coverage Δ
unittests 62.75% <42.30%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@GabDug GabDug changed the title Feature/detect users feat(slack): advertise when others are creating an incident Oct 29, 2024
@receiver(signal=create_incident_conversation)
def create_incident_slack_conversation(
incident: Incident,
source_channel: IncidentChannel,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In trigger_incident_workflow, it's Any, so we need to check that it's an IncidentChannel, and probably accept None by default.

@NicolasLafitteMM
Copy link
Collaborator

/rerun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants