Repository navigation
feat(reports): add retry on failure support for reports - #42481
Conversation
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #42481 +/- ##
==========================================
- Coverage 65.59% 65.58% -0.01%
==========================================
Files 2819 2819
Lines 160166 160372 +206
Branches 36569 36617 +48
==========================================
+ Hits 105059 105182 +123
- Misses 53059 53126 +67
- Partials 2048 2064 +16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
amaannawab923
left a comment
There was a problem hiding this comment.
nice feature, the config surface and schema validation look clean and the notification changes stay backwards compatible. left a few inline notes, the main one is the retry window check which i think keeps it from ever hitting max attempts. worth a run with a tz-aware scheduled_dttm before merge since the tests use naive datetimes and don't really hit that path.
| ) | ||
| self._send(notification_content, recipients) | ||
|
|
||
| def send_final_failure_report(self, error_message: str) -> None: |
There was a problem hiding this comment.
quick question on intent here. the description says send_failed_reports will "deliver the report to recipients even after all retries fail", but this builds a NotificationContent with just text=error_message and no screenshots/csv/embedded data, so recipients get a failure notice with the error rather than the actual report. if that's what you meant then all good and maybe just reword the option, but if the idea was to send the last-attempt report itself then this doesn't quite do that yet.
There was a problem hiding this comment.
This is intentional, send_failed_reports means "notify recipients about the failure after retries are exhausted," not "deliver a broken report." Recipients get an error email with the failure details and a link to the chart/dashboard.
There was a problem hiding this comment.
Code Review Agent Run #165e40
Actionable Suggestions - 3
-
superset-frontend/src/pages/AlertReportList/index.tsx - 1
- Inconsistent filter option coverage · Line 81-81
-
superset-frontend/src/features/alerts/components/AlertStatusIcon.tsx - 1
- Missing unit tests for Retrying · Line 42-43
-
superset-frontend/src/features/alerts/AlertReportModal.tsx - 1
- Missing test for disable toggle · Line 2760-2771
Additional Suggestions - 3
-
superset/commands/report/update.py - 1
-
Missing test for send_failed_reports validation · Line 180-196The new cross-field validation at lines 183–193 has no test coverage. `tests/unit_tests/commands/report/update_test.py` contains 20+ tests for `UpdateReportScheduleCommand.validate()` but none verifies that `send_failed_reports=True` without `retry_on_failure` is rejected. Per BITO.md rule [11730], new functionality requires comprehensive unit tests covering both success and error paths.
-
-
tests/unit_tests/reports/schemas_test.py - 1
-
Missing PUT schema cross-field test · Line 507-513The PUT schema lacks a test for the `send_failed_reports`/`retry_on_failure` cross-field constraint. While `ReportSchedulePostSchema` has `validate_retry_config` (schemas.py:343) enforcing that `send_failed_reports=True` requires `retry_on_failure=True`, `ReportSchedulePutSchema` has no such validator (only `@validates("custom_width")` at line 517). Without a test, a future code change adding a validator to PUT would have no regression guard.
-
-
superset/reports/notifications/email.py - 1
-
Feature scope clarification needed · Line 164-167The refactoring removes screenshot embedding from retry error notification emails. This is an intentional behavior change (retry emails now exclude inline screenshots), but it may surprise users who rely on visual context during retry attempts. Consider: (1) documenting this limitation in the retry feature documentation, or (2) adding a comment in the code explaining why screenshots are omitted for retry templates (e.g., to reduce email size/complexity during high-frequency retry operations).
-
Filtered by Review Rules
Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
-
superset/daos/report.py - 1
- SQL grouping bug: or_() filter deleted · Line 292-314
-
superset/reports/types.py - 1
- Required key breaks valid usage · Line 22-22
Review Details
-
Files reviewed - 15 · Commit Range:
de0bea3..c1601b3- superset-frontend/src/features/alerts/AlertReportModal.tsx
- superset-frontend/src/features/alerts/components/AlertStatusIcon.tsx
- superset-frontend/src/features/alerts/types.ts
- superset-frontend/src/features/reports/ReportModal/index.tsx
- superset/commands/report/execute.py
- superset/commands/report/update.py
- superset/config.py
- superset/daos/report.py
- superset/reports/notifications/email.py
- superset/reports/types.py
- tests/integration_tests/reports/commands_tests.py
- tests/unit_tests/reports/schemas_test.py
- superset-frontend/src/pages/AlertReportList/index.tsx
- superset/migrations/versions/2026-07-28_00-00_f3a8c1d2e9b7_add_report_retry_state_columns.py
- superset/reports/api.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
- Eslint (Linter) - ✔︎ 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 [email protected].
Documentation & Help
…andrusoare/feat/report-failure-retry
There was a problem hiding this comment.
Code Review Agent Run #ce0668
Actionable Suggestions - 1
-
superset-frontend/src/features/alerts/components/AlertStatusIcon.tsx - 1
- Inconsistent conditional handling · Line 97-101
Additional Suggestions - 2
-
superset/reports/schemas.py - 1
-
Missing unit test for new validation · Line 357-363The new `retry_on_failure` validation for alerts (lines 357-363) lacks test coverage. Add a test that verifies `ReportSchedulePostSchema` raises `ValidationError` when loading data with `type: "Alert"` and `retry_on_failure: true`.
-
-
superset-frontend/src/features/alerts/components/AlertStatusIcon.test.tsx - 1
-
Incomplete icon type verification · Line 77-82The merged test verifies the icon exists via `getByRole('img')` but no longer validates the specific icon type. All 7 other icon tests in this file use `data-icon` attribute queries (e.g., `container.querySelector('[data-icon="check"]')`). Consider restoring the `data-icon="running"` assertion to verify `Icons.Running` is rendered, ensuring the test actually validates what the removed test claimed to test.
-
Filtered by Review Rules
Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
-
superset/reports/schemas.py - 1
- Inconsistent validation across schemas · Line 357-363
-
superset-frontend/src/features/alerts/AlertReportModal.test.tsx - 1
- Incomplete test for state reset · Line 2920-2947
-
superset/commands/report/execute.py - 1
- Semantic duplication of warning_message init · Line 1639-1641
Review Details
-
Files reviewed - 13 · Commit Range:
c1601b3..7199b4b- superset-frontend/src/features/alerts/AlertReportModal.test.tsx
- superset-frontend/src/features/alerts/components/AlertStatusIcon.test.tsx
- superset-frontend/src/features/alerts/components/AlertStatusIcon.tsx
- superset/commands/report/execute.py
- superset/migrations/versions/2026-07-28_00-00_f3a8c1d2e9b7_add_report_retry_state_columns.py
- superset/reports/notifications/slack_mixin.py
- superset/reports/schemas.py
- tests/integration_tests/reports/commands_tests.py
- superset-frontend/src/features/alerts/types.ts
- superset/commands/report/update.py
- superset/reports/api.py
- tests/integration_tests/reports/api_tests.py
- tests/unit_tests/commands/report/update_test.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
- Eslint (Linter) - ✔︎ 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 [email protected].
Documentation & Help
| case AlertState.Retrying: | ||
| lastStateConfig.icon = Icons.Running; | ||
| lastStateConfig.label = t('Report retrying'); | ||
| lastStateConfig.status = AlertState.Retrying; | ||
| break; |
There was a problem hiding this comment.
Removing the isReportEnabled conditional from the Retrying case creates inconsistent behavior compared to all other alert states (Success, Working, Error, Noop). When isReportEnabled=false (regular alerts), users will now see 'Report retrying' which is semantically incorrect. The label should remain conditional like the other states in this switch.
Code Review Run #ce0668
Should Bito avoid suggestions like this for future reviews? (Manage Rules)
- Yes, avoid them
rusackas
left a comment
There was a problem hiding this comment.
LGTM2.... but there are some nits that can be followed up now OR later.
- _get_subject() has a "Report Failed - All Retries Exhausted" branch for the final-failure email, but _get_content() doesn't special-case that path, so the body falls through to the plain generic error template with no retry context. Subject promises more than the body delivers. Bito caught this one and it's still unaddressed.
- AlertStatusIcon's isRunningIcon still only checks AlertState.Working, so a retrying report gets the running icon at normal size instead of the enlarged "actively working" treatment. Cosmetic only.
- The new UpdateReportScheduleCommand.validate() cross-field checks (the PUT fix above) have zero test coverage — update_test.py only adds default mock attrs, nothing exercises the actual rejection path through the command. I confirmed the logic is correct by reading it, but it's not proven by a test.
- Bito flagged duplicate test-setup blocks in the new commands_tests.py additions (real, in this PR's own new code)
Code Review Agent Run #cab53dActionable Suggestions - 0Additional Suggestions - 1
Filtered by Review RulesBito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
The rebase onto current master re-pointed down_revision from e7d93a524ff6 to f3a8c1d2e9b7 — master gained the reports-retry migration (apache#42481) claiming the same parent, which left two alembic heads — but the docstring header still named the old ancestor. Alembic reads the variable, not the docstring, so the graph was correct and CI passed. The header was simply lying to the next person to read it, which is exactly when a migration file gets read: while diagnosing a broken chain. Caught by codeant and bito independently. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
SUMMARY
Adds the ability to automatically retry report delivery when it fails. Previously, a failed report would immediately transition to an error state. Now, users can configure retry behavior per report:
The retry configuration is available in both the Alerts & Reports page modal and the dashboard/chart email report modal, under a new "Error handling" section.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION