CONSOLE-5073: Update redux-related packages to latest#16087
CONSOLE-5073: Update redux-related packages to latest#16087openshift-merge-bot[bot] merged 3 commits intoopenshift:mainfrom
Conversation
|
@logonoff: This pull request references CONSOLE-5073 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/label px-approved |
|
@logonoff: This pull request references CONSOLE-5073 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
📝 WalkthroughWalkthroughThis pull request updates Redux ecosystem dependencies in the frontend package: react-redux from 8.1.3 to 9.2.0, redux from ^4.0.4 to ^5.0.1, and redux-thunk from 2.4.0 to 3.1.0, while removing redux-mock-store. Import statements for redux-thunk across test files are changed from default imports to named imports. Test mock variables are refactored with stricter TypeScript typing using 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
frontend/packages/console-shared/src/components/editor/__tests__/CodeEditorToolbar.spec.tsx (1)
27-31: Add defaultuseOLSConfigMockreturn inbeforeEachto strengthen test isolation.Tests at lines 33-36 and 38-41 don't set
useOLSConfigMock, yet rely on it being in a default state. Sincejest.clearAllMocks()preservesmockReturnValueimplementations and only clears call history, tests become order-dependent: if a prior test setsuseOLSConfigMock.mockReturnValue(true), that persists into tests expecting falsy behavior. AddinguseOLSConfigMock.mockReturnValue(false)inbeforeEachremoves this fragility and ensures each test starts with a predictable, documented baseline.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/packages/console-shared/src/components/editor/__tests__/CodeEditorToolbar.spec.tsx` around lines 27 - 31, The tests are order-dependent because useOLSConfigMock's mockReturnValue can leak between tests; update the beforeEach setup (the beforeEach block that currently calls jest.clearAllMocks(), useTranslationMock.mockReturnValue, and useDispatchMock.mockReturnValue) to also set a clear default for useOLSConfigMock by calling useOLSConfigMock.mockReturnValue(false) so each test starts with a predictable falsy OLS config; keep the other mockReturnValue calls (useTranslationMock and useDispatchMock) as-is and ensure mockDispatch remains used for useDispatchMock.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@frontend/packages/console-dynamic-plugin-sdk/release-notes/4.22.md`:
- Line 14: The release note text incorrectly references the package name
"react-thunk"; update that string to "redux-thunk" so the line reads that
plugins must use `redux-thunk` v3 to remain compatible with Console (replace
"react-thunk" with "redux-thunk" in the release note content), ensuring
consistency with package.json/shared-modules-meta.ts and all imports referencing
redux-thunk.
---
Nitpick comments:
In
`@frontend/packages/console-shared/src/components/editor/__tests__/CodeEditorToolbar.spec.tsx`:
- Around line 27-31: The tests are order-dependent because useOLSConfigMock's
mockReturnValue can leak between tests; update the beforeEach setup (the
beforeEach block that currently calls jest.clearAllMocks(),
useTranslationMock.mockReturnValue, and useDispatchMock.mockReturnValue) to also
set a clear default for useOLSConfigMock by calling
useOLSConfigMock.mockReturnValue(false) so each test starts with a predictable
falsy OLS config; keep the other mockReturnValue calls (useTranslationMock and
useDispatchMock) as-is and ensure mockDispatch remains used for useDispatchMock.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
⛔ Files ignored due to path filters (1)
frontend/yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (16)
frontend/package.jsonfrontend/packages/console-app/src/components/detect-namespace/__tests__/namespace.spec.tsfrontend/packages/console-app/src/components/tour/__tests__/tour-context.spec.tsfrontend/packages/console-dynamic-plugin-sdk/release-notes/4.22.mdfrontend/packages/console-dynamic-plugin-sdk/src/utils/k8s/hooks/__tests__/useK8sModels.spec.tsxfrontend/packages/console-dynamic-plugin-sdk/src/utils/k8s/hooks/__tests__/useK8sWatchResource.spec.tsxfrontend/packages/console-dynamic-plugin-sdk/src/utils/k8s/hooks/__tests__/useK8sWatchResources.spec.tsxfrontend/packages/console-shared/src/components/editor/__tests__/CodeEditorToolbar.spec.tsxfrontend/packages/console-shared/src/hooks/__tests__/useGetUserSettingConfigMap.spec.tsfrontend/packages/console-shared/src/hooks/__tests__/useUser.spec.tsfrontend/packages/console-shared/src/hooks/__tests__/useUserPreference.spec.tsfrontend/packages/console-shared/src/test-utils/unit-test-utils.tsxfrontend/packages/dev-console/src/utils/__tests__/usePerspectiveDetection.spec.tsfrontend/packages/knative-plugin/src/components/add/__tests__/EventSink.spec.tsxfrontend/public/components/utils/__tests__/firehose.spec.tsxfrontend/public/redux.ts
frontend/packages/console-dynamic-plugin-sdk/release-notes/4.22.md
Outdated
Show resolved
Hide resolved
dfa923d to
55b9976
Compare
|
/retest-required |
|
@logonoff: This pull request references CONSOLE-4512 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. This pull request references CONSOLE-5073 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@logonoff: This pull request references CONSOLE-4512 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. This pull request references CONSOLE-5073 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
55b9976 to
0e2c33d
Compare
|
@logonoff: This pull request references CONSOLE-4512 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. This pull request references CONSOLE-5073 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
4dca5de to
dd4bece
Compare
47491e4 to
d96ff9e
Compare
Firehose is a class component that uses legacy patterns incompatible with createRoot's concurrent rendering model. The tests rely on synchronous rendering behavior (enzyme mount with act()) that breaks under createRoot. The Firehose component itself still functions at runtime, but the test infrastructure cannot exercise it correctly with createRoot. These tests should be re-enabled when Firehose is either refactored to use hooks or replaced with useK8sWatchResources in the remaining call sites. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
react-redux 9.x warns when selectors return new references on every
call with the same state. Fix selectors that created new objects via
.toJS(), ?? {}, new Date(), object literal returns, or .toObject()
by using createSelector, shallowEqual, useMemo, or module-level
constants as appropriate.
The createSelector memoization in useK8sModels now returns the same
JS object reference when the underlying immutable data hasn't
changed. Update tests to assert stable references instead of
expecting new objects on every render.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d96ff9e to
fbd33c6
Compare
|
@logonoff: This pull request references CONSOLE-5073 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@logonoff: This pull request references CONSOLE-5073 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@logonoff: This pull request references CONSOLE-5073 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/test all |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jhadvig, logonoff The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/assign @yapei Please review this over my other PRs as this one is blocking a major bugfix in monitoring-plugin |
There was a problem hiding this comment.
these tests won't be skipped for long because they will be removed in #16096
| - Upgraded from `react-redux` v7 to v9. Plugins must use `react-redux` v9 to remain compatible with Console. | ||
| - Upgraded from `redux` v4 to v5. Plugins must use `redux` v5 to remain compatible with Console. | ||
| - Upgraded from `redux-thunk` v2 to v3. Plugins must use `redux-thunk` v3 to remain compatible with Console. | ||
| - Upgraded from `react-i18next` v11 to v15. Plugins must use `react-i18next` v15 to remain compatible with Console. |
There was a problem hiding this comment.
line 16 was added in error - will remove in a follow up
|
@yanpzhan will help verify |
|
Regression test on cluster launched against the pr passed. |
|
@yanpzhan: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Overriding the TC due to infra issues. PR is verified by QE. Thank you @yanpzhan /override ci/prow/e2e-gcp-console |
|
@jhadvig: Overrode contexts on behalf of jhadvig: ci/prow/e2e-gcp-console DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@logonoff: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
react-redux8.1.3 -> 9.2.0redux4.0.4 -> 5.0.1redux-thunk2.4.0 -> 3.1.0Removed
redux-mock-storebecause the recommendation is to use a real store: https://redux.js.org/usage/writing-tests