rusackas commented on code in PR #36127:
URL: https://github.com/apache/superset/pull/36127#discussion_r2621562452
##########
superset/views/base.py:
##########
@@ -460,10 +460,12 @@ def cached_common_bootstrap_data( # pylint:
disable=unused-argument
ReportRecipientType.EMAIL,
ReportRecipientType.SLACK,
ReportRecipientType.SLACKV2,
+ ReportRecipientType.WEBHOOK,
]
else:
frontend_config["ALERT_REPORTS_NOTIFICATION_METHODS"] = [
ReportRecipientType.EMAIL,
+ ReportRecipientType.WEBHOOK,
Review Comment:
Likely Not Valid
Looking at typical Superset patterns and the actual usage:
ReportRecipientType is just a discriminant literal union — it identifies
what kind of recipient this is
recipient_config_json is stored as a string in the database and parsed at
runtime (see backend:
json.loads(self._recipient.recipient_config_json)["target"])
There's no TypeScript discriminated union mapping each ReportRecipientType
to a specific config shape
The frontend doesn't type-check the internal structure of
recipient_config_json — it's treated as an opaque JSON string. The actual shape
validation happens in Python.
Evidence from this PR: The NotificationMethod.tsx component handles Webhook
config by simply storing {"target": "<url>"} in the JSON string, same pattern
as Email/Slack. No type-level config discrimination exists.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]