feat(reports): add webhook option for notifications#36127
Conversation
|
Based on your review schedule, I'll hold off on reviewing this PR until it's marked as ready for review. If you'd like me to take a look now, comment
|
| AlertReports = 'ALERT_REPORTS', | ||
| AlertReportTabs = 'ALERT_REPORT_TABS', | ||
| AlertReportSlackV2 = 'ALERT_REPORT_SLACK_V2', | ||
| AlertReportWebhook = 'ALERT_REPORT_WEBHOOK', |
There was a problem hiding this comment.
I'm not sure we need this feature flag. I think this won't really break anything for existing users, and only ads new tooling for users.
In fairiness, we should probably open another PR to remove ALERT_REPORT_SLACK_V2 soon and complete that migration. And probably several others 😅
There was a problem hiding this comment.
Someone in the slack chat suggested that I add this to make it similar to how slack notifications are disabled by default and only enabled when a slack API key is provided. I dont mind removing it though since i agree i also dont really see how it breaks anything. Let me know what you think!
|
This is exciting! I'll just add that I believe this would allow for Superset to send messages in Microsoft Teams, which is something my org would use. |
|
I think we've resolved all but one bot-discovered issue here, and we just have some pre-commit/CI issues to tend to. If you can patch this up a bit (or allow me to write to your fork/branch/pr) I think we can get this one through! |
|
@rusackas Ill patch it up tonight with my teammate. Thanks for the feedback its been really helpful :D |
Co-authored-by: codeant-ai-for-open-source[bot] <244253245+codeant-ai-for-open-source[bot]@users.noreply.github.com>
| except (json.JSONDecodeError, KeyError, TypeError) as ex: | ||
| raise NotificationParamException("Webhook URL is required") from ex | ||
|
|
||
| def _get_req_payload(self) -> dict[str, Any]: |
There was a problem hiding this comment.
i just want to highlight that the selection of this structure for the json payload was kind of arbitrary. Is there any particular structure we want to format this in or are we good with the way it is?
|
Checks passing, looks like we're good to go? |
|
This is awesome! Let's merge this sucker! THANK YOU! |
…d config - security.mdx: document API key authentication (PR #37973) — creation via Security → API Keys, Bearer token usage, use cases, and security caution - alerts-reports.mdx: document webhook notifications (PR #36127) — enable via ALERT_REPORT_WEBHOOK feature flag, JSON payload format, multipart attachments, HTTPS enforcement, and retry behavior - theming.mdx: update default fonts note (IBM Plex Mono replaces Fira Code as default monospace in 6.1); add Theme Validation and Fallback section explaining the three-level fallback order and warning log behavior - configuring-superset.mdx: document HASH_ALGORITHM config key (md5/sha256 for FedRAMP compliance) and SQLLAB_HISTORY_RETENTION_DAYS (default 30 days, None to disable pruning) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Hriday Algh <hridayalgh@gmail.com> Co-authored-by: Hriday Algh <53922405+AlwaysIngame@users.noreply.github.com> Co-authored-by: codeant-ai-for-open-source[bot] <244253245+codeant-ai-for-open-source[bot]@users.noreply.github.com>
User description
SUMMARY
Added a webhook option for notification method when creating alerts/reports.
Created a new class for webhooks to follow the same pattern as the existing email and slack options
The webhook provides the following information in a request:
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
Testing webhook feature:
Testing webhook flag:
ADDITIONAL INFORMATION
CodeAnt-AI Description
Add Webhook notification method for alerts and reports
What Changed
Impact
✅ Send alerts/reports to webhook endpoints✅ Include report files and screenshots in webhook requests✅ Reject non-HTTPS webhook URLs when HTTPS-only config is enabled💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.