Skip to content

fix(reports): look up fetched report schedules by the list API id fields - #43365

Merged
rusackas merged 9 commits into
apache:masterfrom
endimonan:fix/report-menu-set-report-match
Sep 4, 2026
Merged

rusackas merged 9 commits into
apache:masterfrom
endimonan:fix/report-menu-set-report-match

Conversation

@endimonan

@endimonan endimonan commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

SUMMARY

When a dashboard or chart already has an email report, reloading the page makes the "Manage email report" menu fall back to "Set up an email report" (#43344). The same thing happens after toggling the schedule active. The fetch itself works, but the SET_REPORT reducer drops the result because it matches r.dashboard/r.chart while the list endpoint returns dashboard_id/chart_id.

This change matches fetched schedules using the list API fields and makes DELETE_REPORT understand the same response shape. The list response also includes report_format, so editing a fetched XLSX, CSV, text, or PNG report preserves its delivery format.

Explore can carry a dashboardId as navigation context for a chart-scoped report. In that case, the modal now selects the existing schedule using creationMethod and sends only the matching chart or dashboard field. This prevents editing the wrong schedule and avoids the API validation error caused by sending both IDs.

The usePrevious fetch gate and the unrelated custom_width list omission remain unchanged.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Same flow in both recordings: create a report through the menu (it switches to the manage entries), then reload the page.

Before (master): after the reload the menu falls back to "Set up an email report".
before-43344

After (this branch): the manage entries persist across the reload.
after-43344

TESTING INSTRUCTIONS

  1. Enable ALERT_REPORTS and create an email report on a dashboard through the three-dot menu.
  2. Reload the page and open the menu again. The manage entries should remain available.
  3. Toggle "Email reports active". The manage entries should remain after the refetch.
  4. Create an XLSX report, reload, edit it, and save without changing the format. The XLSX option and submitted format should be preserved.
  5. From a dashboard, open one of its charts in Explore and create a chart email report. Saving should succeed without a 422 response.
  6. Reload that Explore page and edit the report. The existing chart report should open and save instead of creating or editing a dashboard report.

Automated checks:

cd superset-frontend
npm run test -- src/features/reports/ReportModal/ReportModal.test.tsx src/features/reports/ReportModal/HeaderReportDropdown/index.test.tsx src/features/reports/ReportModal/reducer.test.ts
npm run type

ADDITIONAL INFORMATION

@endimonan
endimonan force-pushed the fix/report-menu-set-report-match branch from 91d8b41 to bfd6e83 Compare August 20, 2026 12:07
@codecov

codecov Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.25%. Comparing base (b24cb2a) to head (e264f77).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #43365   +/-   ##
=======================================
  Coverage   79.24%   79.25%           
=======================================
  Files        2888     2888           
  Lines      166448   166453    +5     
  Branches    38530    38535    +5     
=======================================
+ Hits       131909   131917    +8     
+ Misses      32045    32042    -3     
  Partials     2494     2494           
Flag Coverage Δ
hive 37.89% <ø> (ø)
javascript 74.75% <100.00%> (+<0.01%) ⬆️
mysql 57.57% <ø> (ø)
postgres 57.61% <ø> (+<0.01%) ⬆️
presto 39.80% <ø> (ø)
python 83.74% <ø> (-0.01%) ⬇️
sqlite 57.30% <ø> (ø)
unit 74.00% <ø> (-0.01%) ⬇️

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.

@endimonan

Copy link
Copy Markdown
Contributor Author

/review

@bito-code-review

bito-code-review Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #d606bb

Actionable Suggestions - 0
Review Details
  • Files reviewed - 5 · Commit Range: 9a2e46d..bfd6e83
    • superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.test.tsx
    • superset-frontend/src/features/reports/ReportModal/actions.ts
    • superset-frontend/src/features/reports/ReportModal/reducer.test.ts
    • superset-frontend/src/features/reports/ReportModal/reducer.ts
    • superset-frontend/src/features/reports/types.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✖︎ Failed

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

@endimonan
endimonan marked this pull request as ready for review August 20, 2026 12:37
@dosubot dosubot Bot added alert-reports Namespace | Anything related to the Alert & Reports feature change:frontend Requires changing the frontend labels Aug 20, 2026
The reducer matched fetched reports by dashboard/chart, but the list API
returns dashboard_id/chart_id, so the schedule was dropped and the menu
stayed on "Set up an email report" after a reload. Fixes apache#43344
@endimonan
endimonan force-pushed the fix/report-menu-set-report-match branch from bfd6e83 to 32a58aa Compare August 20, 2026 12:39
@bito-code-review

bito-code-review Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #5903c5

Actionable Suggestions - 0
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.test.tsx - 1
Review Details
  • Files reviewed - 5 · Commit Range: 81c85ec..32a58aa
    • superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.test.tsx
    • superset-frontend/src/features/reports/ReportModal/actions.ts
    • superset-frontend/src/features/reports/ReportModal/reducer.test.ts
    • superset-frontend/src/features/reports/ReportModal/reducer.ts
    • superset-frontend/src/features/reports/types.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✖︎ Failed

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

@sadpandajoe sadpandajoe added the review:checkpoint Last PR reviewed during the daily review standup label Aug 20, 2026
Comment thread superset-frontend/src/features/reports/ReportModal/reducer.ts
Comment thread superset-frontend/src/features/reports/ReportModal/reducer.ts
@sadpandajoe sadpandajoe removed the review:checkpoint Last PR reviewed during the daily review standup label Aug 25, 2026
@github-actions github-actions Bot added the api Related to the REST API label Aug 26, 2026
@netlify

netlify Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

👷 Deploy Preview for superset-docs-preview processing.

Name Link
🔨 Latest commit c76aee5
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a95abc4ad27f400084a14c8

@bito-code-review

bito-code-review Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #de5661

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.test.tsx - 1
    • Missing assertion for new field · Line 164-164
      The test adds `report_format: 'PNG'` to the API mock response but only asserts UI text elements. Consider adding an assertion that validates `report_format` is correctly used (e.g., checking if the component renders format-specific UI or passes it through correctly).
Review Details
  • Files reviewed - 4 · Commit Range: 32a58aa..267917a
    • superset/reports/api.py
    • tests/integration_tests/reports/api_tests.py
    • superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.test.tsx
    • superset-frontend/src/features/reports/ReportModal/ReportModal.test.tsx
  • 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 an incremental AI Review.

  • /review full - 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

@bito-code-review

bito-code-review Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #3af7e0

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/src/features/reports/ReportModal/index.tsx - 1
    • Duplicated resource resolution · Line 173-178
      The chart-vs-dashboard decision is now encoded twice in this component: the selector (lines 173-178) picks `CreationMethod`/id by `isChartReport`, and `onSave` (lines 198-200) independently recomputes `{ chart }` vs `{ dashboard }`. If one site is updated without the other, the modal could load one report but save to another. Consider a single `getReportResource(creationMethod, chart, dashboardId)` helper used by both.
Review Details
  • Files reviewed - 2 · Commit Range: 267917a..e264f77
    • superset-frontend/src/features/reports/ReportModal/ReportModal.test.tsx
    • superset-frontend/src/features/reports/ReportModal/index.tsx
  • Files skipped - 0
  • Tools
    • 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 an incremental AI Review.

  • /review full - 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

@rusackas
rusackas merged commit 67a4178 into apache:master Sep 4, 2026
80 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

alert-reports Namespace | Anything related to the Alert & Reports feature api Related to the REST API change:frontend Requires changing the frontend size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard "Manage email report" menu stays stuck on "Set up" after page reload, even though a report already exists

3 participants