Skip to content

Commit 8a82aff

Browse files
authored
ref(alert): Refactor arguments for slack channel function #20694
Previously this function broke due to an additional parameter being added to rule creation and had to be fixed here: #20478 Removed unused parameters and configured this celery task/function to carry on extra parameters that are not used in the function's logic to be passed along to the rule creator/updater
1 parent db79107 commit 8a82aff

File tree

1 file changed

+3
-22
lines changed

1 file changed

+3
-22
lines changed

src/sentry/integrations/slack/tasks.py

+3-22
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,7 @@ def _format_value(self, status, rule_id):
5858

5959

6060
@instrumented_task(name="sentry.integrations.slack.search_channel_id", queue="integrations")
61-
def find_channel_id_for_rule(
62-
name,
63-
environment,
64-
project,
65-
action_match,
66-
filter_match,
67-
conditions,
68-
actions,
69-
frequency,
70-
uuid,
71-
rule_id=None,
72-
):
61+
def find_channel_id_for_rule(project, actions, uuid, rule_id=None, **kwargs):
7362
redis_rule_status = RedisRuleStatus(uuid)
7463

7564
try:
@@ -118,16 +107,8 @@ def find_channel_id_for_rule(
118107
action["channel_id"] = item_id
119108
break
120109

121-
kwargs = {
122-
"name": name,
123-
"environment": environment,
124-
"project": project,
125-
"action_match": action_match,
126-
"filter_match": filter_match,
127-
"conditions": conditions,
128-
"actions": actions,
129-
"frequency": frequency,
130-
}
110+
kwargs["actions"] = actions
111+
kwargs["project"] = project
131112

132113
if rule_id:
133114
rule = Rule.objects.get(id=rule_id)

0 commit comments

Comments
 (0)