Skip to content

Conversation

@krishagarwal278
Copy link
Member

No description provided.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Dec 22, 2025
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Dec 22, 2025

@krishagarwal278: This pull request references CONSOLE-4778 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.

Details

In 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.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 22, 2025
@openshift-ci openshift-ci bot requested review from Leo6Leo and jhadvig December 22, 2025 09:36
@openshift-ci openshift-ci bot added the component/core Related to console core functionality label Dec 22, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 22, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: krishagarwal278
Once this PR has been reviewed and has the lgtm label, please assign spadgett for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@krishagarwal278
Copy link
Member Author

/label docs-approved
/label px-approved

@openshift-ci openshift-ci bot added the component/dev-console Related to dev-console label Dec 22, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 22, 2025

Walkthrough

Bumps React/i18n dependency versions, widens translation-function parameter types and introduces a new TranslationFunction alias, removes some top-level React imports, makes translateExtension return its input, wraps many translated strings in JSX fragments or coerces to string, simplifies test mocks, and moves/removes several locale keys.

Changes

Cohort / File(s) Summary
Dependency updates
dynamic-demo-plugin/package.json, frontend/package.json
Add resolutions for @types/react = 17.0.39; update devDeps/deps: @types/react17.0.39, react/react-dom^17.0.1, bump react-i18next and i18next versions.
Remove top-level React import
dynamic-demo-plugin/src/components/ProjectOverview/Inventory.tsx
Drop explicit React namespace import (rely on new JSX transform).
translateExtension: signature + return
frontend/packages/console-plugin-sdk/src/utils/extension-i18n.ts
Broaden t param to `TFunction
Broaden t types across consumers
frontend/packages/dev-console/src/components/catalog/providers/useConsoleSamples.tsx, frontend/packages/dev-console/src/components/import/import-submit-utils.ts, frontend/public/module/k8s/get-resources.ts
Change parameters typed as TFunction to `TFunction
Hook & typing adjustments
frontend/packages/console-plugin-sdk/src/utils/useTranslationExt.ts
Remove TFunction import, set options to UseTranslationOptions<undefined>, and use an inferred callback (drop explicit TFunction annotation).
VSphere: new TranslationFunction and propagation
frontend/packages/vsphere-plugin/src/components/getVSphereHealth.ts, .../persist.ts, .../utils.ts, .../ClusterOverview/VSphereStatus.tsx, .../VSphereOperatorStatuses.tsx
Add exported TranslationFunction = (key: string, options?: Record<string, unknown>) => string; replace TFunction<'vsphere-plugin'> with TranslationFunction across helpers; add local fallback in VSphereStatus.
TFunction import source & OLM status mapping
frontend/packages/metal3-plugin/src/validations/validations.tsx, frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx, frontend/packages/operator-lifecycle-manager/src/status/csv-status.ts, frontend/packages/topology/src/__tests__/TopologyShortcuts.spec.tsx
Change some TFunction imports from react-i18next to i18next; map CSV statuses to ClusterServiceVersionStatus enum (replace certain string-based i18n status keys).
Wrap translations in JSX fragments / coerce to string
frontend/packages/console-app/src/components/nodes/NodesPage.tsx, frontend/public/components/about-modal.tsx, frontend/public/components/cron-job.tsx, frontend/public/components/custom-resource-definition.tsx, frontend/public/components/error.tsx, frontend/public/components/modals/column-management-modal.tsx, frontend/public/components/modals/configure-count-modal.tsx, frontend/public/components/monitoring/receiver-forms/alert-manager-receiver-forms.tsx, frontend/public/components/pod.tsx
Replace returns of plain translated strings with React fragments (<>...</>) or coerce translation results to String(...) where needed (return types become React nodes in many places).
Tests: mock refactor & type simplification
frontend/packages/console-plugin-sdk/src/utils/__tests__/extension-i18n.spec.ts, frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts, frontend/packages/dev-console/src/components/import/__tests__/import-submit-utils.spec.ts
Replace inline jest.fn() usage with a mockFn variable and alias t = mockFn; remove some TFunction annotations in tests.
Persistence & vsphere helpers signature updates
frontend/packages/vsphere-plugin/src/components/persist.ts, frontend/packages/vsphere-plugin/src/components/utils.ts
Replace TFunction<'vsphere-plugin'> with TranslationFunction in exported helpers and adjust signatures accordingly (type-only changes).
Locale key removals and additions
frontend/packages/operator-lifecycle-manager/locales/en/olm.json, frontend/packages/vsphere-plugin/locales/en/vsphere-plugin.json, frontend/public/locales/en/public.json
Remove several vsphere-plugin and OLM translation keys; add corresponding error/failure-related keys into public.json.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between a4c3403 and db37e00.

⛔ Files ignored due to path filters (1)
  • frontend/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (3)
  • frontend/packages/operator-lifecycle-manager/locales/en/olm.json
  • frontend/packages/vsphere-plugin/locales/en/vsphere-plugin.json
  • frontend/public/locales/en/public.json
💤 Files with no reviewable changes (2)
  • frontend/packages/vsphere-plugin/locales/en/vsphere-plugin.json
  • frontend/packages/operator-lifecycle-manager/locales/en/olm.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/public/locales/en/public.json

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot added component/metal3 Related to metal3-plugin component/monitoring Related to monitoring component/olm Related to OLM docs-approved Signifies that Docs has signed off on this PR component/sdk Related to console-plugin-sdk px-approved Signifies that Product Support has signed off on this PR component/topology Related to topology kind/demo-plugin Related to dynamic-demo-plugin labels Dec 22, 2025
… version

	modified:   dynamic-demo-plugin/package.json
	modified:   dynamic-demo-plugin/src/components/ProjectOverview/Inventory.tsx
	modified:   dynamic-demo-plugin/yarn.lock
	modified:   frontend/package.json
	modified:   frontend/packages/console-app/src/components/nodes/NodesPage.tsx
	modified:   frontend/packages/console-plugin-sdk/src/utils/__tests__/extension-i18n.spec.ts
	modified:   frontend/packages/console-plugin-sdk/src/utils/extension-i18n.ts
	modified:   frontend/packages/console-plugin-sdk/src/utils/useTranslationExt.ts
	modified:   frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts
	modified:   frontend/packages/dev-console/src/components/catalog/providers/useConsoleSamples.tsx
	modified:   frontend/packages/dev-console/src/components/import/__tests__/import-submit-utils.spec.ts
	modified:   frontend/packages/dev-console/src/components/import/import-submit-utils.ts
	modified:   frontend/packages/metal3-plugin/src/validations/validations.tsx
	modified:   frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
	modified:   frontend/packages/operator-lifecycle-manager/src/status/csv-status.ts
	modified:   frontend/packages/topology/src/__tests__/TopologyShortcuts.spec.tsx
	modified:   frontend/packages/vsphere-plugin/src/components/ClusterOverview/VSphereStatus.tsx
	modified:   frontend/packages/vsphere-plugin/src/components/VSphereOperatorStatuses.tsx
	modified:   frontend/packages/vsphere-plugin/src/components/getVSphereHealth.ts
	modified:   frontend/packages/vsphere-plugin/src/components/persist.ts
	modified:   frontend/packages/vsphere-plugin/src/components/utils.ts
	modified:   frontend/public/components/about-modal.tsx
	modified:   frontend/public/components/cron-job.tsx
	modified:   frontend/public/components/custom-resource-definition.tsx
	modified:   frontend/public/components/error.tsx
	modified:   frontend/public/components/modals/column-management-modal.tsx
	modified:   frontend/public/components/modals/configure-count-modal.tsx
	modified:   frontend/public/components/monitoring/receiver-forms/alert-manager-receiver-forms.tsx
	modified:   frontend/public/components/pod.tsx
	modified:   frontend/public/module/k8s/get-resources.ts
	modified:   frontend/yarn.lock
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/packages/vsphere-plugin/src/components/getVSphereHealth.ts (1)

73-77: Missing translation function call on line 76.

Line 76 returns a raw translation key string without calling the t() function, unlike all other branches that properly call t().

🔎 Proposed fix
   const syncErr = getPrometheusMetricValue(prometheusResult, 'SyncError');
   if (toInteger(syncErr?.[1])) {
     // TODO: Add timestamp to the message
-    return { state: HealthState.WARNING, message: 'vsphere-plugin~Synchronization failed' };
+    return { state: HealthState.WARNING, message: t('vsphere-plugin~Synchronization failed') };
   }
🧹 Nitpick comments (1)
frontend/packages/vsphere-plugin/src/components/VSphereOperatorStatuses.tsx (1)

21-21: Consider the implications of using a custom TranslationFunction type.

The PR introduces a custom TranslationFunction type ((key: string, options?: Record<string, unknown>) => string) instead of using react-i18next's TFunction. While this simplifies the type signature, it may lose type safety features that TFunction provides, such as namespace validation or translation key checking. This is acceptable if it's necessary for compatibility with the new library versions, but ensure this trade-off is intentional.

Based on the library upgrade context in this PR.

Also applies to: 50-50

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between df5acf5 and 50ae957.

⛔ Files ignored due to path filters (2)
  • dynamic-demo-plugin/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
  • frontend/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (29)
  • dynamic-demo-plugin/package.json
  • dynamic-demo-plugin/src/components/ProjectOverview/Inventory.tsx
  • frontend/package.json
  • frontend/packages/console-app/src/components/nodes/NodesPage.tsx
  • frontend/packages/console-plugin-sdk/src/utils/__tests__/extension-i18n.spec.ts
  • frontend/packages/console-plugin-sdk/src/utils/extension-i18n.ts
  • frontend/packages/console-plugin-sdk/src/utils/useTranslationExt.ts
  • frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts
  • frontend/packages/dev-console/src/components/catalog/providers/useConsoleSamples.tsx
  • frontend/packages/dev-console/src/components/import/__tests__/import-submit-utils.spec.ts
  • frontend/packages/dev-console/src/components/import/import-submit-utils.ts
  • frontend/packages/metal3-plugin/src/validations/validations.tsx
  • frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
  • frontend/packages/operator-lifecycle-manager/src/status/csv-status.ts
  • frontend/packages/topology/src/__tests__/TopologyShortcuts.spec.tsx
  • frontend/packages/vsphere-plugin/src/components/ClusterOverview/VSphereStatus.tsx
  • frontend/packages/vsphere-plugin/src/components/VSphereOperatorStatuses.tsx
  • frontend/packages/vsphere-plugin/src/components/getVSphereHealth.ts
  • frontend/packages/vsphere-plugin/src/components/persist.ts
  • frontend/packages/vsphere-plugin/src/components/utils.ts
  • frontend/public/components/about-modal.tsx
  • frontend/public/components/cron-job.tsx
  • frontend/public/components/custom-resource-definition.tsx
  • frontend/public/components/error.tsx
  • frontend/public/components/modals/column-management-modal.tsx
  • frontend/public/components/modals/configure-count-modal.tsx
  • frontend/public/components/monitoring/receiver-forms/alert-manager-receiver-forms.tsx
  • frontend/public/components/pod.tsx
  • frontend/public/module/k8s/get-resources.ts
💤 Files with no reviewable changes (1)
  • dynamic-demo-plugin/src/components/ProjectOverview/Inventory.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • frontend/package.json
  • frontend/packages/dev-console/src/components/import/import-submit-utils.ts
  • frontend/public/components/pod.tsx
  • frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
  • frontend/packages/console-plugin-sdk/src/utils/extension-i18n.ts
  • frontend/packages/vsphere-plugin/src/components/getVSphereHealth.ts
  • frontend/public/components/modals/configure-count-modal.tsx
  • frontend/public/components/modals/column-management-modal.tsx
  • frontend/packages/console-plugin-sdk/src/utils/useTranslationExt.ts
  • frontend/packages/dev-console/src/components/catalog/providers/useConsoleSamples.tsx
  • frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts
  • frontend/packages/metal3-plugin/src/validations/validations.tsx
  • frontend/packages/console-app/src/components/nodes/NodesPage.tsx
  • frontend/packages/console-plugin-sdk/src/utils/__tests__/extension-i18n.spec.ts
  • frontend/packages/vsphere-plugin/src/components/utils.ts
  • frontend/public/components/error.tsx
  • frontend/packages/vsphere-plugin/src/components/ClusterOverview/VSphereStatus.tsx
  • dynamic-demo-plugin/package.json
  • frontend/packages/vsphere-plugin/src/components/persist.ts
  • frontend/packages/operator-lifecycle-manager/src/status/csv-status.ts
  • frontend/packages/dev-console/src/components/import/__tests__/import-submit-utils.spec.ts
  • frontend/packages/topology/src/__tests__/TopologyShortcuts.spec.tsx
  • frontend/public/module/k8s/get-resources.ts
  • frontend/public/components/cron-job.tsx
  • frontend/public/components/about-modal.tsx
  • frontend/packages/vsphere-plugin/src/components/VSphereOperatorStatuses.tsx
  • frontend/public/components/monitoring/receiver-forms/alert-manager-receiver-forms.tsx
  • frontend/public/components/custom-resource-definition.tsx
🧬 Code graph analysis (16)
frontend/packages/dev-console/src/components/import/import-submit-utils.ts (1)
frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts (1)
  • t (6-7)
frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx (1)
frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts (1)
  • t (6-7)
frontend/packages/console-plugin-sdk/src/utils/extension-i18n.ts (2)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (2)
  • Extension (12-12)
  • Extension (29-33)
frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts (1)
  • t (6-7)
frontend/packages/vsphere-plugin/src/components/getVSphereHealth.ts (1)
frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts (1)
  • t (6-7)
frontend/public/components/modals/configure-count-modal.tsx (1)
frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts (1)
  • t (6-7)
frontend/public/components/modals/column-management-modal.tsx (1)
frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts (1)
  • t (6-7)
frontend/packages/dev-console/src/components/catalog/providers/useConsoleSamples.tsx (1)
frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts (1)
  • t (6-7)
frontend/packages/console-app/src/components/nodes/NodesPage.tsx (1)
frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts (1)
  • t (6-7)
frontend/packages/vsphere-plugin/src/components/utils.ts (1)
frontend/packages/vsphere-plugin/src/components/getVSphereHealth.ts (1)
  • TranslationFunction (11-11)
frontend/public/components/error.tsx (3)
frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts (1)
  • t (6-7)
frontend/public/components/namespace.jsx (1)
  • error (857-857)
frontend/public/components/events.jsx (1)
  • error (386-386)
frontend/packages/vsphere-plugin/src/components/persist.ts (2)
frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts (1)
  • t (6-7)
frontend/packages/vsphere-plugin/src/components/getVSphereHealth.ts (1)
  • TranslationFunction (11-11)
frontend/packages/dev-console/src/components/import/__tests__/import-submit-utils.spec.ts (1)
frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts (1)
  • t (6-7)
frontend/public/components/cron-job.tsx (1)
frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts (1)
  • t (6-7)
frontend/public/components/about-modal.tsx (1)
frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts (1)
  • t (6-7)
frontend/packages/vsphere-plugin/src/components/VSphereOperatorStatuses.tsx (1)
frontend/packages/vsphere-plugin/src/components/getVSphereHealth.ts (1)
  • TranslationFunction (11-11)
frontend/public/components/monitoring/receiver-forms/alert-manager-receiver-forms.tsx (1)
frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts (1)
  • t (6-7)
🔇 Additional comments (24)
frontend/packages/console-app/src/components/nodes/NodesPage.tsx (1)

272-277: LGTM! Translation wrapped in fragment for type consistency.

The change correctly wraps the translation result in a React fragment, ensuring consistent React node output. This aligns with the i18next/react-i18next version update and maintains the same functional behavior while providing better type safety.

frontend/packages/topology/src/__tests__/TopologyShortcuts.spec.tsx (1)

2-2: LGTM! Clean migration to import TFunction directly from i18next.

Importing the TFunction type directly from i18next rather than the react-i18next re-export is correct and aligns with the PR's objective to update these dependencies.

frontend/public/components/modals/configure-count-modal.tsx (1)

73-76: LGTM! Type-safe string coercion for updated i18next.

The explicit String() coercion ensures resourceKinds remains a string type, aligning with the Record<string, string> type expectation for messageVariables. This is a sound defensive practice given the updated react-i18next version (15.1.4), which may return broader types from the translation function.

frontend/public/module/k8s/get-resources.ts (2)

3-3: LGTM: Import simplified to align with updated i18next usage.

The removal of the TFunction type import is consistent with the PR's objective to update i18next and simplify type dependencies.


106-107: No type compatibility issues after removing the TFunction annotation.

The translateExtension function explicitly accepts TFunction | ((key: string) => string) as its second parameter (line 32 of extension-i18n.ts). The inferred type of tcb as (value: string) => string matches this union type and is fully compatible. The removal of the explicit annotation is type-safe.

Likely an incorrect or invalid review comment.

frontend/packages/metal3-plugin/src/validations/validations.tsx (1)

1-1: This import change is consistent with the established codebase pattern and poses no type compatibility issues.

The import from i18next is used across 20+ files throughout the codebase, and TFunction<'metal3-plugin'> is working correctly in this file. Type compatibility with i18next v23.16.8 is confirmed.

frontend/packages/operator-lifecycle-manager/src/status/csv-status.ts (1)

44-59: No actionable issues found.

The code correctly uses ClusterServiceVersionStatus enum values, and the single consumer (getOperatorStatus) is properly designed to handle these enum-based status values with appropriate switch logic. There is no breaking change—the consumer is not expecting translated strings in the status field and is already correctly mapping enum values to HealthState for downstream processing.

Likely an incorrect or invalid review comment.

frontend/packages/dev-console/src/components/import/__tests__/import-submit-utils.spec.ts (1)

35-36: LGTM! Test mock updated to align with production code type change.

The indirection through mockFn properly accommodates the widened t parameter type in import-submit-utils.ts (line 773), where it changed from TFunction to TFunction | ((key: string) => string).

frontend/public/components/custom-resource-definition.tsx (1)

281-284: LGTM! Fragment wrapper aligns with PR-wide pattern.

Wrapping the translated conditional in a React fragment changes the return type from string to ReactNode while preserving the rendered output. This aligns with the broader pattern adopted throughout the codebase for translation outputs.

frontend/public/components/modals/column-management-modal.tsx (1)

67-70: LGTM! Fragment wrapper consistent with PR pattern.

The fragment wrapper changes the return type from string to ReactNode while preserving the displayed text. This is consistent with the translation output pattern adopted throughout the codebase.

frontend/public/components/about-modal.tsx (1)

56-62: LGTM! Fragment wrapper maintains consistency.

The fragment wrapper around the fallback text aligns with the PR-wide pattern for translation outputs, changing the return type from string to ReactNode while preserving functionality.

frontend/public/components/monitoring/receiver-forms/alert-manager-receiver-forms.tsx (1)

161-191: LGTM! All return paths consistently use fragment wrappers.

All switch cases and the default fallback now return React fragments wrapping the translated text. This maintains consistency with the PR-wide pattern while preserving all functionality and display text.

frontend/public/components/cron-job.tsx (1)

88-91: LGTM! Fragment wrapper consistent with PR pattern.

The fragment wrapper around the conditional translation maintains the pattern adopted throughout the codebase, changing the return type from string to ReactNode while preserving the boolean display logic.

frontend/packages/dev-console/src/components/import/import-submit-utils.ts (1)

772-780: No issues identified. The type widening of the t parameter from TFunction to TFunction | ((key: string) => string) is backward compatible. All callers pass t from the useTranslation() hook (which returns TFunction), and tests mock it as jest.fn(), both of which are compatible with the wider union type. The single usage of t() within the function body works correctly with both types in the union.

frontend/package.json (1)

197-197: No action required. react-i18next@15.1.4 is compatible with react ^17.0.1 and i18next ^23.16.8, has no security vulnerabilities, and the codebase usage relies on stable APIs that are compatible with this version.

frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts (1)

6-7: LGTM! Test mock aligns with broadened type signature.

The simplified mock function type correctly reflects the production code's acceptance of both TFunction and plain string-mapping functions.

frontend/packages/dev-console/src/components/catalog/providers/useConsoleSamples.tsx (1)

15-18: LGTM! Type broadening supports flexible translation function usage.

The updated signature accepts both TFunction from i18next and plain string-mapping functions, enabling easier testing while maintaining production compatibility.

frontend/packages/vsphere-plugin/src/components/getVSphereHealth.ts (1)

11-12: LGTM! Custom translation type simplifies interface.

The TranslationFunction type provides a cleaner interface while supporting both key-only and key-with-options translation patterns.

frontend/packages/console-plugin-sdk/src/utils/extension-i18n.ts (1)

30-39: LGTM! API enhancement enables fluent usage and type flexibility.

The updated signature accepts both TFunction and plain string-mapping functions, and returning the extension enables method chaining. This is a backward-compatible improvement.

frontend/packages/console-plugin-sdk/src/utils/__tests__/extension-i18n.spec.ts (1)

46-80: LGTM! Tests correctly updated for new API.

The test properly validates:

  1. The broadened translation function type via mockFn alias
  2. The fluent API by checking return values
  3. Translation behavior remains unchanged
frontend/public/components/error.tsx (1)

95-122: Fragment wrapping is required for type compatibility with React.FC.

The LoginErrorMessage component is typed as React.FC, which requires a JSX.Element return type. Since t() from react-i18next v15.1.4 returns a string, the fragments (<>{t(...)}</>) are necessary to convert the string result to JSX. Removing them would cause TypeScript type errors. This is not unnecessary overhead but a required type safety measure.

Likely an incorrect or invalid review comment.

dynamic-demo-plugin/package.json (1)

37-37: Expand verification scope for react-i18next: upgrade path is v11→v23, not v11→v15.

The react-i18next upgrade to v15.1.4 is accompanied by i18next v23.16.8, spanning 12 major versions rather than 4. Breaking changes across v11→v23 are more extensive than v11→v15 alone.

Current state:

  • Promise-based API (v13+ breaking change) is correctly implemented: i18n.init({...}).then(...).catch(...)
  • Modern APIs only: useTranslation hooks and Trans component throughout; no deprecated withTranslation HOC
  • useSuspense and fragment-wrapping are configured

Verify:

  1. TypeScript type augmentation moved to i18next package (v14→v15 change) — confirm in tsconfig/type declarations
  2. returnNull default behavior (changed to false in later versions) — confirm expected null-return behavior not relied upon
  3. The "fragment-wrapping pattern" mentioned in the original review—this term does not appear in official migration docs; clarify if this refers to React 18 Suspense boundaries or a different pattern
frontend/packages/vsphere-plugin/src/components/ClusterOverview/VSphereStatus.tsx (1)

57-58: LGTM! Improved fallback translation function.

The fallback translation function now returns the key itself instead of an empty string, which is better for debugging and provides a meaningful fallback when the translation function is unavailable.

frontend/packages/console-plugin-sdk/src/utils/useTranslationExt.ts (1)

11-18: This is a new file, not a modification of existing code, so the concern about "removal of explicit TFunction typing" is invalid.

The file useTranslationExt.ts was created as part of this commit (not modified from a prior version). The type design using UseTranslationOptions<undefined> is intentional and aligns with react-i18next v15.1.4 behavior—when no namespace is explicitly supplied, the library uses the configured default namespace and falls back to undefined for generic inference. All existing usages in useTranslatedExtensions.ts and tests in useTranslationExt.spec.ts pass without type errors, confirming that the callback type inference works correctly. No compatibility issues exist.

Likely an incorrect or invalid review comment.

@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 22, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
frontend/packages/dev-console/src/components/import/import-submit-utils.ts (1)

781-781: Consider aligning with TranslationFunction type for consistency.

The union type TFunction | ((key: string) => string) differs from the TranslationFunction type introduced in other parts of this PR (e.g., getVSphereHealth.ts). The TranslationFunction type includes an optional options parameter: (key: string, options?: Record<string, unknown>) => string, which provides better alignment with i18next's actual usage patterns.

While the current usage in this file (line 825) doesn't require the options parameter, standardizing on TranslationFunction would improve consistency and future-proof the signature.

🔎 Suggested alignment
-  t: TFunction | ((key: string) => string),
+  t: TFunction | TranslationFunction,

And add the import at the top:

import { TranslationFunction } from '@console/vsphere-plugin/src/components/getVSphereHealth';

Or define it locally if cross-package imports aren't desired.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 50ae957 and 0b2b36a.

⛔ Files ignored due to path filters (2)
  • dynamic-demo-plugin/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
  • frontend/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (29)
  • dynamic-demo-plugin/package.json
  • dynamic-demo-plugin/src/components/ProjectOverview/Inventory.tsx
  • frontend/package.json
  • frontend/packages/console-app/src/components/nodes/NodesPage.tsx
  • frontend/packages/console-plugin-sdk/src/utils/__tests__/extension-i18n.spec.ts
  • frontend/packages/console-plugin-sdk/src/utils/extension-i18n.ts
  • frontend/packages/console-plugin-sdk/src/utils/useTranslationExt.ts
  • frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts
  • frontend/packages/dev-console/src/components/catalog/providers/useConsoleSamples.tsx
  • frontend/packages/dev-console/src/components/import/__tests__/import-submit-utils.spec.ts
  • frontend/packages/dev-console/src/components/import/import-submit-utils.ts
  • frontend/packages/metal3-plugin/src/validations/validations.tsx
  • frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
  • frontend/packages/operator-lifecycle-manager/src/status/csv-status.ts
  • frontend/packages/topology/src/__tests__/TopologyShortcuts.spec.tsx
  • frontend/packages/vsphere-plugin/src/components/ClusterOverview/VSphereStatus.tsx
  • frontend/packages/vsphere-plugin/src/components/VSphereOperatorStatuses.tsx
  • frontend/packages/vsphere-plugin/src/components/getVSphereHealth.ts
  • frontend/packages/vsphere-plugin/src/components/persist.ts
  • frontend/packages/vsphere-plugin/src/components/utils.ts
  • frontend/public/components/about-modal.tsx
  • frontend/public/components/cron-job.tsx
  • frontend/public/components/custom-resource-definition.tsx
  • frontend/public/components/error.tsx
  • frontend/public/components/modals/column-management-modal.tsx
  • frontend/public/components/modals/configure-count-modal.tsx
  • frontend/public/components/monitoring/receiver-forms/alert-manager-receiver-forms.tsx
  • frontend/public/components/pod.tsx
  • frontend/public/module/k8s/get-resources.ts
💤 Files with no reviewable changes (1)
  • dynamic-demo-plugin/src/components/ProjectOverview/Inventory.tsx
🚧 Files skipped from review as they are similar to previous changes (22)
  • frontend/public/components/monitoring/receiver-forms/alert-manager-receiver-forms.tsx
  • frontend/packages/operator-lifecycle-manager/src/components/clusterserviceversion.tsx
  • frontend/packages/console-plugin-sdk/src/utils/useTranslationExt.ts
  • dynamic-demo-plugin/package.json
  • frontend/public/components/modals/configure-count-modal.tsx
  • frontend/public/components/custom-resource-definition.tsx
  • frontend/packages/operator-lifecycle-manager/src/status/csv-status.ts
  • frontend/public/components/about-modal.tsx
  • frontend/packages/vsphere-plugin/src/components/utils.ts
  • frontend/public/components/cron-job.tsx
  • frontend/packages/metal3-plugin/src/validations/validations.tsx
  • frontend/packages/console-plugin-sdk/src/utils/tests/extension-i18n.spec.ts
  • frontend/packages/dev-console/src/components/catalog/providers/useConsoleSamples.tsx
  • frontend/public/module/k8s/get-resources.ts
  • frontend/packages/console-plugin-sdk/src/utils/extension-i18n.ts
  • frontend/public/components/modals/column-management-modal.tsx
  • frontend/packages/dev-console/src/components/import/tests/import-submit-utils.spec.ts
  • frontend/public/components/pod.tsx
  • frontend/packages/vsphere-plugin/src/components/VSphereOperatorStatuses.tsx
  • frontend/packages/topology/src/tests/TopologyShortcuts.spec.tsx
  • frontend/packages/dev-console/src/components/catalog/providers/tests/useConsoleSamples.spec.ts
  • frontend/packages/console-app/src/components/nodes/NodesPage.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • frontend/packages/vsphere-plugin/src/components/persist.ts
  • frontend/public/components/error.tsx
  • frontend/packages/dev-console/src/components/import/import-submit-utils.ts
  • frontend/package.json
  • frontend/packages/vsphere-plugin/src/components/getVSphereHealth.ts
  • frontend/packages/vsphere-plugin/src/components/ClusterOverview/VSphereStatus.tsx
🧬 Code graph analysis (4)
frontend/packages/vsphere-plugin/src/components/persist.ts (1)
frontend/packages/vsphere-plugin/src/components/getVSphereHealth.ts (1)
  • TranslationFunction (11-11)
frontend/public/components/error.tsx (3)
frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts (1)
  • t (6-7)
frontend/public/components/events.jsx (1)
  • error (386-386)
frontend/public/components/namespace.jsx (1)
  • error (857-857)
frontend/packages/dev-console/src/components/import/import-submit-utils.ts (1)
frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts (1)
  • t (6-7)
frontend/packages/vsphere-plugin/src/components/getVSphereHealth.ts (1)
frontend/packages/dev-console/src/components/catalog/providers/__tests__/useConsoleSamples.spec.ts (1)
  • t (6-7)
🔇 Additional comments (4)
frontend/packages/vsphere-plugin/src/components/ClusterOverview/VSphereStatus.tsx (1)

57-58: LGTM! Good defensive fallback pattern.

The fallback translation function ensures getVSphereHealth always receives a valid translation function, even when t is undefined. The identity function (key: string) => key is a sensible fallback that returns the untranslated key.

frontend/packages/vsphere-plugin/src/components/persist.ts (1)

17-17: LGTM! Consistent adoption of TranslationFunction type.

The migration from TFunction<'vsphere-plugin'> to TranslationFunction is applied consistently across all function signatures in this file. The usage patterns throughout the file (including interpolation with options) are fully compatible with the TranslationFunction signature.

Also applies to: 95-95, 132-132, 252-252, 363-363, 554-554, 602-602

frontend/package.json (2)

180-180: i18next upgrade looks properly addressed. The breaking changes from v21 → v23 were comprehensively handled across the codebase (per TranslationFunction type updates and test refactoring), and version 23.16.8 exists with no reported security vulnerabilities. TypeScript 5.7.2 satisfies the v23 requirement for TS v5.


205-205: This upgrade is compatible with React 17.0.1 — no action required.

react-i18next 15.1.4 has peer dependency react >= 16.8.0, and your current React 17.0.1 satisfies this. The i18next dependency (>= 23.2.3) is also met by your pinned version 23.16.8. There are no known security vulnerabilities for v15.1.4, and no breaking changes affecting JavaScript usage with React 17.

Comment on lines +11 to +12
export type TranslationFunction = (key: string, options?: Record<string, unknown>) => string;

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cat -n frontend/packages/vsphere-plugin/src/components/getVSphereHealth.ts

Repository: openshift/console

Length of output: 3712


🏁 Script executed:

rg -nP --type=ts --type=tsx -C3 'getVSphereHealth\s*\(' -g '!*.spec.ts' -g '!*.test.ts'

Repository: openshift/console

Length of output: 88


🏁 Script executed:

rg -nP --type=ts -C3 'getVSphereHealth\s*\(' -g '!*.spec.ts' -g '!*.test.ts'

Repository: openshift/console

Length of output: 1848


🏁 Script executed:

cat -n frontend/packages/vsphere-plugin/src/components/ClusterOverview/VSphereStatus.tsx

Repository: openshift/console

Length of output: 2823


Type abstraction is well-designed and consumers are compatible. The TranslationFunction type successfully abstracts the translation interface, improving testability as shown by the fallback implementation in healthHandler. All consumers pass compatible signatures.

However, fix missing translation wrapper at line 76: the message 'vsphere-plugin~Synchronization failed' should be wrapped with t() to match the pattern used elsewhere in the function and ensure proper translation:

message: t('vsphere-plugin~Synchronization failed')
🤖 Prompt for AI Agents
In frontend/packages/vsphere-plugin/src/components/getVSphereHealth.ts around
lines 11 and 76, the TranslationFunction type is fine but at line 76 the error
message string 'vsphere-plugin~Synchronization failed' is not wrapped with the
translation function; update that message to call
t('vsphere-plugin~Synchronization failed') so it follows the established pattern
and returns a translated string consistent with the rest of the function.

@openshift-ci openshift-ci bot added the kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated label Dec 22, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
frontend/public/locales/en/public.json (1)

1779-1787: Improve consistency and clarity of new error messages.

The new localization entries could benefit from the following improvements:

  1. Resource name formatting (Lines 1779, 1783): "kubecontrollermanager" should follow Kubernetes naming conventions. Consider using "KubeControllerManager" or "kube-controller-manager" to match the API resource format and improve readability.

  2. Placeholder spacing inconsistency (Line 1781): The placeholder {{ expectedValues }} has spaces around the variable, while line 1780 uses {{cm}} without spaces. Standardize spacing for consistency—existing patterns in the file predominantly use no spaces (e.g., line 1780).

  3. Generic error message (Line 1787): "Unexpected error" provides minimal context. Consider making it more descriptive or specific to the operation that failed to aid user troubleshooting.

  4. Capitalization alignment: Line 1781 uses "configMap" while existing patterns capitalize resource types (e.g., line 523: "ConfigMaps"). Consider "ConfigMap" for consistency.

🔎 Suggested improvements
-  "Failed to load kubecontrollermanager": "Failed to load kubecontrollermanager",
+  "Failed to load kubecontrollermanager": "Failed to load KubeControllerManager",
   "Failed to parse cloud provider config {{cm}}": "Failed to parse cloud provider config {{cm}}",
-  "The following content was expected to be defined in the configMap: {{ expectedValues }}": "The following content was expected to be defined in the configMap: {{ expectedValues }}",
+  "The following content was expected to be defined in the configMap: {{expectedValues}}": "The following content was expected to be defined in the ConfigMap: {{expectedValues}}",
   "Failed to persist {{secret}}": "Failed to persist {{secret}}",
-  "Failed to patch kubecontrollermanager": "Failed to patch kubecontrollermanager",
+  "Failed to patch kubecontrollermanager": "Failed to patch KubeControllerManager",
   "Failed to patch cloud provider config": "Failed to patch cloud provider config",
   "Failed to add taint to nodes": "Failed to add taint to nodes",
   "Failed to patch infrastructure spec": "Failed to patch infrastructure spec",
-  "Unexpected error": "Unexpected error",
+  "Unexpected error": "An unexpected error occurred",
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 0b2b36a and 541460d.

📒 Files selected for processing (3)
  • frontend/packages/operator-lifecycle-manager/locales/en/olm.json
  • frontend/packages/vsphere-plugin/locales/en/vsphere-plugin.json
  • frontend/public/locales/en/public.json
💤 Files with no reviewable changes (2)
  • frontend/packages/operator-lifecycle-manager/locales/en/olm.json
  • frontend/packages/vsphere-plugin/locales/en/vsphere-plugin.json
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • frontend/public/locales/en/public.json

@jhadvig
Copy link
Member

jhadvig commented Dec 23, 2025

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 23, 2025

@krishagarwal278: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-console db37e00 link true /test e2e-gcp-console
ci/prow/okd-scos-images db37e00 link true /test okd-scos-images

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/core Related to console core functionality component/dev-console Related to dev-console component/metal3 Related to metal3-plugin component/monitoring Related to monitoring component/olm Related to OLM component/sdk Related to console-plugin-sdk component/topology Related to topology docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/demo-plugin Related to dynamic-demo-plugin kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated px-approved Signifies that Product Support has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants