chore: grafana-irm command (#4762)

This commit is contained in:
Innokentii Konstantinov 2024-07-31 19:50:07 +08:00 committed by GitHub
parent ce45286a48
commit 1faffb3dae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View file

@ -38,4 +38,4 @@ class SlashCommand:
@property
def is_grafana_command(self):
return self.command in ["grafana", "grafana-dev", "grafana-ops", "grafana-prod"]
return self.command in ["grafana-irm", "grafana-irm-dev", "grafana-irm-ops", "grafana-irm-prod"]

View file

@ -306,7 +306,7 @@ def test_grafana_escalate(
"channel_name": "test",
"user_id": slack_user_identity.slack_id,
"user_name": "Steve",
"command": "/grafana",
"command": "/grafana-irm",
"text": "escalate",
"response_url": "https://hooks.slack.com/commands/1234/5678",
"trigger_id": "13345224609.738474920.8088930838d88f008e0",
@ -349,7 +349,7 @@ def test_grafana_escalate_with_org_from_chatops_proxy_defines_org(
"channel_name": "test",
"user_id": slack_user_identity.slack_id,
"user_name": "Steve",
"command": "/grafana",
"command": "/grafana-irm",
"text": "escalate",
"response_url": "https://hooks.slack.com/commands/1234/5678",
"trigger_id": "13345224609.738474920.8088930838d88f008e0",

View file

@ -3,7 +3,7 @@ from apps.slack.slash_command import SlashCommand
def test_parse():
payload = {
"command": "/grafana",
"command": "/grafana-irm",
"text": "escalate",
"trigger_id": "trigger_id",
"user_id": "user_id",
@ -11,7 +11,7 @@ def test_parse():
"api_app_id": "api_app_id",
}
slash_command = SlashCommand.parse(payload)
assert slash_command.command == "grafana"
assert slash_command.command == "grafana-irm"
assert slash_command.args == ["escalate"]
assert slash_command.subcommand == "escalate"
assert slash_command.is_grafana_command