Skip to content

fix(reports): make webhook notification request timeout configurable - #43018

Merged
rusackas merged 2 commits into
masterfrom
fix/followup-41250-follow-up-from-41250-fix-reports-add-net
Aug 11, 2026
Merged

fix(reports): make webhook notification request timeout configurable#43018
rusackas merged 2 commits into
masterfrom
fix/followup-41250-follow-up-from-41250-fix-reports-add-net

Conversation

@rusackas

Copy link
Copy Markdown
Member

Follow-up to #41250. That PR made SMTP, CSV/dataframe, and Selenium network timeouts configurable so a hung network call can't wedge a report schedule in WORKING forever. It missed the webhook notification path: both requests.post() calls in superset/reports/notifications/webhook.py still hardcoded timeout=60.

SUMMARY

Adds ALERT_REPORTS_WEBHOOK_TIMEOUT (default 60, matching the prior hardcoded value) and wires it into both webhook requests.post() calls, consistent with the other timeouts #41250 introduced. Also documents the new setting alongside the existing ALERT_REPORTS_WEBHOOK_HTTPS_ONLY docs.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A (backend config change).

TESTING INSTRUCTIONS

  • pytest tests/unit_tests/reports/notifications/webhook_tests.py
  • New test test_send_forwards_configured_timeout asserts the configured value is passed through to requests.post.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration
  • Introduces new feature or API
  • Removes existing feature or API

🤖 Generated with Claude Code

Both requests.post() calls in webhook notifications hardcoded
timeout=60, unlike the SMTP/CSV/Selenium timeouts made configurable in
#41250. Add ALERT_REPORTS_WEBHOOK_TIMEOUT (default 60) and wire it into
both calls so operators can tune it consistently with the other
network timeouts.

Co-Authored-By: Claude <noreply@anthropic.com>
@bito-code-review

bito-code-review Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #6d1052

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: 866fb14..866fb14
    • docs/admin_docs/configuration/alerts-reports.mdx
    • superset/config.py
    • superset/reports/notifications/webhook.py
    • tests/unit_tests/reports/notifications/webhook_tests.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot Bot added alert-reports Namespace | Anything related to the Alert & Reports feature change:backend Requires changing the backend install:config Installation - Configuration settings labels Aug 10, 2026
@github-actions github-actions Bot added doc Namespace | Anything related to documentation preset-io and removed change:backend Requires changing the backend install:config Installation - Configuration settings alert-reports Namespace | Anything related to the Alert & Reports feature labels Aug 10, 2026
@netlify

netlify Bot commented Aug 10, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 866fb14
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a7a34f6c289ea00088ca1df
😎 Deploy Preview https://deploy-preview-43018--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 66.54%. Comparing base (0dedc55) to head (d75b827).
⚠️ Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
superset/reports/notifications/webhook.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #43018      +/-   ##
==========================================
- Coverage   66.59%   66.54%   -0.05%     
==========================================
  Files        2863     2864       +1     
  Lines      161681   161884     +203     
  Branches    37249    37298      +49     
==========================================
+ Hits       107678   107733      +55     
- Misses      51961    52105     +144     
- Partials     2042     2046       +4     
Flag Coverage Δ
hive 38.16% <75.00%> (-0.06%) ⬇️
mysql 57.68% <75.00%> (-0.08%) ⬇️
postgres 57.73% <75.00%> (-0.08%) ⬇️
presto 40.12% <75.00%> (-0.07%) ⬇️
python 59.12% <75.00%> (-0.09%) ⬇️
sqlite 57.35% <75.00%> (-0.08%) ⬇️
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes webhook notification HTTP request timeouts configurable for alert/report delivery, aligning the webhook path with prior work that added network timeouts to prevent report schedules from getting stuck in WORKING.

Changes:

  • Adds new config ALERT_REPORTS_WEBHOOK_TIMEOUT (default 60) and uses it for webhook requests.post() calls.
  • Adds a unit test to assert the configured timeout is forwarded to requests.post.
  • Documents the new configuration option in the alerts/reports admin docs.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
superset/reports/notifications/webhook.py Reads ALERT_REPORTS_WEBHOOK_TIMEOUT from config and forwards it to both webhook request paths.
tests/unit_tests/reports/notifications/webhook_tests.py Extends existing mocks and adds a test asserting the configured timeout is passed to requests.post.
superset/config.py Introduces ALERT_REPORTS_WEBHOOK_TIMEOUT with default value and explanatory comment.
docs/admin_docs/configuration/alerts-reports.mdx Documents how to configure the webhook request timeout and notes disabling via None.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread superset/reports/notifications/webhook.py
@bito-code-review

Copy link
Copy Markdown
Contributor

The documentation in docs/admin_docs/configuration/alerts-reports.mdx should be updated to reflect that the timeout is configurable via ALERT_REPORTS_WEBHOOK_TIMEOUT rather than hard-coded to 60 seconds. The current text in the "Retry Behavior" section incorrectly references a fixed 60-second timeout and "run its full 60s".

Suggested update for the documentation:

Retries are bounded to roughly 120 seconds of cumulative wall-clock time (worst case ~210 seconds, because the bound is checked against the time elapsed before each attempt, so the final request can begin just under the limit and still run its full configured timeout), after which the delivery is abandoned.

docs/admin_docs/configuration/alerts-reports.mdx

Retries are bounded to roughly 120 seconds of cumulative wall-clock time (worst case ~210 seconds, because the bound is checked against the time elapsed before each attempt, so the final request can begin just under the limit and still run its full configured timeout), after which the delivery is abandoned.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bito-code-review

bito-code-review Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #219201

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 866fb14..d75b827
    • superset/reports/notifications/webhook.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@sha174n sha174n left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Default keeps the current 60s behavior and the SSRF/HTTPS validation is untouched; the timeout just becomes configurable. CI green.

@rusackas
rusackas merged commit 553808d into master Aug 11, 2026
68 checks passed
@rusackas
rusackas deleted the fix/followup-41250-follow-up-from-41250-fix-reports-add-net branch August 11, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Namespace | Anything related to documentation preset-io size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants