Skip to content

Commit ef4eca6

Browse files
authored
🐛 fix(aci): fix sentry app action handling for test notifications and action handling (#91306)
1 parent cca37d8 commit ef4eca6

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/sentry/sentry_apps/tasks/sentry_apps.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -615,11 +615,16 @@ def notify_sentry_app(event: GroupEvent, futures: Sequence[RuleFuture]):
615615
# If the future comes from a rule with a UI component form in the schema, append the issue alert payload
616616
# TODO(ecosystem): We need to change this payload format after alerts create issues
617617
id = f.rule.id
618+
618619
# if we are using the new workflow engine, we need to use the legacy rule id
619-
if features.has("organizations:workflow-engine-trigger-actions", event.group.organization):
620-
id = get_key_from_rule_data(f.rule, "legacy_rule_id")
621-
elif features.has("organizations:workflow-engine-ui-links", event.group.organization):
622-
id = get_key_from_rule_data(f.rule, "workflow_id")
620+
# Ignore test notifications
621+
if int(id) != -1:
622+
if features.has("organizations:workflow-engine-ui-links", event.group.organization):
623+
id = get_key_from_rule_data(f.rule, "workflow_id")
624+
elif features.has(
625+
"organizations:workflow-engine-trigger-actions", event.group.organization
626+
):
627+
id = get_key_from_rule_data(f.rule, "legacy_rule_id")
623628

624629
settings = f.kwargs.get("schema_defined_settings")
625630
if settings:

src/sentry/workflow_engine/typings/notification_action.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ class SentryAppFormConfigDataBlob(DataBlob):
710710
@classmethod
711711
def from_dict(cls, data: dict[str, Any]) -> SentryAppFormConfigDataBlob:
712712
if not isinstance(data.get("name"), str) or not isinstance(
713-
data.get("value"), (str, type(None))
713+
data.get("value"), (str, type(None), int)
714714
):
715715
raise ValueError("Sentry app config must contain name and value keys")
716716
return cls(name=data["name"], value=data["value"], label=data.get("label"))

0 commit comments

Comments
 (0)