Skip to content

chore(version-history): use typed app dispatch - #44438

Merged
rusackas merged 1 commit into
apache:masterfrom
flcrom:fix/version-history-typed-dispatch
Sep 22, 2026
Merged

rusackas merged 1 commit into
apache:masterfrom
flcrom:fix/version-history-typed-dispatch

Conversation

@flcrom

@flcrom flcrom commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

SUMMARY

Migrates the version history feature from raw react-redux useDispatch to the shared typed useAppDispatch hook introduced for the React Redux v8 migration.

This covers all six production consumers under features/versionHistory. The existing hook test now mocks src/views/store.useAppDispatch, so its dispatch assertions still exercise the same calls. There are no behavior, selector, callback, or action-order changes.

Closes #39927 (version history slice).

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Not applicable - no UI change.

TESTING INSTRUCTIONS

Run:

npx jest src/features/versionHistory --runInBand --silent
npx oxlint --config oxlint.json \
  src/features/versionHistory/ChartVersionPreview.tsx \
  src/features/versionHistory/DashboardVersionHistory.tsx \
  src/features/versionHistory/ExploreVersionHistory.tsx \
  src/features/versionHistory/PreviewBanner.tsx \
  src/features/versionHistory/useDashboardVersionPreview.ts \
  src/features/versionHistory/useVersionActions.test.tsx \
  src/features/versionHistory/useVersionActions.tsx

Observed locally:

  • 18 test suites passed, 204 tests passed.
  • Oxlint reported 0 errors and 3 existing set-state-in-effect warnings in unchanged code.
  • Full npm run type was attempted but did not finish within the runner window. The focused React Redux v8 compatibility check for useAppDispatch passed during review.

ADDITIONAL INFORMATION

  • Has associated issue: Migrate to react-redux v8 with a typed AppDispatch / useAppDispatch #39927
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@bito-code-review

bito-code-review Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #33642f

Actionable Suggestions - 0
Review Details
  • Files reviewed - 7 · Commit Range: 67aa15a..67aa15a
    • superset-frontend/src/features/versionHistory/ChartVersionPreview.tsx
    • superset-frontend/src/features/versionHistory/DashboardVersionHistory.tsx
    • superset-frontend/src/features/versionHistory/ExploreVersionHistory.tsx
    • superset-frontend/src/features/versionHistory/PreviewBanner.tsx
    • superset-frontend/src/features/versionHistory/useDashboardVersionPreview.ts
    • superset-frontend/src/features/versionHistory/useVersionActions.test.tsx
    • superset-frontend/src/features/versionHistory/useVersionActions.tsx
  • Files skipped - 0
  • Tools
    • 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 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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@codecov

codecov Bot commented Sep 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.28%. Comparing base (128c0c1) to head (67aa15a).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #44438      +/-   ##
==========================================
- Coverage   66.29%   66.28%   -0.01%     
==========================================
  Files        2942     2942              
  Lines      175692   175692              
  Branches    40788    40788              
==========================================
- Hits       116467   116460       -7     
- Misses      56770    56777       +7     
  Partials     2455     2455              
Flag Coverage Δ
javascript 76.10% <100.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.

@mikebridge mikebridge left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. The six consumers use the existing typed dispatch hook without changing dispatch behavior, and the test mock follows the imported hook correctly.

Reviewed 67aa15a; CI is green. I did not rerun Jest or the TypeScript build locally.

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, clean swap to the typed dispatch hook.

@rusackas
rusackas merged commit 86fb8db into apache:master Sep 22, 2026
88 checks passed
villebro pushed a commit that referenced this pull request Sep 30, 2026
Co-authored-by: Vardhman Bengani <[email protected]>
(cherry picked from commit 86fb8db)
amaannawab923 added a commit that referenced this pull request Nov 10, 2026
…403 as a page

Enzo's review at 8fc5271. Most of this is deletion: the published surface
described locations, types and constants that no code on this branch reads,
so an author following the docs got nothing and no error.

- The view-location table listed `navbar.right`, the home, dashboard,
  explore and listView locations. Only `sqllab.*` has anything behind it;
  `navbar.right` is the legacy `extensionsRegistry` slot, not a views
  location. Those rows, the three sections under them and
  `views.ListViewItemProps` go with the locations, in the change that
  renders them.

- `menus.NAVBAR_LOCATION`, `SETTINGS_MENU_LOCATION` and `PageMenuItem` were
  the SIP-235 shape authors would reach for, and nothing reads either
  location: `Menu.tsx` builds the navbar from the manifest's `nav` block.
  The whole menu half is out, including the exactly-one-of validation and
  the `PanelToolbar` guards that only existed because `command` had become
  optional. `order` stays -- it sorts the sqllab menus that are rendered
  today.

- `getPageViews`/`usePageViews` returned `[]` everywhere outside their own
  test, because the loader routes a `PAGE_LOCATION` registration to
  `registerPageFor` and a page never reaches `viewRegistry`. Gone, with the
  five tests that exercised the impossible path, and `PAGE_LOCATION` now
  says on both sides that pages are read through `pages`.

- A gated page returned raw JSON again: `show_http_exception` renders HTML
  for 404 and 500 only, so `Forbidden` answered a refresh or a bookmark
  with `GENERIC_BACKEND_ERROR` instead of the Not authorized screen the
  client already has. It serves the shell with a 403 now, and three
  test-client cases cover the 403, the flag-off 404 and the plain shell --
  nothing called the route before.

- `test_views_are_secured` was red on all three DB jobs: `@signed_in` sets
  no `_permission_name`, so `ExtensionsView.page` needs the allowlist entry
  next to `language_pack_script`.

- The `useDashboardVersionPreview` change undid #44438 to patch one caller,
  and the import edge that tripped it went out with the earlier scope cut:
  reverted, `resolveSnapshotTheme` private again. SliceHeaderControls,
  versionHistory and DashboardBuilder pass without it.

- Two `messages.pot` msgids went stale when the `ExtensionPage` copy
  changed, which is what failed babel-extract and `check_pot_drift_test`.

Also the pre-commit leftovers: auto-walrus on `view.py`, oxfmt on
`superset-core/package.json` and `core/http/index.ts`, and the comment in
`routes.tsx` and the docblock in `routes.test.tsx` that still began
mid-sentence from the deleted catch-all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate to react-redux v8 with a typed AppDispatch / useAppDispatch

4 participants