feat(slack): Add /ft list command to show active and mitigated incidents#194
Draft
rgibert wants to merge 4 commits into
Draft
feat(slack): Add /ft list command to show active and mitigated incidents#194rgibert wants to merge 4 commits into
rgibert wants to merge 4 commits into
Conversation
Add handle_list_command that responds with active and mitigated incidents grouped by status, excluding private and terminal-state incidents. Includes 8 test cases covering empty state, grouping, ordering, privacy filtering, and link formatting. Co-Authored-By: Claude <noreply@anthropic.com> Agent transcript: https://claudescope.sentry.dev/share/rvyzwlSQ329ffIavjmsM6NVgHwtd802c79Fm0rGkXQ4
Wire handle_list_command into the command dispatcher for both "list" and "ls" subcommands, add them to KNOWN_SUBCOMMANDS for metrics tracking, and include the command in help output. Co-Authored-By: Claude <noreply@anthropic.com> Agent transcript: https://claudescope.sentry.dev/share/DjJ6t8ZO_sqbk6IHmrGQiPmWd6h3xiPjb_UJw1ZZOYs
Calls users.info to check is_restricted/is_ultra_restricted before returning incident data. Fails open on API errors to avoid blocking legitimate users. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Agent transcript: https://claudescope.sentry.dev/share/xcbdzP6-Bc8Zwpwt0cbJLk-Ux2yggnJtRBcgrkBPa2A
Title and captain name are interpolated into Slack mrkdwn without escaping, allowing crafted titles like <http://evil|click> to inject clickable links. Uses the existing escape_slack_text helper. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Agent transcript: https://claudescope.sentry.dev/share/RQcgU1pYf87GRjczZdGrgFmHpHz6XbChAMuHshP78PY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a
/ft list(alias/ft ls) slash command that shows all non-privateactive and mitigated incidents grouped by status. Usable from any channel or
DM -- unlike other
/ftsubcommands, this is a read-only cross-cutting queryrather than an action on a specific incident channel.
Output is grouped into Active then Mitigated sections, newest first within
each group. Each line shows severity, incident number, title, captain, and a
link to the Slack channel.
The query uses
select_related("captain")andprefetch_related("external_links")to avoid N+1 queries. Private incidents are excluded entirely since Slack
command context does not carry an authenticated Django user.
Agent transcript: https://claudescope.sentry.dev/share/LMXluTDxc8O5rC063_tQKM7h_nJvlTD5Ei9Ype98AyE