[wip] CONSOLE-4512, CONSOLE-5073: React 18, phase 2#16087
[wip] CONSOLE-4512, CONSOLE-5073: React 18, phase 2#16087logonoff wants to merge 5 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
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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 |
|
@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. |
0e2c33d to
4dca5de
Compare
dd4bece to
287d571
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. |
Replace bare React.lazy() usage with AsyncComponent, which provides its own Suspense boundary and retry logic. The MenuToggle icon was missing a Suspense boundary, causing the lazy-loaded perspective icon to suspend an ancestor boundary and block the entire app content from rendering when concurrent features are enabled via createRoot. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
this allows the blame to be shifted away from "contextProviderExtensions suspense", so we know if it is a contextProviderExtensions suspending or if it is the AppContent as a whole
287d571 to
b2b46dc
Compare
Made-with: Cursor
|
@logonoff: The following test failed, say
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. |
Depends on #15954, #16096, #16183
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-testsSummary by CodeRabbit