-
Notifications
You must be signed in to change notification settings - Fork 291
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
Update Slack "invite" feature to use direct paging #2562
Conversation
@@ -498,6 +498,23 @@ def declare_incident_link(self) -> str: | |||
def happened_while_maintenance(self): | |||
return self.root_alert_group is not None and self.root_alert_group.maintenance_uuid is not None | |||
|
|||
def get_paged_users(self) -> QuerySet[User]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moving from here to make it reusable
@@ -28,7 +28,7 @@ | |||
|
|||
def _trigger_alert( | |||
organization: Organization, | |||
team: Team, | |||
team: Team | None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
team is None
for No Team
(aka default team)
@@ -212,6 +212,11 @@ def process_scenario(self, slack_user_identity, slack_team_identity, payload): | |||
|
|||
|
|||
class InviteOtherPersonToIncident(AlertGroupActionsMixin, scenario_step.ScenarioStep): | |||
""" | |||
THIS SCENARIO STEP IS DEPRECATED AND WILL BE REMOVED IN THE FUTURE. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are now deprecated, since new messages are rendered without the "Invite..." dropdown.
Leaving the old scenario steps for now so the old messages can be processed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Contents of this file are very similar to apps/slack/scenarios/paging.py
, and some parts are reused (e.g. generating availability warnings)
@@ -753,7 +753,25 @@ def _get_selected_entries_list(input_id_prefix, key, entries): | |||
|
|||
def _display_availability_warnings(payload, warnings, organization, user): | |||
metadata = json.loads(payload["view"]["private_metadata"]) | |||
return _get_availability_warnings_view( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is moved from here, so there's a new function _get_availability_warnings_view
that can be reused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
A thought for a future Slack related PR. Would be nice to have a typed Slack payload
object. That object is very large, it's always tricky to remember what it contains.
What this PR does
Refactors the "invite" functionality in Slack to use direct paging and be more consistent with the web UI and
/escalate
Slack command.Screenshots
Alert group buttons
Before:
After (replace "Invite..." dropdown with "Responders" button, swap it with the silence button):
What happens when clicking on "Responders"
The following modal opens up with a list of currently paged users and inputs to page more users/schedules:
This is supposed to be the Slack equivalent of this part of the web UI:
Which issue(s) this PR fixes
#2336
Checklist
pr:no public docs
PR label added if not required)CHANGELOG.md
updated (orpr:no changelog
PR label added if not required)