Skip to content

Conversation

@logonoff
Copy link
Member

  • Our DynamicPluginInfo.status changed to lowercase to align with SDK PluginInfoEntry.status
  • Our allPluginsProcessed removed from usePluginInfo to align with SDK usePluginInfo
  • LSO i18n namespace removed as static plugin was removed
  • i18nNamespaces removed from PluginStore to align with SDK PluginStore
  • isLoadedDynamicPluginInfo and isNotLoadedDynamicPluginInfo removed to decrease dependence on @console/plugin-sdk

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

openshift-ci-robot commented Nov 18, 2025

@logonoff: This pull request references CONSOLE-3769 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 either version "4.21." or "openshift-4.21.", but it targets "openshift-4.15" instead.

In response to this:

  • Our DynamicPluginInfo.status changed to lowercase to align with SDK PluginInfoEntry.status
  • Our allPluginsProcessed removed from usePluginInfo to align with SDK usePluginInfo
  • LSO i18n namespace removed as static plugin was removed
  • i18nNamespaces removed from PluginStore to align with SDK PluginStore
  • isLoadedDynamicPluginInfo and isNotLoadedDynamicPluginInfo removed to decrease dependence on @console/plugin-sdk

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-ci openshift-ci bot requested review from Leo6Leo and rhamilto November 18, 2025 14:29
@logonoff
Copy link
Member Author

/label px-approved
/label docs-approved

@openshift-ci openshift-ci bot added component/core Related to console core functionality component/sdk Related to console-plugin-sdk approved Indicates a PR has been approved by an approver from all required OWNERS files. px-approved Signifies that Product Support has signed off on this PR docs-approved Signifies that Docs has signed off on this PR labels Nov 18, 2025
@logonoff logonoff force-pushed the CONSOLE-3769-s2e22-casino-night branch 2 times, most recently from 23217fa to 3840f6e Compare November 18, 2025 15:19
@coderabbitai
Copy link

coderabbitai bot commented Nov 18, 2025

Walkthrough

Normalized dynamic plugin status strings to lowercase, changed usePluginInfo to return an array (no tuple/boolean), removed predicate helpers and i18nNamespaces from PluginStore, updated public typings and call sites, and aligned tests and UI code to the new shapes and status literals.

Changes

Cohort / File(s) Summary
Core Plugin SDK API & Store
frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts, frontend/packages/console-plugin-sdk/src/store.ts
usePluginInfo now returns DynamicPluginInfo[] (removed tuple/boolean). Status literals normalized to lowercase (`'loaded'
Console operator UI & types
frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx, .../ConsolePluginDescriptionDetail.tsx, .../ConsolePluginEnabledStatusDetail.tsx, .../ConsolePluginStatusDetail.tsx, .../ConsolePluginVersionDetail.tsx, .../ConsolePluginsTable.tsx
Switched from tuple destructuring to direct usePluginInfo() array. Rewrote predicates to check entry.status === 'loaded' / 'failed' / 'pending'. Updated props/types to use PluginInfoEntry['status'] and removed loaded prop; tables render unconditionally (removed loading branch). Error/title checks now use 'failed'. Added PluginInfoEntry imports for typings.
Dashboard health & status mapping
frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/DynamicPluginsPopover.tsx, .../status.ts
Replaced predicate-based filters with direct status comparisons ('loaded', 'failed', 'pending'). Health-state mapping preserved; status string literals lowercased.
CSP & hooks
frontend/packages/console-app/src/hooks/useCSPViolationDetector.tsx
Replaced helper import/usage with direct entry.status === 'loaded' checks and lowercase status comparisons; logic otherwise unchanged.
Public UI consumers
frontend/public/components/about-modal.tsx, frontend/public/components/app-contents.tsx, frontend/public/components/notification-drawer.tsx
Updated usePluginInfo consumption from tuple to single array. Replaced predicate filters with `plugin.status === 'loaded'
Runtime plugin dependencies & tests
frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-dependencies.ts, frontend/packages/console-dynamic-plugin-sdk/src/runtime/__tests__/plugin-dependencies.spec.ts, frontend/packages/console-plugin-sdk/src/__tests__/store.spec.ts
Dependency resolution and test helpers updated to emit/expect lowercase status strings. Tests updated from capitalized to lowercase status values.
Public i18n & plugin initialization
frontend/public/i18n.js, frontend/public/plugins.ts
Removed PluginStore-driven i18n namespace aggregation. PluginStore constructed with two args (activePlugins, dynamicPluginNames). Replaced plugin-derived namespaces with window.SERVER_FLAGS.i18nNamespaces deduplicated via Set. Removed getI18nNamespaces and related variables.
Console app components (other)
frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx, .../ConsolePluginsTable.tsx
Public props for plugin tables updated to drop loaded flag; status handling and error mapping use lowercase 'failed'. Loading paths removed so tables render with provided rows.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

  • Areas needing extra attention:
    • All call sites of usePluginInfo() for tuple→array migration and any remaining destructuring.
    • Removal of isLoadedDynamicPluginInfo / isNotLoadedDynamicPluginInfo: ensure no residual references and semantics preserved where predicates were used.
    • Consistency of status comparisons across code and tests (no remaining capitalized literals).
    • Public typing changes (use of PluginInfoEntry['status']) and files importing PluginInfoEntry.
    • i18n migration: confirm window.SERVER_FLAGS.i18nNamespaces presence and deduplication behavior.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit 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 4304f21 and a53ba4e.

📒 Files selected for processing (18)
  • frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx (10 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginDescriptionDetail.tsx (1 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginEnabledStatusDetail.tsx (2 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginStatusDetail.tsx (2 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginVersionDetail.tsx (1 hunks)
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/DynamicPluginsPopover.tsx (1 hunks)
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/status.ts (1 hunks)
  • frontend/packages/console-app/src/hooks/useCSPViolationDetector.tsx (1 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/__tests__/plugin-dependencies.spec.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-dependencies.ts (1 hunks)
  • frontend/packages/console-plugin-sdk/src/__tests__/store.spec.ts (6 hunks)
  • frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts (3 hunks)
  • frontend/packages/console-plugin-sdk/src/store.ts (5 hunks)
  • frontend/public/components/about-modal.tsx (1 hunks)
  • frontend/public/components/app-contents.tsx (1 hunks)
  • frontend/public/components/notification-drawer.tsx (3 hunks)
  • frontend/public/i18n.js (1 hunks)
  • frontend/public/plugins.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (15)
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/status.ts
  • frontend/packages/console-plugin-sdk/src/tests/store.spec.ts
  • frontend/public/plugins.ts
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginVersionDetail.tsx
  • frontend/packages/console-app/src/hooks/useCSPViolationDetector.tsx
  • frontend/public/components/about-modal.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginEnabledStatusDetail.tsx
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/DynamicPluginsPopover.tsx
  • frontend/public/i18n.js
  • frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts
  • frontend/public/components/notification-drawer.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginStatusDetail.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-dependencies.ts
  • frontend/public/components/app-contents.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/tests/plugin-dependencies.spec.ts
🧰 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/console-plugin-sdk/src/store.ts
  • frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginDescriptionDetail.tsx
🔇 Additional comments (9)
frontend/packages/console-app/src/components/console-operator/ConsolePluginDescriptionDetail.tsx (2)

9-18: LGTM! Status normalization applied correctly.

The change from usePluginInfo() returning a tuple to returning a direct array is handled correctly, and the status checks now use lowercase 'loaded' consistently. The conditional logic correctly differentiates between loaded plugins (using metadata.name) and not-loaded plugins (using pluginName).


20-21: LGTM! Direct status check replaces helper function.

The change from isLoadedDynamicPluginInfo(pluginInfo) to pluginInfo?.status === 'loaded' is correct and aligns with the PR objective to reduce dependence on helper functions.

frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx (4)

158-294: LGTM! Removal of loading state improves UX.

The removal of the loaded prop from ConsolePluginsTable means the table now renders plugin information immediately regardless of plugin loading state, which is a better user experience than waiting for all plugins to finish loading. The table correctly displays both loaded and not-loaded plugins with their appropriate status.


297-316: LGTM! Status-based filtering applied correctly.

The DevPluginsPage correctly filters for loaded plugins using plugin.status === 'loaded' and maps their properties appropriately. The change from tuple destructuring to direct array usage for usePluginInfo() is handled correctly.


320-368: LGTM! Comprehensive plugin status handling.

The PluginsPage correctly handles both loaded and not-loaded plugins:

  • Filters loaded plugins with p.status === 'loaded' (line 339)
  • Filters not-loaded plugins with p.status !== 'loaded' (line 342)
  • Error messages and causes are correctly extracted only when status === 'failed' (lines 359, 361)

The logic properly differentiates between loaded plugins (which have metadata) and not-loaded plugins (which may have error details).


93-93: LGTM! Lowercase status check for error display.

The status check now uses lowercase 'failed' consistently with the SDK normalization.

frontend/packages/console-plugin-sdk/src/store.ts (3)

70-82: LGTM! Simplified constructor signature.

The removal of the i18nNamespaces parameter aligns with the PR objective to remove i18nNamespaces from PluginStore. The constructor now has a cleaner signature: constructor(staticPlugins: ActivePlugin[] = [], allowedDynamicPluginNames: string[] = []).


226-267: LGTM! Status normalization applied consistently.

The getPluginInfo() method now uses lowercase status literals:

  • 'loaded' for successfully loaded plugins (line 230)
  • 'failed' for plugins that failed to load (line 243)
  • 'pending' for plugins not yet processed (line 260)

This normalization is consistent with the SDK PluginInfoEntry.status type and is applied uniformly across all plugin states.


311-329: LGTM! Type definitions use lowercase status literals.

The type definitions correctly specify lowercase status literals:

  • LoadedDynamicPluginInfo uses status: 'loaded' (line 312)
  • NotLoadedDynamicPluginInfo discriminated union uses status: 'pending' (line 320) and status: 'failed' (line 324)

This ensures type safety for status checks throughout the codebase.


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

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 (3)
frontend/public/components/notification-drawer.tsx (1)

165-165: Consider adding optional chaining for consistency.

While the filter at line 165 uses plugin.status === 'failed', other files in this PR use optional chaining (plugin?.status). For consistency and defensive coding, consider:

-  const failedPlugins = pluginInfoEntries.filter((plugin) => plugin.status === 'failed');
+  const failedPlugins = pluginInfoEntries.filter((plugin) => plugin?.status === 'failed');
frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/DynamicPluginsPopover.tsx (1)

21-26: Inconsistent optional chaining usage.

Lines 21 and 26 use optional chaining (plugin?.status), but lines 24-25 don't. While the logic may work since notLoadedDynamicPluginInfo already filtered out invalid entries, using consistent optional chaining improves code safety and readability.

   const notLoadedDynamicPluginInfo = pluginInfoEntries.filter(
     (plugin) => plugin?.status !== 'loaded',
   );
-  const failedPlugins = notLoadedDynamicPluginInfo.filter((plugin) => plugin.status === 'failed');
-  const pendingPlugins = notLoadedDynamicPluginInfo.filter((plugin) => plugin.status === 'pending');
+  const failedPlugins = notLoadedDynamicPluginInfo.filter((plugin) => plugin?.status === 'failed');
+  const pendingPlugins = notLoadedDynamicPluginInfo.filter((plugin) => plugin?.status === 'pending');
   const loadedPlugins = pluginInfoEntries.filter((plugin) => plugin?.status === 'loaded');
frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx (1)

338-365: Consider more explicit status filtering for clarity.

Line 342 uses p?.status !== 'loaded' to find non-loaded plugins, which matches both 'pending' and 'failed' statuses. While functionally correct, an explicit check would improve readability:

-      const notLoadedPluginInfo = pluginInfo
-        .filter((p) => p?.status !== 'loaded')
-        .find((i) => i?.pluginName === pluginName);
+      const notLoadedPluginInfo = pluginInfo
+        .filter((p) => p?.status === 'pending' || p?.status === 'failed')
+        .find((i) => i?.pluginName === pluginName);
📜 Review details

Configuration used: CodeRabbit 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 f0cb82b and 3840f6e.

📒 Files selected for processing (18)
  • frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx (10 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginDescriptionDetail.tsx (1 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginEnabledStatusDetail.tsx (2 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginStatusDetail.tsx (2 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginVersionDetail.tsx (1 hunks)
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/DynamicPluginsPopover.tsx (1 hunks)
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/status.ts (1 hunks)
  • frontend/packages/console-app/src/hooks/useCSPViolationDetector.tsx (1 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/__tests__/plugin-dependencies.spec.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-dependencies.ts (1 hunks)
  • frontend/packages/console-plugin-sdk/src/__tests__/store.spec.ts (6 hunks)
  • frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts (3 hunks)
  • frontend/packages/console-plugin-sdk/src/store.ts (5 hunks)
  • frontend/public/components/about-modal.tsx (1 hunks)
  • frontend/public/components/app-contents.tsx (1 hunks)
  • frontend/public/components/notification-drawer.tsx (3 hunks)
  • frontend/public/i18n.js (1 hunks)
  • frontend/public/plugins.ts (1 hunks)
🧰 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/i18n.js
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-dependencies.ts
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginStatusDetail.tsx
  • frontend/public/components/app-contents.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginEnabledStatusDetail.tsx
  • frontend/packages/console-plugin-sdk/src/__tests__/store.spec.ts
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/status.ts
  • frontend/public/plugins.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/__tests__/plugin-dependencies.spec.ts
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginVersionDetail.tsx
  • frontend/packages/console-plugin-sdk/src/store.ts
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginDescriptionDetail.tsx
  • frontend/public/components/about-modal.tsx
  • frontend/public/components/notification-drawer.tsx
  • frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts
  • frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/DynamicPluginsPopover.tsx
  • frontend/packages/console-app/src/hooks/useCSPViolationDetector.tsx
🔇 Additional comments (24)
frontend/public/plugins.ts (1)

29-29: LGTM! PluginStore constructor updated to remove i18nNamespaces.

The removal of the i18nNamespaces parameter aligns with the PR's objective to migrate i18n namespace handling to SERVER_FLAGS. This change is consistent with the broader refactoring across the codebase.

frontend/packages/console-dynamic-plugin-sdk/src/runtime/__tests__/plugin-dependencies.spec.ts (1)

28-50: LGTM! Test helpers updated with lowercase status strings.

The test helper functions correctly use lowercase status values ('loaded', 'pending', 'failed') to align with the production code changes. This ensures test data matches the expected runtime behavior.

frontend/public/components/app-contents.tsx (1)

158-165: LGTM! Correctly adapted to updated usePluginInfo return type.

The change from tuple destructuring to direct value assignment is correct, and the memoized computation of allPluginsProcessed properly replaces the previous tuple value. The dependency array correctly includes pluginInfoEntries, and the logic accurately checks whether all plugins have completed processing (status !== 'pending').

frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-dependencies.ts (1)

120-133: LGTM! Status comparisons updated to lowercase.

The status checks correctly use lowercase string literals ('loaded', 'failed') to match the normalized plugin status values. The dependency resolution logic remains unchanged and functions correctly with the updated status values.

frontend/packages/console-app/src/hooks/useCSPViolationDetector.tsx (1)

103-112: LGTM! Status checks updated to use lowercase strings.

The replacement of isLoadedDynamicPluginInfo(entry) with entry?.status === 'loaded' correctly removes dependency on the type guard predicate while maintaining the same logic. The optional chaining ensures safe property access, and the lowercase status comparison aligns with the normalized plugin status values.

frontend/packages/console-app/src/components/console-operator/ConsolePluginStatusDetail.tsx (2)

7-19: LGTM! Correctly adapted to updated usePluginInfo return type.

The changes properly update the hook usage to receive a direct value instead of a tuple, use lowercase status checks, and correctly expand the memoization dependency array to include both pluginInfoEntries and pluginName.


21-25: LGTM! Status comparison uses lowercase string.

The error message extraction correctly uses the lowercase 'failed' status check, aligning with the normalized plugin status values.

frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/status.ts (1)

4-16: LGTM! Health state checks updated to lowercase status strings.

The status string comparisons are correctly normalized to lowercase ('failed', 'pending', 'loaded') while maintaining the existing health state determination logic. The function correctly returns ERROR for any failed plugins, PROGRESS for any pending plugins, OK when all are loaded, and UNKNOWN otherwise.

frontend/public/i18n.js (1)

78-78: LGTM! i18n namespaces migrated to SERVER_FLAGS.

The migration from pluginStore.getI18nNamespaces() to window.SERVER_FLAGS.i18nNamespaces aligns with the PR's objective to remove i18n namespace handling from PluginStore.

Verification confirms that window.SERVER_FLAGS.i18nNamespaces is always defined as an array: in the backend at cmd/bridge/main.go lines 246-255, i18nNamespaces is initialized as []string{} and remains at least an empty slice [] regardless of whether the flag is provided. This guarantees the frontend code at frontend/public/i18n.js:78 will safely execute Array.from(new Set(window.SERVER_FLAGS.i18nNamespaces)) without runtime errors.

frontend/packages/console-app/src/components/console-operator/ConsolePluginDescriptionDetail.tsx (1)

9-24: LGTM!

The refactoring correctly replaces the type guard predicate with direct status string checks. The logic properly handles both loaded and non-loaded states by accessing the appropriate fields based on status.

frontend/packages/console-plugin-sdk/src/__tests__/store.spec.ts (2)

285-292: LGTM!

Test expectations correctly updated to reflect lowercase status values ('pending').


585-590: LGTM!

All test expectations consistently updated to use lowercase status literals ('loaded', 'pending', 'failed') throughout the test suite, aligning with the SDK changes.

Also applies to: 957-1024

frontend/packages/console-app/src/components/console-operator/ConsolePluginEnabledStatusDetail.tsx (1)

12-41: LGTM!

The refactoring correctly removes the type guard predicate in favor of direct status checks. The logic properly handles the developmentMode flag and safely accesses plugin fields using optional chaining.

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

35-54: LGTM!

The refactoring correctly replaces the type guard with a direct status check using optional chaining. The filter and sort logic properly handles loaded plugins.

frontend/public/components/notification-drawer.tsx (1)

246-246: LGTM!

The hook usage correctly updated to direct value assignment.

frontend/packages/console-app/src/components/console-operator/ConsolePluginVersionDetail.tsx (1)

7-22: LGTM!

The refactoring correctly replaces the type guard with direct status checks. The logic safely accesses plugin metadata using optional chaining and properly handles both loaded and non-loaded states.

frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts (1)

25-58: LGTM!

The API change from tuple to single value return is correctly implemented. The removal of allPluginsProcessed tracking simplifies the hook while maintaining the subscription pattern. Documentation and example usage appropriately updated.

frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx (4)

93-93: LGTM: Status comparisons normalized to lowercase.

The status comparisons correctly use lowercase 'failed' to align with the updated status literals from the plugin store.

Also applies to: 359-361


297-316: LGTM: DevPluginsPage updated for new usePluginInfo API.

The component correctly adapts to the new usePluginInfo API that returns a single value instead of a tuple. The filtering and mapping logic is clear and correct.


158-158: LGTM: ConsolePluginsTable props simplified.

The removal of the loaded prop aligns with the PR objective to remove allPluginsProcessed from the plugin info API.

Also applies to: 434-436


2-2: Verify that PluginInfoEntry['status'] from the external SDK supports the required status literals.

The import of PluginInfoEntry from @openshift/dynamic-plugin-sdk@^5.0.1 is syntactically correct and used at lines 422 and 439. However, the external SDK's PluginInfoEntry['status'] type definition cannot be verified in the codebase. Ensure the external SDK's type supports the status literals used here ('loaded', 'pending', 'failed'), which match the internal DynamicPluginInfo type defined in frontend/packages/console-plugin-sdk/src/store.ts:311-328.

Also applies to: 422-422, 439-439

frontend/packages/console-plugin-sdk/src/store.ts (3)

70-82: LGTM: i18nNamespaces removed from PluginStore.

The constructor signature correctly removes the i18nNamespaces parameter, aligning with the PR objective to remove i18n namespace handling from PluginStore.


226-267: LGTM: Status literals normalized to lowercase.

The getPluginInfo method correctly returns lowercase status values ('loaded', 'failed', 'pending'), ensuring consistency with the type definitions and consuming components.


311-329: LGTM: Type definitions align with runtime status values.

The type definitions correctly use lowercase string literal types that match the runtime values returned by getPluginInfo. This ensures type safety when checking plugin status.

@logonoff logonoff force-pushed the CONSOLE-3769-s2e22-casino-night branch from 3840f6e to 962bb0d Compare November 18, 2025 15:32
const sortedRows = React.useMemo(() => rows.sort(compare), [rows, compare]);

return !loaded ? (
<LoadingBox />
Copy link
Contributor

Choose a reason for hiding this comment

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

The loaded prop value comes from usePluginInfo hook's second tuple element

const [pluginInfoEntries, allPluginsProcessed] = usePluginInfo();

which is true once all Console plugins have finished loading, i.e. there are no plugins in "pending" state.

So currently <ConsolePluginsTable> renders a loading state until all plugins are done loading.

I think it makes more sense for <ConsolePluginsTable> to render plugin information regardless of the plugin state so 👍 on this change.

'vsphere-plugin',
'webterminal-plugin',
...pluginStore.getI18nNamespaces(),
...Array.from(new Set(window.SERVER_FLAGS.i18nNamespaces)),
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 on removing direct reference to pluginStore

const i18nNamespaces = getI18nNamespaces();

export const pluginStore = new PluginStore(activePlugins, dynamicPluginNames, i18nNamespaces);
export const pluginStore = new PluginStore(activePlugins, dynamicPluginNames);
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 pluginStore should not be concerned with i18n aspect.

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

Caution

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

⚠️ Outside diff range comments (1)
frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx (1)

354-365: Fix null safety issue with optional chaining.

Lines 359 and 361 access notLoadedPluginInfo.status without optional chaining, but notLoadedPluginInfo can be undefined (it's the result of .find() on lines 341-343). This will cause a runtime error when a ConsolePlugin CR exists but hasn't been found in the plugin info array.

Apply this diff to add optional chaining:

       return {
         name: plugin?.metadata?.name,
         enabled,
         status: notLoadedPluginInfo?.status,
         errorMessage:
-          notLoadedPluginInfo.status === 'failed' ? notLoadedPluginInfo?.errorMessage : undefined,
+          notLoadedPluginInfo?.status === 'failed' ? notLoadedPluginInfo?.errorMessage : undefined,
         errorCause:
-          notLoadedPluginInfo.status === 'failed'
+          notLoadedPluginInfo?.status === 'failed'
             ? notLoadedPluginInfo?.errorCause?.toString()
             : undefined,
       };
♻️ Duplicate comments (2)
frontend/public/components/notification-drawer.tsx (1)

165-165: LGTM! Implementation matches past review suggestion.

The filtering logic correctly uses lowercase 'failed' status and removes the dependency on type guard functions, aligning with the SDK's PluginInfoEntry.status convention.

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

39-39: LGTM! Implementation matches past review suggestion.

The filtering logic correctly uses lowercase 'loaded' status and removes the dependency on the isLoadedDynamicPluginInfo type guard, aligning with the SDK's PluginInfoEntry.status convention.

📜 Review details

Configuration used: CodeRabbit 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 3840f6e and e5833e0.

📒 Files selected for processing (11)
  • frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx (10 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginDescriptionDetail.tsx (1 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginEnabledStatusDetail.tsx (2 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginStatusDetail.tsx (2 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginVersionDetail.tsx (1 hunks)
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/DynamicPluginsPopover.tsx (1 hunks)
  • frontend/packages/console-app/src/hooks/useCSPViolationDetector.tsx (1 hunks)
  • frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts (3 hunks)
  • frontend/public/components/about-modal.tsx (1 hunks)
  • frontend/public/components/app-contents.tsx (1 hunks)
  • frontend/public/components/notification-drawer.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
  • frontend/packages/console-app/src/hooks/useCSPViolationDetector.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginStatusDetail.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginDescriptionDetail.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginEnabledStatusDetail.tsx
  • frontend/public/components/app-contents.tsx
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/DynamicPluginsPopover.tsx
  • frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts
🧰 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/components/notification-drawer.tsx
  • frontend/public/components/about-modal.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginVersionDetail.tsx
🔇 Additional comments (9)
frontend/public/components/notification-drawer.tsx (1)

246-246: LGTM! Correctly updated to match SDK API.

The change from tuple destructuring to direct value assignment aligns with the SDK's usePluginInfo return type and is consistent with similar updates across the codebase.

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

35-35: LGTM! Correctly updated to match SDK API.

The direct value assignment from usePluginInfo() correctly reflects the API change to return a single array value instead of a tuple.

frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx (7)

2-2: LGTM! SDK type import added.

The import of PluginInfoEntry from the SDK correctly supports the migration away from internal plugin types.

Also applies to: 34-34


93-93: LGTM! Status comparison updated to lowercase.

The change to lowercase 'failed' correctly aligns with the SDK's PluginInfoEntry status values.


158-158: LGTM! Removed loading state prop.

The removal of the loaded prop aligns with the decision to render plugin information regardless of loading state, improving UX as noted in previous review feedback.


222-293: LGTM! Simplified rendering without loading state.

The table now renders immediately with available plugin data, providing better UX by showing information as soon as it's available rather than waiting for all plugins to load.


297-316: LGTM! Simplified plugin info usage.

The changes correctly update to the new usePluginInfo API that returns a single array, and replace type guards with direct status checks for better clarity.


338-343: LGTM! Replaced type guards with direct status checks.

The filter logic using p.status === 'loaded' and p.status !== 'loaded' is cleaner and more direct than using type guard functions.


422-422: LGTM! Types updated to use SDK types.

The type changes from internal DynamicPluginInfo['status'] to SDK PluginInfoEntry['status'] correctly align with the SDK migration goals.

Also applies to: 439-439

@logonoff logonoff force-pushed the CONSOLE-3769-s2e22-casino-night branch 2 times, most recently from 5f7964c to 6af823f Compare November 20, 2025 13:38
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

Caution

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

⚠️ Outside diff range comments (1)
frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx (1)

320-368: Protect against notLoadedPluginInfo being undefined and align status/error typing

In PluginsPage, notLoadedPluginInfo (Lines 341-343) is derived via .find(...) and can be undefined (plugin info not present yet, static-only plugin, etc.). However, Lines 359 and 361 access notLoadedPluginInfo.status without a null check, which will throw at runtime when notLoadedPluginInfo is missing. Additionally, status in ConsolePluginTableRow is non-optional, but you assign notLoadedPluginInfo?.status, which can be undefined.

You can fix both by introducing a local status variable derived safely and reusing it for error fields:

       const notLoadedPluginInfo = pluginInfo
         .filter((p) => p.status !== 'loaded')
         .find((i) => i?.pluginName === pluginName);
       if (loadedPluginInfo) {
         return {
           name: plugin?.metadata?.name,
           version: loadedPluginInfo?.metadata?.version,
           description: loadedPluginInfo?.metadata?.customProperties?.console?.description,
           enabled,
           status: loadedPluginInfo?.status,
           hasCSPViolations: cspViolations[plugin.metadata.name] ?? false,
         };
       }
+      const status = notLoadedPluginInfo?.status;
       return {
         name: plugin?.metadata?.name,
         enabled,
-        status: notLoadedPluginInfo?.status,
-        errorMessage:
-          notLoadedPluginInfo.status === 'failed' ? notLoadedPluginInfo?.errorMessage : undefined,
-        errorCause:
-          notLoadedPluginInfo.status === 'failed'
-            ? notLoadedPluginInfo?.errorCause?.toString()
-            : undefined,
+        status,
+        errorMessage:
+          status === 'failed' ? notLoadedPluginInfo?.errorMessage : undefined,
+        errorCause:
+          status === 'failed' ? notLoadedPluginInfo?.errorCause?.toString() : undefined,
       };

This avoids crashing when notLoadedPluginInfo is absent and keeps status/error fields consistent with the status value.

♻️ Duplicate comments (3)
frontend/public/components/notification-drawer.tsx (1)

165-165: LGTM! Status filtering updated correctly.

The inline status check using lowercase 'failed' correctly replaces the removed helper function and aligns with the SDK's status representation.

frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/DynamicPluginsPopover.tsx (1)

21-26: LGTM! Filtering logic correctly migrated to inline status checks.

The inline status checks correctly replace the removed helper predicates:

  • Line 21-23: Filters for status !== 'loaded' (replaces isNotLoadedDynamicPluginInfo)
  • Lines 24-26: Correctly filter for specific states using lowercase status strings

The logic is sound and aligns with the PR objective to use lowercase status values and remove helper dependencies.

frontend/packages/console-app/src/components/console-operator/ConsolePluginVersionDetail.tsx (1)

7-21: Guard against pluginInfo being undefined before accessing status/metadata

On Line 13, pluginInfoEntries.find(...) can return undefined (no matching entry yet, plugin missing, or pluginName undefined), but Line 21 unconditionally reads pluginInfo.status and pluginInfo.metadata.version. This will throw at runtime and likely violate strictNullChecks.

Consider an early guard returning DASH when the entry is missing or not loaded:

   const pluginInfo = React.useMemo(
     () =>
       pluginInfoEntries.find((entry) =>
         entry.status === 'loaded'
           ? entry.metadata.name === pluginName
           : entry.pluginName === pluginName,
       ),
     [pluginInfoEntries, pluginName],
   );

-  return pluginInfo.status === 'loaded' ? <>{pluginInfo.metadata.version}</> : <>{DASH}</>;
+  if (!pluginInfo || pluginInfo.status !== 'loaded') {
+    return <>{DASH}</>;
+  }
+
+  return <>{pluginInfo.metadata.version}</>;

This preserves behavior while avoiding crashes when the plugin info is absent or still loading.

🧹 Nitpick comments (1)
frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx (1)

158-294: Avoid mutating rows prop when computing sortedRows

sortedRows is computed via rows.sort(compare) (Line 220), which sorts the rows array in place. Even though current callers build rows freshly, mutating props is brittle and can cause subtle bugs if rows is ever reused or shared.

Consider sorting a shallow copy instead:

-  const sortedRows = React.useMemo(() => rows.sort(compare), [rows, compare]);
+  const sortedRows = React.useMemo(() => [...rows].sort(compare), [rows, compare]);

This keeps ConsolePluginsTable purely functional with respect to its rows prop.

📜 Review details

Configuration used: CodeRabbit 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 e5833e0 and 5f7964c.

📒 Files selected for processing (18)
  • frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx (10 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginDescriptionDetail.tsx (1 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginEnabledStatusDetail.tsx (2 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginStatusDetail.tsx (2 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginVersionDetail.tsx (1 hunks)
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/DynamicPluginsPopover.tsx (1 hunks)
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/status.ts (1 hunks)
  • frontend/packages/console-app/src/hooks/useCSPViolationDetector.tsx (1 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/__tests__/plugin-dependencies.spec.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-dependencies.ts (1 hunks)
  • frontend/packages/console-plugin-sdk/src/__tests__/store.spec.ts (6 hunks)
  • frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts (3 hunks)
  • frontend/packages/console-plugin-sdk/src/store.ts (5 hunks)
  • frontend/public/components/about-modal.tsx (1 hunks)
  • frontend/public/components/app-contents.tsx (1 hunks)
  • frontend/public/components/notification-drawer.tsx (3 hunks)
  • frontend/public/i18n.js (1 hunks)
  • frontend/public/plugins.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (8)
  • frontend/public/components/about-modal.tsx
  • frontend/packages/console-app/src/hooks/useCSPViolationDetector.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginStatusDetail.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginDescriptionDetail.tsx
  • frontend/public/i18n.js
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginEnabledStatusDetail.tsx
  • frontend/packages/console-plugin-sdk/src/store.ts
  • frontend/public/components/app-contents.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/console-plugin-sdk/src/__tests__/store.spec.ts
  • frontend/public/plugins.ts
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/DynamicPluginsPopover.tsx
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/status.ts
  • frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/__tests__/plugin-dependencies.spec.ts
  • frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx
  • frontend/public/components/notification-drawer.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-dependencies.ts
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginVersionDetail.tsx
🔇 Additional comments (13)
frontend/public/plugins.ts (1)

29-29: LGTM! Simplified PluginStore initialization aligns with SDK.

The removal of the i18nNamespaces parameter improves separation of concerns by decoupling plugin store initialization from i18n management. This change aligns with the PR objective to match the SDK PluginStore signature.

frontend/packages/console-dynamic-plugin-sdk/src/runtime/__tests__/plugin-dependencies.spec.ts (1)

28-50: LGTM! Status normalization aligns test data with runtime behavior.

The lowercase status values ('loaded', 'pending', 'failed') in the test helpers now match the updated runtime checks in the dependency resolution logic.

frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-dependencies.ts (1)

120-133: LGTM! Runtime status checks correctly updated to lowercase.

The status comparisons now use lowercase 'loaded' and 'failed' strings, maintaining consistency with the test helpers and aligning with SDK PluginInfoEntry.status.

frontend/packages/console-plugin-sdk/src/__tests__/store.spec.ts (3)

268-293: LGTM! Status normalization is correctly applied.

The test expectations correctly reflect the lowercase status values ('pending') for plugins in initial state. The constructor signature using two parameters aligns with the removal of i18nNamespaces mentioned in the PR objectives.


583-591: LGTM! Loaded status correctly normalized.

The test expectation correctly reflects the lowercase status value ('loaded') for successfully added dynamic plugins.


949-1025: LGTM! Complete status lifecycle correctly normalized.

The test expectations correctly reflect all three lowercase status values ('pending', 'loaded', 'failed') throughout the plugin lifecycle. The comprehensive coverage validates proper status transitions from initial state through loading and failure scenarios.

frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/status.ts (1)

6-12: Changes are correct—plugin status values already use lowercase in SDK types.

The PR changes align with the actual DynamicPluginInfo type definitions. The SDK defines LoadedDynamicPluginInfo with status: 'loaded' and NotLoadedDynamicPluginInfo with status: 'pending' or status: 'failed' (all lowercase). The status comparisons in lines 6, 9, and 12 now correctly match the actual type values returned by pluginStore.getPluginInfo().

frontend/public/components/notification-drawer.tsx (2)

17-17: LGTM! Import simplified to align with SDK.

The removal of isNotLoadedDynamicPluginInfo aligns with the PR objective to decrease dependence on helper predicates from @console/plugin-sdk.


246-246: LGTM! Updated to match new usePluginInfo API.

The change from tuple destructuring to direct assignment correctly reflects the updated usePluginInfo() return type, which now returns DynamicPluginInfo[] instead of [DynamicPluginInfo[], boolean].

frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts (1)

16-16: LGTM! API simplified to align with dynamic-plugin-sdk.

The hook now returns DynamicPluginInfo[] directly instead of a tuple with the allPluginsProcessed boolean. This change:

  • Aligns with the SDK's usePluginInfo implementation
  • Fulfills the PR objective to remove allPluginsProcessed from usePluginInfo
  • Is safe per previous review discussion confirming this hook is not exposed via the Console plugin API

Also applies to: 25-25, 58-58

frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/DynamicPluginsPopover.tsx (1)

17-17: LGTM! Updated to use new usePluginInfo API.

Correctly changed from tuple destructuring to direct value assignment, matching the updated hook signature.

frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx (2)

2-2: Status typing and import alignment with PluginInfoEntry look consistent

Importing PluginInfoEntry (Line 2) and wiring ConsolePluginStatus, ConsolePluginTableRow.status, and ConsolePluginStatusProps.status to PluginInfoEntry['status'] (Lines 90-94, 422-441) matches the status-based approach ('loaded' | 'failed' | ...) and the normalization to lowercase. No issues here.

Also applies to: 90-94, 422-441


297-317: Dev plugins page usePluginInfo usage and status filtering look correct

Using the updated usePluginInfo() return value directly (Line 297) and filtering to plugin.status === 'loaded' before mapping to table rows (Lines 304-313) aligns with the new API and avoids touching pending/failed entries. The CSP violations lookup also correctly keys off plugin.metadata.name. No issues here.

@Leo6Leo
Copy link
Contributor

Leo6Leo commented Nov 20, 2025

/retest-required

@logonoff logonoff force-pushed the CONSOLE-3769-s2e22-casino-night branch from 6af823f to 4304f21 Compare November 21, 2025 14:58
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

📜 Review details

Configuration used: CodeRabbit 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 6af823f and 4304f21.

📒 Files selected for processing (18)
  • frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx (10 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginDescriptionDetail.tsx (1 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginEnabledStatusDetail.tsx (2 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginStatusDetail.tsx (2 hunks)
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginVersionDetail.tsx (1 hunks)
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/DynamicPluginsPopover.tsx (1 hunks)
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/status.ts (1 hunks)
  • frontend/packages/console-app/src/hooks/useCSPViolationDetector.tsx (1 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/__tests__/plugin-dependencies.spec.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-dependencies.ts (1 hunks)
  • frontend/packages/console-plugin-sdk/src/__tests__/store.spec.ts (6 hunks)
  • frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts (3 hunks)
  • frontend/packages/console-plugin-sdk/src/store.ts (5 hunks)
  • frontend/public/components/about-modal.tsx (1 hunks)
  • frontend/public/components/app-contents.tsx (1 hunks)
  • frontend/public/components/notification-drawer.tsx (3 hunks)
  • frontend/public/i18n.js (1 hunks)
  • frontend/public/plugins.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (13)
  • frontend/public/components/about-modal.tsx
  • frontend/packages/console-app/src/hooks/useCSPViolationDetector.tsx
  • frontend/public/components/notification-drawer.tsx
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/status.ts
  • frontend/public/components/app-contents.tsx
  • frontend/public/plugins.ts
  • frontend/packages/console-plugin-sdk/src/tests/store.spec.ts
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginEnabledStatusDetail.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginDescriptionDetail.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-dependencies.ts
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginStatusDetail.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginVersionDetail.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/tests/plugin-dependencies.spec.ts
🧰 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/console-plugin-sdk/src/api/usePluginInfo.ts
  • frontend/public/i18n.js
  • frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/DynamicPluginsPopover.tsx
  • frontend/packages/console-plugin-sdk/src/store.ts
🔇 Additional comments (11)
frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts (2)

16-16: LGTM: API simplified to align with SDK.

The return type change from tuple to array and the updated documentation example correctly reflect the SDK alignment. Based on learnings from past review comments, this change is safe since usePluginInfo is not exposed via the Console plugin API.

Also applies to: 25-25


58-58: LGTM: Return statement matches new signature.

The simplified return value correctly implements the new single-value return type, eliminating the allPluginsProcessed tracking as intended.

frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/DynamicPluginsPopover.tsx (2)

17-17: LGTM: Hook usage correctly updated.

The usePluginInfo() call correctly reflects the new single-value return type, removing the tuple destructuring.


21-26: LGTM: Status filtering correctly implemented with lowercase strings.

The inline status-based filtering correctly replaces the removed isLoadedDynamicPluginInfo and isNotLoadedDynamicPluginInfo helper predicates. The lowercase status values ('loaded', 'failed', 'pending') align with the SDK as intended.

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

70-82: LGTM! SDK alignment changes are consistent.

The removal of the i18nNamespaces parameter from the constructor and the lowercase status literals throughout ('loaded', 'failed', 'pending') are breaking changes, but they correctly align with the SDK as stated in the PR objectives. The implementation is consistent across runtime values and type definitions.

Also applies to: 226-267, 311-330

frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx (6)

158-158: LGTM - improved rendering logic.

Removing the loaded prop and rendering unconditionally improves UX by displaying plugin information regardless of loading state. The EmptyBox fallback handles the no-data case appropriately.

Also applies to: 222-293


296-317: LGTM - clean refactor for dev mode.

The refactor correctly consumes usePluginInfo() as an array and filters for loaded plugins, which is appropriate for development mode display.


358-363: LGTM - correct error handling.

The conditional error detail assignment is correct—only plugins with status === 'failed' should expose errorMessage and errorCause.


418-426: LGTM - improved type safety.

The type definitions now correctly reference PluginInfoEntry['status'] from the SDK, improving type safety and alignment with the external API.

Also applies to: 438-441


338-343: Property access pattern verified as correct.

The code correctly accesses metadata.name for loaded plugins and pluginName for not-loaded plugins. This pattern is consistently used across multiple detail components (ConsolePluginVersionDetail, ConsolePluginStatusDetail, ConsolePluginEnabledStatusDetail, ConsolePluginDescriptionDetail) and aligns with the PluginInfoEntry type from @openshift/dynamic-plugin-sdk, which returns different object shapes based on plugin status.


2-2: Verify lowercase status values are supported by @openshift/dynamic-plugin-sdk v5.0.1.

The code consistently uses lowercase status values ('failed', 'loaded', 'pending'), but the SDK type definitions could not be definitively verified through web search. Before merging, please confirm that PluginInfoEntry['status'] in @openshift/dynamic-plugin-sdk v5.0.1 supports these lowercase literals by checking the package's TypeScript definitions (typically in the npm package or GitHub repository at https://github.com/openshift/dynamic-plugin-sdk).

@logonoff logonoff force-pushed the CONSOLE-3769-s2e22-casino-night branch from 4304f21 to 84d7348 Compare November 21, 2025 15:07
@logonoff logonoff force-pushed the CONSOLE-3769-s2e22-casino-night branch from 84d7348 to a53ba4e Compare November 21, 2025 15:07
@logonoff
Copy link
Member Author

Local build and testing shows there are no issues

/verified by @logonoff

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Nov 21, 2025
@openshift-ci-robot
Copy link
Contributor

@logonoff: This PR has been marked as verified by @logonoff.

In response to this:

Local build and testing shows there are no issues

/verified by @logonoff

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
Copy link
Member Author

/retest

@vojtechszocs
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 21, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 21, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: logonoff, vojtechszocs

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

The pull request process is described here

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

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 569b5f4 and 2 for PR HEAD a53ba4e in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 21, 2025

@logonoff: The following test 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 a53ba4e link true /test e2e-gcp-console

Full PR test history. Your PR dashboard.

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.

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD c52e48c and 1 for PR HEAD a53ba4e in total

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/sdk Related to console-plugin-sdk 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. lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants