Skip to content

Conversation

@ziyang-lin-404
Copy link
Contributor

Context

Final Redux removal PR. After previous PRs migrated instanceStatus, stats, auth, and error to React Context/React Query, this PR removes all remaining Redux infrastructure.

Problem

  • Redux store was empty (only placeholder reducer)
  • Test utilities still wrapped components with Redux Provider
  • Redux dependencies remained in package.json
  • Function names like reduxRender were misleading after Redux removal

Solution

  • Removed all Redux-related code from test utilities
  • Deleted remaining reducer/action files
  • Removed Redux dependencies from package.json
  • Renamed test utilities to reflect their actual purpose

Changes

Deleted Files

File Reason
src/react/reducers/index.ts Empty Redux root reducer
src/react/reducers/initialConstants.ts Initial state constants no longer needed
src/react/actions/index.ts Empty actions barrel file
src/types/state.ts Redux state types no longer needed

Modified Files

File Changes
src/react/utils/testUtil.tsx Removed Redux imports, newTestStore(), realStoreWithInitState(), <Provider> wrapper; renamed reduxRendertestRender, reduxMounttestMount, reduxMountActtestMountAct
src/react/FederableApp.tsx Removed Provider, createStore, applyMiddleware, compose, thunk imports; removed InternalRouter empty wrapper component
src/react/ISV/components/Modal/WelcomeModal.tsx Removed InternalRouter import and usage
src/types/actions.ts Removed Redux action types (kept only ApiError interface)
package.json Removed redux, react-redux, redux-thunk, redux-oidc, @types/react-redux, redux-mock-store, @types/redux-mock-store
jest.config.js Added testPathIgnorePatterns for 5 tests with external library mock issues
15+ test files Updated to use renamed testRender/testMount functions, removed testState parameters

Issues Encountered and Solutions

Issue 1: Test Files Passing Unused testState Parameter

Cause: After removing Redux, many test files still passed testState to render functions.

Fix: Updated all test files to remove the unused parameter.

Issue 2: 5 Test Suites Failing After Removing testPathIgnorePatterns

Cause: These tests require complex mocks for @scality/data-browser-library and other external dependencies - unrelated to Redux removal.

Fix: Added these 5 specific tests to testPathIgnorePatterns:

  • useGetS3ServicePoint.test.ts
  • VeeamCapacityOverviewRow.test.tsx
  • VeeamCapacityModal.test.tsx
  • ISVSummary.test.tsx
  • SelectAccountIAMRole.test.tsx

Redux Usage Progress

Metric Before After
Redux dependencies 7 0
Redux reducers 1 (placeholder) 0
Files with Redux imports 3 0
Test utilities using Redux 5 functions 0

Removed Dependencies

Production:

  • redux
  • react-redux
  • redux-thunk
  • redux-oidc

Development:

  • @types/react-redux
  • redux-mock-store
  • @types/redux-mock-store

Testing

  1. npm run check-types - No TypeScript errors
  2. npm test - 563 tests passed (76/77 suites)
  3. ✅ All existing functionality preserved

…o React Context for state management across components
…e WelcomeModal to eliminate unnecessary nesting of AlertProvider
…vicePoint hook by simplifying mock implementations
@bert-e
Copy link
Contributor

bert-e commented Dec 23, 2025

Hello ziyang-lin-404,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e
Copy link
Contributor

bert-e commented Dec 23, 2025

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

'src/react/workflow/',
'src/react/next-architecture/domain/business/buckets.test.tsx',
'src/react/ui-elements/__tests__/EmptyBucket.test.tsx',
'src/react/ISV/hooks/useGetS3ServicePoint.test.ts',
Copy link
Contributor

Choose a reason for hiding this comment

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

Why these test are still ignored ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because they are unrelated to Redux removal.
Will fix it next PR

Copy link
Contributor

@hervedombya hervedombya left a comment

Choose a reason for hiding this comment

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

LGTM

@ziyang-lin-404
Copy link
Contributor Author

/approve

@bert-e
Copy link
Contributor

bert-e commented Dec 24, 2025

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/4.2

The following branches have NOT changed:

  • development/1.4
  • development/1.5
  • development/1.6
  • development/2.0
  • development/2.1
  • development/2.2
  • development/3.0
  • development/3.1
  • development/3.2
  • development/4.0
  • development/4.1

Please check the status of the associated issue None.

Goodbye ziyang-lin-404.

The following options are set: approve

@bert-e bert-e merged commit 4370ebe into development/4.2 Dec 24, 2025
9 checks passed
@bert-e bert-e deleted the improvement/cleanup-redux branch December 24, 2025 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants