oncall-engine/engine/apps/slack
Innokentii Konstantinov 94219c25bb
Introduce slash command matcher (#4717)
With the Unified Slack app we now have two ways of calling commands.
1. Legacy one when command invoked directly: /escalate
2. Unified one: /grafana escalate
On top of that we have different slach commands for each environment:
/escalate-local, /escalate-dev, etc. It was leading to a weird command
to escalate via Unified App in dev u need to type: /grafana-dev
escalate-develop.

To support both, I introduced a matcher function for SlashCommandRoutes.
It allows to simplify handling of such cases without complex workarounds
in an EventAPIEndpoint.


# What this PR does

## Which issue(s) this PR closes

Related to [issue link here]

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-24 09:53:06 +00:00
..
migrations Unified Slack app reinstall (#4682) 2024-07-19 11:53:06 +00:00
models Unified Slack app reinstall (#4682) 2024-07-19 11:53:06 +00:00
representatives cleanup CustomButton backend code + add ngrok/express outgoing webhook e2e test (#2544) 2024-03-28 15:37:22 +00:00
scenarios Introduce slash command matcher (#4717) 2024-07-24 09:53:06 +00:00
tests Introduce slash command matcher (#4717) 2024-07-24 09:53:06 +00:00
types Introduce slash command matcher (#4717) 2024-07-24 09:53:06 +00:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
alert_group_slack_service.py Do not retry on SlackAPICantUpdateMessageError errors (#4405) 2024-05-28 17:46:15 +00:00
chatops_proxy_routing.py Prepare OnCall for Unified Slack App (#4232) 2024-06-03 09:07:10 +00:00
client.py Update when slack client ratelimit retry handler is enabled (#3447) 2023-11-30 12:35:46 +00:00
constants.py Truncate resolution note text in slack message to satisfy block limits (#3351) 2023-11-16 13:15:04 +00:00
errors.py Avoid retrying to update Slack log message if cant_update_message (#4329) 2024-05-09 16:16:53 +00:00
installation.py Unified Slack app reinstall (#4682) 2024-07-19 11:53:06 +00:00
slack_formatter.py Fix alert group rendering (#3424) 2023-11-24 15:39:37 +00:00
slash_command.py Introduce slash command matcher (#4717) 2024-07-24 09:53:06 +00:00
tasks.py fix slack API rate limit errors in send_message_to_thread_if_bot_not_in_channel task (#3803) 2024-01-31 13:42:52 -05:00
test_slack_message.py Improve Slack error handling (#3000) 2023-09-12 09:49:16 +00:00
urls.py Make Slack URLs work without trailing slashes (#4607) 2024-07-03 15:55:54 +00:00
utils.py attempt to address some SlackAPIRatelimitError exceptions (#3820) 2024-02-01 14:47:12 -05:00
views.py Introduce slash command matcher (#4717) 2024-07-24 09:53:06 +00:00