Skip to content

Conversation

@logonoff
Copy link
Member

@logonoff logonoff commented Nov 18, 2025

  • 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
  • ExtensionDeclaration renamed to Extension, because there are no more "static extensions". ExtensionDeclaration type is removed and its replacement is the Extension type.
  • The idea of "dynamic" vs "static" extensions are entirely removed, we only have "extensions".
  • @console/plugin-sdk barrel files and type reexports are removed
  • LazyLoader type in @console/plugin-sdk migrated to AsyncComponent because it's only used in that context

@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

This PR normalizes plugin status strings from capitalized to lowercase ('Loaded'/'Pending'/'Failed' → 'loaded'/'pending'/'failed'), refactors the usePluginInfo hook to return a direct array instead of a tuple, removes status-checking helper predicates, eliminates i18nNamespaces handling from PluginStore, and updates related type signatures and consumers throughout the codebase.

Changes

Cohort / File(s) Change Summary
Console Operator Components
frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx, ConsolePluginDescriptionDetail.tsx, ConsolePluginEnabledStatusDetail.tsx, ConsolePluginStatusDetail.tsx, ConsolePluginVersionDetail.tsx
Updated usePluginInfo usage from tuple destructuring to direct assignment; replaced isLoadedDynamicPluginInfo predicate with direct status checks (entry.status === 'loaded'); normalized status comparisons to lowercase; removed loaded prop from ConsolePluginsTable; aligned type signatures to use PluginInfoEntry status.
Dashboard Plugin Health Components
frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/DynamicPluginsPopover.tsx, status.ts
Updated usePluginInfo return handling; replaced predicate-based filtering with direct status comparisons (plugin.status === 'loaded', 'pending', 'failed'); normalized status string literals to lowercase.
Hook Updates
frontend/packages/console-app/src/hooks/useCSPViolationDetector.tsx
Replaced isLoadedDynamicPluginInfo check with direct status comparison (entry.status === 'loaded'); updated status values to lowercase; removed unused import.
Plugin SDK Core
frontend/packages/console-plugin-sdk/src/store.ts, api/usePluginInfo.ts
usePluginInfo signature changed from returning tuple [DynamicPluginInfo[], boolean] to DynamicPluginInfo[] directly; removed allPluginsProcessed tracking; removed isLoadedDynamicPluginInfo and isNotLoadedDynamicPluginInfo exports; normalized all status literals to lowercase; removed i18nNamespaces field and constructor parameter; updated addDynamicPlugin to accept ExtensionDeclaration[] instead of Extension[]; removed getI18nNamespaces accessor.
Runtime & Plugin Dependencies
frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-dependencies.ts, __tests__/plugin-dependencies.spec.ts
Updated status comparisons from capitalized to lowercase ('Loaded' → 'loaded', 'Failed' → 'failed'); test helpers updated to emit lowercase status strings.
Plugin Store Tests
frontend/packages/console-plugin-sdk/src/__tests__/store.spec.ts
Updated test expectations to use lowercase status values ('pending', 'loaded', 'failed').
Public Components
frontend/public/components/about-modal.tsx, app-contents.tsx, notification-drawer.tsx
Updated usePluginInfo usage from tuple destructuring to direct value assignment; replaced predicate-based filtering with direct status checks; computed allPluginsProcessed via useMemo in app-contents.tsx.
Configuration Files
frontend/public/i18n.js, plugins.ts
Removed pluginStore import and i18nNamespaces handling; replaced pluginStore.getI18nNamespaces() with window.SERVER_FLAGS.i18nNamespaces; updated PluginStore instantiation to remove i18nNamespaces argument.
E2E Tests
frontend/packages/integration-tests-cypress/tests/app/demo-dynamic-plugin.cy.ts
Updated Cypress assertion to check for lowercase 'loaded' instead of 'Loaded'.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • store.ts: Substantial public API changes affecting PluginStore constructor, method signatures (sanitizeExtension, augmentExtension, isExtensionInUse, getGatingFlagNames), removal of exports (isLoadedDynamicPluginInfo, isNotLoadedDynamicPluginInfo), and i18nNamespaces elimination require careful verification of cascading impacts.
  • usePluginInfo.ts: Hook signature change from tuple return to direct array affects all consumers; verify allPluginsProcessed derivation in consumers is correct.
  • Consumer files: Verify that all files updating from tuple destructuring to direct assignment correctly handle the new hook return type and that status checks consistently use lowercase literals.
  • Type compatibility: Ensure ExtensionDeclaration type usage is properly propagated through all method signatures and doesn't introduce incompatibilities.
  • i18nNamespaces removal: Confirm window.SERVER_FLAGS.i18nNamespaces is reliably available and that the configuration replacement in i18n.js is complete.
✨ 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 4babc26 and 86835a7.

📒 Files selected for processing (4)
  • frontend/packages/console-plugin-sdk/src/__tests__/store.spec.ts (6 hunks)
  • frontend/packages/console-plugin-sdk/src/store.ts (5 hunks)
  • frontend/public/components/notification-drawer.tsx (3 hunks)
  • frontend/public/plugins.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • frontend/public/plugins.ts
  • frontend/packages/console-plugin-sdk/src/tests/store.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/public/components/notification-drawer.tsx
  • frontend/packages/console-plugin-sdk/src/store.ts
🧬 Code graph analysis (2)
frontend/public/components/notification-drawer.tsx (1)
frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts (1)
  • usePluginInfo (25-59)
frontend/packages/console-plugin-sdk/src/store.ts (1)
frontend/packages/console-plugin-sdk/src/typings/base.ts (1)
  • ActivePlugin (20-23)
🔇 Additional comments (3)
frontend/public/components/notification-drawer.tsx (1)

17-18: Dynamic plugin info wiring and failed‑plugin filtering look correct

Using DynamicPluginInfo[] for pluginInfoEntries, relying on usePluginInfo()’s direct array return, and filtering with plugin.status === 'failed' all align with the updated store typings and lowercase status values; the failedPlugins list and navigation to the ConsolePluginModel resource are type‑safe and behaviorally consistent with the prior logic.

Also applies to: 148-166, 238-279

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

70-82: Constructor refactor to accept ActivePlugin[] is consistent and safe

Normalizing ActivePlugin[] into internal StaticPlugin[] via sanitizeExtension/augmentExtension and freezing each processed extension keeps the store’s invariants (immutable, fully‑augmented static extensions) while simplifying the public constructor; filtering and extension aggregation in updateExtensions continue to work as before.


226-267: Lowercase dynamic plugin status literals are applied consistently

getPluginInfo now returns entries with status: 'loaded' | 'failed' | 'pending', and the corresponding LoadedDynamicPluginInfo / NotLoadedDynamicPluginInfo types use the same literals, preserving DynamicPluginInfo as a proper discriminated union and matching consumer checks like plugin.status === 'failed' in the notification drawer.

Also applies to: 311-328


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 2 times, most recently 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

@logonoff logonoff force-pushed the CONSOLE-3769-s2e22-casino-night branch from dceb2d2 to 4babc26 Compare November 25, 2025 13:52
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

♻️ Duplicate comments (6)
frontend/public/components/utils/async.tsx (3)

9-10: Fix the null comparison bug in sameLoader.

The fallback strings 'a' and 'b' cause sameLoader(null)(null) to return false instead of true. When both loaders are null, the first part passes (undefined === undefined), but the second part evaluates to 'a' === 'b', which fails.

Apply this diff to fix the null-handling logic:

 const sameLoader = (a: LazyLoader | null) => (b: LazyLoader | null) =>
-  a?.name === b?.name && (a || 'a').toString() === (b || 'b').toString();
+  a?.name === b?.name && a?.toString() === b?.toString();

This ensures that null === null returns true as expected.


86-89: Fix LoadingComponent type mismatch.

Line 88 types LoadingComponent as ReactNode, but Line 77 renders it as <LoadingComponent />, which requires a ComponentType. Typing it as ReactNode allows invalid values (strings, numbers, etc.) that will cause runtime errors.

Apply this diff to fix the type:

 export type AsyncComponentProps = {
   loader: LazyLoader;
-  LoadingComponent?: ReactNode;
+  LoadingComponent?: ComponentType;
 } & any;

90-93: Add nullability to AsyncComponentState types.

Lines 91-92 declare Component and loader as non-null, but Line 17 initializes them as null, and Line 26 explicitly sets Component to null. This type mismatch will cause issues when strictNullChecks is enabled.

Apply this diff to align types with runtime behavior:

 export type AsyncComponentState = {
-  Component: ComponentType;
-  loader: LazyLoader;
+  Component: ComponentType | null;
+  loader: LazyLoader | null;
 };

This matches the intent expressed in previous discussion to prepare for future strictNullChecks enablement.

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

102-113: Plugin status checks correctly updated to lowercase 'loaded'.

The inline entry.status === 'loaded' predicate and pluginIsLoaded computation match the new plugin status convention and preserve the previous branching on metadata.name vs pluginName.

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

33-55: Dynamic plugins list correctly filters on 'loaded' status.

Using the direct pluginInfoEntries array from usePluginInfo() and filtering with plugin.status === 'loaded' is consistent with the new hook contract and avoids the removed helper while preserving behavior.

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

8-25: Console plugin status lookup updated to new usePluginInfo + status semantics.

Using the direct pluginInfoEntries array and the entry.status === 'loaded' predicate maintains the old matching behavior while aligning with the lowercase statuses; passing errorMessage only for 'failed' is also appropriate.

🧹 Nitpick comments (3)
frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-core.md (1)

17-18: Minor: Consider consistent capitalization for "Type breaking" label.

The entries use lowercase "breaking" (Type breaking), whereas a past suggestion indicated uppercase "Breaking" (Type Breaking) for consistency with similar entries. Consider aligning the capitalization style across all type-related breaking changes, or verify this is the established convention for this changelog.

frontend/packages/console-dynamic-plugin-sdk/src/coderefs/coderef-resolver.ts (1)

3-3: ExtensionDeclaration + AnyObject constraints in resolver are coherent

The shift to ExtensionDeclaration[] in resolveEncodedCodeRefs and the updated generics in resolveExtension (using ExtensionDeclaration<string, P> and P extends AnyObject = ExtensionProperties<E>) keep the resolver aligned with the new public types and ensure MapCodeRefsToValues/UpdateExtensionProperties are only applied to object-like properties. The runtime behavior is unchanged and the additional constraints improve type safety without introducing regressions.

If you ever want stronger preservation of concrete extension types through resolveEncodedCodeRefs, you could genericize it as <E extends ExtensionDeclaration>(extensions: E[], …) => E[], but this is optional and not required for correctness.

Also applies to: 5-13, 97-103, 117-121, 148-148

frontend/public/reducers/features.ts (1)

75-80: Known incorrect model ref + any cast should be tracked for follow‑up

The new (…filter(isModelFeatureFlag) as any) plus the inline comment about referenceForModel vs referenceForExtensionModel makes this a consciously papered‑over bug: Extension‑backed models will still compute an incorrect ref, and we’re now also bypassing type safety around these entries.

Given the earlier decision not to change runtime behavior here, this is acceptable short‑term, but please ensure there’s a concrete follow‑up (Jira/TODO with an ID) to:

  • Swap to the correct helper for extension models, and
  • Remove the as any by using the proper typed getExtensions<…>() once on @openshift/dynamic-plugin-sdk.
📜 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 038bf01 and 4babc26.

📒 Files selected for processing (95)
  • frontend/packages/console-app/src/__tests__/plugin-test-utils.ts (1 hunks)
  • 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/NotLoadedDynamicPlugins.tsx (1 hunks)
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/status.ts (1 hunks)
  • frontend/packages/console-app/src/components/detect-perspective/__tests__/PerspectiveDetector.spec.tsx (1 hunks)
  • frontend/packages/console-app/src/components/nav/useNavExtensionForPerspective.ts (1 hunks)
  • frontend/packages/console-app/src/components/user-preferences/perspective/PreferredPerspectiveSelect.tsx (1 hunks)
  • frontend/packages/console-app/src/components/user-preferences/perspective/__tests__/perspective.data.ts (1 hunks)
  • frontend/packages/console-app/src/hooks/useCSPViolationDetector.tsx (1 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-core.md (3 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/README.md (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/api/useResolvedExtensions.ts (1 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/coderefs/__tests__/coderef-resolver.spec.ts (8 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/coderefs/coderef-resolver.ts (3 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/actions.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/add-actions.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/alerts.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/breadcrumbs.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/catalog.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/cluster-configuration.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/cluster-overview.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/cluster-settings.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/console-types.ts (3 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/context-providers.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/create-project-modal.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/create-resource.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/dashboard-data-source.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/dashboards.ts (3 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/details-item.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/feature-flags.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/file-upload.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/guided-tour.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/horizontal-nav-tabs.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/import-environments.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/navigation.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/node.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/notification-alert.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/pages.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/perspectives.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/project-overview.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/pvc.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/redux.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/resource-metadata.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/storage-class-provisioner.ts (1 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/storage-provider.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/telemetry.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/topology-details.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/topology.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/user-preferences.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/yaml-templates.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/__tests__/plugin-dependencies.spec.ts (2 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/__tests__/plugin-loader.spec.ts (3 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-dependencies.ts (1 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/types.ts (4 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/utils/test-utils.ts (1 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/validation/ExtensionValidator.ts (3 hunks)
  • frontend/packages/console-dynamic-plugin-sdk/src/validation/__tests__/ExtensionValidator.spec.ts (3 hunks)
  • frontend/packages/console-plugin-sdk/src/__tests__/store.spec.ts (13 hunks)
  • frontend/packages/console-plugin-sdk/src/api/pluginSubscriptionService.ts (6 hunks)
  • frontend/packages/console-plugin-sdk/src/api/useExtensions.ts (2 hunks)
  • frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts (3 hunks)
  • frontend/packages/console-plugin-sdk/src/codegen/__tests__/active-plugins.spec.ts (6 hunks)
  • frontend/packages/console-plugin-sdk/src/codegen/active-plugins.ts (2 hunks)
  • frontend/packages/console-plugin-sdk/src/index.ts (0 hunks)
  • frontend/packages/console-plugin-sdk/src/store.ts (8 hunks)
  • frontend/packages/console-plugin-sdk/src/typings/base.ts (1 hunks)
  • frontend/packages/console-plugin-sdk/src/typings/index.ts (0 hunks)
  • frontend/packages/console-plugin-sdk/src/utils/__tests__/extension-i18n.spec.ts (3 hunks)
  • frontend/packages/console-plugin-sdk/src/utils/extension-i18n.ts (3 hunks)
  • frontend/packages/console-plugin-sdk/src/utils/useTranslatedExtensions.ts (2 hunks)
  • frontend/packages/console-shared/src/components/actions/__tests__/utils-test-data.ts (1 hunks)
  • frontend/packages/console-shared/src/components/actions/utils.ts (1 hunks)
  • frontend/packages/console-shared/src/components/dashboard/status-card/OperatorStatusBody.tsx (1 hunks)
  • frontend/packages/console-shared/src/hooks/create-resource-hook.ts (1 hunks)
  • frontend/packages/console-shared/src/hooks/perspective-utils.ts (1 hunks)
  • frontend/packages/console-shared/src/utils/sample-utils.ts (1 hunks)
  • frontend/packages/dev-console/src/components/add/AddCardSection.tsx (1 hunks)
  • frontend/packages/dev-console/src/components/add/__tests__/add-page-test-data.tsx (1 hunks)
  • frontend/packages/dev-console/src/components/import/import-types.ts (1 hunks)
  • frontend/packages/integration-tests-cypress/tests/app/demo-dynamic-plugin.cy.ts (1 hunks)
  • frontend/packages/topology/src/components/workload/utils.ts (2 hunks)
  • frontend/public/components/about-modal.tsx (1 hunks)
  • frontend/public/components/app-contents.tsx (1 hunks)
  • frontend/public/components/dashboard/dashboards-page/cluster-dashboard/health-item.tsx (1 hunks)
  • frontend/public/components/notification-drawer.tsx (3 hunks)
  • frontend/public/components/utils/async.tsx (2 hunks)
  • frontend/public/i18n.js (1 hunks)
  • frontend/public/module/k8s/__tests__/get-resources.spec.ts (1 hunks)
  • frontend/public/plugins.ts (2 hunks)
  • frontend/public/reducers/features.ts (1 hunks)
💤 Files with no reviewable changes (2)
  • frontend/packages/console-plugin-sdk/src/typings/index.ts
  • frontend/packages/console-plugin-sdk/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (58)
  • frontend/packages/console-app/src/components/detect-perspective/tests/PerspectiveDetector.spec.tsx
  • frontend/public/components/dashboard/dashboards-page/cluster-dashboard/health-item.tsx
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/DynamicPluginsPopover.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/tests/plugin-dependencies.spec.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/add-actions.ts
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/NotLoadedDynamicPlugins.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/validation/tests/ExtensionValidator.spec.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/node.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/pages.ts
  • frontend/packages/console-shared/src/utils/sample-utils.ts
  • frontend/packages/dev-console/src/components/add/tests/add-page-test-data.tsx
  • frontend/packages/integration-tests-cypress/tests/app/demo-dynamic-plugin.cy.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/import-environments.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/console-types.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/storage-class-provisioner.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/pvc.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/project-overview.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/cluster-settings.ts
  • frontend/public/plugins.ts
  • frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx
  • frontend/packages/console-plugin-sdk/src/utils/tests/extension-i18n.spec.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/dashboard-data-source.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/tests/plugin-loader.spec.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/validation/ExtensionValidator.ts
  • frontend/packages/console-plugin-sdk/src/codegen/tests/active-plugins.spec.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/utils/test-utils.ts
  • frontend/public/components/app-contents.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/create-resource.ts
  • frontend/packages/console-app/src/components/nav/useNavExtensionForPerspective.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/feature-flags.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/api/useResolvedExtensions.ts
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginVersionDetail.tsx
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/status.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/navigation.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/file-upload.ts
  • frontend/packages/console-shared/src/components/actions/tests/utils-test-data.ts
  • frontend/packages/console-plugin-sdk/src/api/useExtensions.ts
  • frontend/packages/console-app/src/tests/plugin-test-utils.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/topology-details.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/actions.ts
  • frontend/packages/dev-console/src/components/add/AddCardSection.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/cluster-overview.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/horizontal-nav-tabs.ts
  • frontend/packages/console-plugin-sdk/src/api/pluginSubscriptionService.ts
  • frontend/packages/console-app/src/components/user-preferences/perspective/PreferredPerspectiveSelect.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/context-providers.ts
  • frontend/packages/dev-console/src/components/import/import-types.ts
  • frontend/packages/console-shared/src/components/actions/utils.ts
  • frontend/packages/console-plugin-sdk/src/store.ts
  • frontend/packages/console-plugin-sdk/src/typings/base.ts
  • frontend/packages/topology/src/components/workload/utils.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/resource-metadata.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/redux.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/yaml-templates.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/storage-provider.ts
  • frontend/packages/console-shared/src/hooks/perspective-utils.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/perspectives.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/guided-tour.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-dynamic-plugin-sdk/src/extensions/cluster-configuration.ts
  • frontend/public/i18n.js
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/notification-alert.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/coderefs/coderef-resolver.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/topology.ts
  • frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/catalog.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/coderefs/__tests__/coderef-resolver.spec.ts
  • frontend/public/reducers/features.ts
  • frontend/packages/console-app/src/components/user-preferences/perspective/__tests__/perspective.data.ts
  • frontend/public/components/about-modal.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-dependencies.ts
  • frontend/public/components/utils/async.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/user-preferences.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/alerts.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/details-item.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/telemetry.ts
  • frontend/public/module/k8s/__tests__/get-resources.spec.ts
  • frontend/packages/console-app/src/hooks/useCSPViolationDetector.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginStatusDetail.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/types.ts
  • frontend/packages/console-plugin-sdk/src/utils/useTranslatedExtensions.ts
  • frontend/public/components/notification-drawer.tsx
  • frontend/packages/console-dynamic-plugin-sdk/README.md
  • frontend/packages/console-plugin-sdk/src/utils/extension-i18n.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/dashboards.ts
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginDescriptionDetail.tsx
  • frontend/packages/console-shared/src/components/dashboard/status-card/OperatorStatusBody.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/breadcrumbs.ts
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginEnabledStatusDetail.tsx
  • frontend/packages/console-shared/src/hooks/create-resource-hook.ts
  • frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-core.md
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/create-project-modal.ts
  • frontend/packages/console-plugin-sdk/src/__tests__/store.spec.ts
  • frontend/packages/console-plugin-sdk/src/codegen/active-plugins.ts
🧬 Code graph analysis (11)
frontend/packages/console-dynamic-plugin-sdk/src/coderefs/coderef-resolver.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • ExtensionProperties (67-67)
frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts (1)
frontend/packages/console-plugin-sdk/src/store.ts (1)
  • DynamicPluginInfo (331-331)
frontend/packages/console-dynamic-plugin-sdk/src/coderefs/__tests__/coderef-resolver.spec.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • CodeRef (57-57)
frontend/public/reducers/features.ts (2)
frontend/public/plugins.ts (1)
  • pluginStore (29-29)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/feature-flags.ts (1)
  • isModelFeatureFlag (38-39)
frontend/packages/console-app/src/components/console-operator/ConsolePluginStatusDetail.tsx (1)
frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts (1)
  • usePluginInfo (25-59)
frontend/public/components/notification-drawer.tsx (1)
frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts (1)
  • usePluginInfo (25-59)
frontend/packages/console-plugin-sdk/src/utils/extension-i18n.ts (1)
frontend/__mocks__/i18next.ts (1)
  • t (8-14)
frontend/packages/console-app/src/components/console-operator/ConsolePluginDescriptionDetail.tsx (1)
frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts (1)
  • usePluginInfo (25-59)
frontend/packages/console-app/src/components/console-operator/ConsolePluginEnabledStatusDetail.tsx (2)
frontend/packages/console-plugin-sdk/src/api/usePluginInfo.ts (1)
  • usePluginInfo (25-59)
frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx (3)
  • useConsoleOperatorConfigData (66-88)
  • ConsolePluginEnabledStatus (95-134)
  • developmentMode (59-59)
frontend/packages/console-shared/src/hooks/create-resource-hook.ts (3)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/console-types.ts (1)
  • GroupVersionKind (91-91)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • LoadedExtension (40-44)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/create-resource.ts (1)
  • CreateResource (9-17)
frontend/packages/console-plugin-sdk/src/__tests__/store.spec.ts (1)
frontend/packages/console-plugin-sdk/src/store.ts (1)
  • augmentExtension (15-25)
🔇 Additional comments (35)
frontend/packages/console-dynamic-plugin-sdk/README.md (3)

116-118: Version compatibility table consolidation looks good.

The update to consolidate Console versions 4.19.x through 4.21.x under a single PatternFly 6.x entry aligns with the SDK consolidation mentioned in the PR objectives and accurately reflects the current support matrix.


206-212: Documentation updates for Console 4.20.x CSS styling changes are clear.

The addition of styling removal notes (Bootstrap Grid, co-external-link, co-disabled) provides helpful migration guidance for plugin developers. The formatting with the blank line improves readability of the CSP warning section above it.


124-124: Path update verified — documentation is accurate.

The shared modules reference path has been confirmed as correct. The file ./src/shared-modules/shared-modules-meta.ts exists at the documented location and the README change is accurate.

frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-core.md (1)

15-26: Reference citations and formatting look solid.

All new changelog entries properly cite their associated references, and the newly added reference links (CONSOLE-4701, #15735) are correctly ordered. The past review comments regarding the #15738 reference have been resolved.

frontend/packages/console-dynamic-plugin-sdk/src/extensions/user-preferences.ts (1)

3-3: LGTM! Clean migration to ExtensionDeclaration.

The changes consistently migrate from Extension to ExtensionDeclaration across imports and type guards. The type guard logic remains unchanged, only refining the input type, which aligns with the repository-wide SDK consolidation effort described in the PR objectives.

Also applies to: 85-91

frontend/public/i18n.js (1)

78-78: LGTM: Defensive check in place.

The ?? [] correctly handles null/undefined cases for window.SERVER_FLAGS.i18nNamespaces, and the new Set() deduplicates any overlapping namespaces.

frontend/packages/console-app/src/components/user-preferences/perspective/__tests__/perspective.data.ts (1)

3-3: Let me verify whether these types are available from the package root or if importing from /src/types is the only option:

Let me check the actual structure of the @console/dynamic-plugin-sdk package to understand the intended exports:

Let me search for information about this specific refactoring to understand if this is the intended migration pattern:

Imports from /src/types are consistent across the codebase and appear intentional.

The verification shows 41 files across frontend/public and frontend/packages import from @console/dynamic-plugin-sdk/src/types, including production code (not just tests). This widespread pattern aligns with the PR's goal of removing barrel files from @console/plugin-sdk.

While importing from /src/types does couple consumers to the package's internal structure, this appears to be an intentional architectural decision for this refactor. The pattern is established and consistent; the test file change is not anomalous.

Note: If LoadedExtension should be part of the public API, consider adding it to the package root exports to provide a stable import path.

frontend/public/components/utils/async.tsx (3)

1-1: LGTM!

Import changes correctly bring in the necessary types for the refactored AsyncComponent implementation.


16-16: LGTM!

Using the imported ClassComponent alias maintains consistency with the updated import structure.


81-84: LGTM!

The LazyLoader type alias improves code clarity and provides a reusable interface for async component loading across the codebase.

frontend/packages/console-shared/src/components/dashboard/status-card/OperatorStatusBody.tsx (1)

6-6: Type-only LazyLoader import looks correct

Using import type from @console/internal/components/utils/async keeps the existing prop surface while dropping the runtime dependency on @console/plugin-sdk, which matches the PR’s migration goals. No further changes needed here.

frontend/packages/console-dynamic-plugin-sdk/src/extensions/breadcrumbs.ts (1)

2-2: LGTM!

The import and type guard updates align with the migration to ExtensionDeclaration as the canonical extension type. The type guard correctly narrows from ExtensionDeclaration to DetailPageBreadCrumbs.

Also applies to: 25-26

frontend/packages/console-dynamic-plugin-sdk/src/coderefs/__tests__/coderef-resolver.spec.ts (2)

209-210: LGTM!

Good use of local type aliases FooExtension and BarExtension to make test expectations explicit and improve type safety when casting resolved extensions.


253-256: LGTM!

Test data arrays correctly typed as ExtensionDeclaration[], consistent with the migration to the canonical extension type.

Also applies to: 280-295, 315-330, 349-358, 367-370

frontend/packages/console-dynamic-plugin-sdk/src/extensions/cluster-configuration.ts (1)

117-127: LGTM!

Type guards updated consistently to accept ExtensionDeclaration as the input type, with correct narrowing to ClusterConfigurationGroup and ClusterConfigurationItem.

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

2-2: LGTM!

This change addresses the past review comment by consistently replacing Extension with ExtensionDeclaration. The import now sources from @console/dynamic-plugin-sdk/src/types instead of local typings, aligning with the SDK consolidation.

Also applies to: 18-18, 30-33

frontend/packages/console-dynamic-plugin-sdk/src/extensions/catalog.ts (1)

112-140: LGTM!

All six catalog type guards updated consistently to accept ExtensionDeclaration, maintaining proper narrowing to their respective specific types. The changes are purely type-level with no behavioral impact.

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

3-8: ExtensionDeclaration-centric generics look consistent and safe

The new aliasing and generic constraints around LoadedExtension, ExtensionProperties, UpdateExtensionProperties, and ResolvedExtension are consistent with the SDK’s Extension shape and tighten property typing via AnyObject without changing runtime behavior. No issues from a type-safety or compatibility perspective stand out here.

Also applies to: 40-43, 67-76, 88-91

frontend/public/module/k8s/__tests__/get-resources.spec.ts (1)

2-2: Type import switch to dynamic-plugin-sdk is fine

Switching LoadedExtension to come from @console/dynamic-plugin-sdk/src/types keeps the test’s typing consistent with the new SDK source of truth and doesn’t affect runtime behavior.

Also applies to: 61-63

frontend/packages/console-dynamic-plugin-sdk/src/extensions/create-project-modal.ts (1)

2-2: Guard alignment with ExtensionDeclaration is correct

Updating isCreateProjectModal to accept ExtensionDeclaration keeps the guard consistent with the declared CreateProjectModal type while preserving the same runtime discriminant check.

Also applies to: 10-16, 18-19

frontend/packages/console-dynamic-plugin-sdk/src/extensions/details-item.ts (1)

2-2: DetailsItem guards correctly migrated to ExtensionDeclaration

DetailsItem and isDetailsItem now consistently use ExtensionDeclaration, and the left/right helpers still narrow safely based on properties.column. This keeps the public shape and runtime logic intact.

Also applies to: 19-63, 65-72

frontend/packages/console-shared/src/hooks/create-resource-hook.ts (1)

3-3: useCreateResourceExtension remains type-safe after guard update

Using ExtensionDeclaration in the local type guard aligns with isCreateResource and the CreateResource declaration while preserving the existing behavior of useCreateResourceExtension returning a LoadedExtension<CreateResource>.

Also applies to: 7-16

frontend/packages/console-dynamic-plugin-sdk/src/extensions/notification-alert.ts (1)

3-3: AlertAction guard uses the new canonical ExtensionDeclaration type

Switching isAlertAction to accept ExtensionDeclaration matches the declared AlertAction shape and keeps the runtime check unchanged.

Also applies to: 6-16, 18-19

frontend/packages/console-dynamic-plugin-sdk/src/extensions/alerts.ts (1)

2-2: Alert extension guards correctly updated to ExtensionDeclaration

Both isAlertingRulesSource and isAlertingRuleChart now operate on ExtensionDeclaration while keeping their type checks identical, so behavior is preserved and the typings match the declared extension types.

Also applies to: 7-17, 22-30, 34-38

frontend/packages/console-dynamic-plugin-sdk/src/extensions/telemetry.ts (1)

1-21: Telemetry extension guard correctly aligned with ExtensionDeclaration.

Import and isTelemetryListener now consistently use ExtensionDeclaration while preserving the existing runtime check on type. No functional or typing issues here.

frontend/packages/console-dynamic-plugin-sdk/src/extensions/topology.ts (1)

2-119: Topology extension guards cleanly migrated to ExtensionDeclaration.

All topology is* guards now take ExtensionDeclaration and still narrow correctly based on the type literal. This keeps the public surface consistent with the rest of the SDK without changing runtime behavior.

frontend/packages/console-dynamic-plugin-sdk/src/extensions/dashboards.ts (1)

3-3: Dashboards guards consistently refactored to ExtensionDeclaration / ResolvedExtension.

The dashboards extension and resolved-extension guards are now typed around ExtensionDeclaration while retaining the same type-based discrimination. This matches the new SDK type surface and should integrate cleanly with callers using useResolvedExtensions and usePluginInfo.

Also applies to: 221-307

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

120-133: Dependency resolution now matches normalized plugin status values.

Using e.status === 'loaded' for loadedPlugins and e.status === 'failed' for failedPluginNames keeps dependency resolution behavior intact while aligning with the new lowercase status strings.

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

2-16: useTranslatedExtensions generic correctly constrained to ExtensionDeclaration.

Switching to ExtensionDeclaration/LoadedExtension keeps this hook aligned with the new extension type hierarchy while leaving the translation logic untouched.

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

16-58: usePluginInfo hook refactor looks sound

The hook’s simplification to return just DynamicPluginInfo[] keeps the existing subscription/cleanup behavior intact and aligns with the dynamic‑plugin‑sdk API. No new lifecycle or leak issues are apparent, and callers depending on the old tuple are being updated elsewhere in this PR.

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

17-18: Dynamic plugin failure handling matches new plugin info API

Using usePluginInfo() as a direct DynamicPluginInfo[] source and filtering failures via plugin.status === 'failed' is consistent with the updated store typings and test expectations; the notification rendering logic remains unchanged.

Also applies to: 165-235, 246-279

frontend/packages/console-plugin-sdk/src/codegen/active-plugins.ts (1)

10-16: Active plugin test helper typing aligns with new ExtensionDeclaration model

Switching the extension hook to ExtensionDeclaration[] and importing ActivePlugin from the base typings matches how the store models extensions now. This is a clean, type‑only adjustment with no runtime impact.

Also applies to: 79-88

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

9-24: Loaded‑only description logic is correct and type‑safe

Using usePluginInfo() directly and matching by metadata.name only when status === 'loaded' avoids touching metadata on non‑loaded entries, and the final pluginInfo?.status === 'loaded' guard ensures we only render a description for successfully loaded plugins.

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

3-212: Test updates correctly reflect ExtensionDeclaration typing and lowercase statuses

Migrating test fixtures to ExtensionDeclaration and updating all getPluginInfo expectations to the new lowercase status literals ('pending' | 'loaded' | 'failed') keeps these specs aligned with the store’s actual types and behavior. The scenarios around gating, dynamic extension enabling/disabling, and plugin failure still appear well covered.

Also applies to: 285-292, 330-341, 531-541, 585-591, 957-1024

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

12-37: Enabled-status derivation matches new plugin info model

Using usePluginInfo() directly, matching entries by metadata.name only for 'loaded' statuses, and then gating the dev‑mode enabled flag via pluginInfo?.status === 'loaded' && pluginInfo.enabled gives correct behavior for loaded vs pending/failed plugins while keeping the production path tied to consoleOperatorConfig. The added consoleOperatorConfigLoaded && pluginName guard is also a sensible safety check.

@jhadvig
Copy link
Member

jhadvig commented Nov 25, 2025

/test images

@logonoff
Copy link
Member Author

/verified by @logonoff

changes since last verification are type-only and do not affect runtime:

image

in addition I tested my changes against monitoring-plugin and everything continues to work the same as it did

image

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

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

In response to this:

/verified by @logonoff

changes since last verification are type-only and do not affect runtime:

image

in addition I tested my changes against monitoring-plugin and everything continues to work the same as it did

image

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

@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Nov 25, 2025
@logonoff
Copy link
Member Author

reverted last 4 commits

/verified by @logonoff

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

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

In response to this:

reverted last 4 commits

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

@vojtechszocs
Copy link
Contributor

/lgtm

@vojtechszocs
Copy link
Contributor

/label plugin-api-approved

@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. plugin-api-approved Indicates a PR with plugin API changes has been approved by an API reviewer labels Nov 25, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 25, 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

openshift-ci-robot commented Nov 25, 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
  • ExtensionDeclaration renamed to Extension, because there are no more "static extensions". ExtensionDeclaration type is removed and its replacement is the Extension type.
  • The idea of "dynamic" vs "static" extensions are entirely removed, we only have "extensions".
  • @console/plugin-sdk barrel files and type reexports are removed
  • LazyLoader type in @console/plugin-sdk migrated to AsyncComponent because it's only used in that context

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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 26, 2025

@logonoff: all tests passed!

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-merge-bot openshift-merge-bot bot merged commit c6881d1 into openshift:main Nov 26, 2025
8 checks passed
@logonoff logonoff deleted the CONSOLE-3769-s2e22-casino-night branch November 26, 2025 12:00
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/dashboard Related to dashboard component/dev-console Related to dev-console component/sdk Related to console-plugin-sdk component/shared Related to console-shared 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/cypress Related to Cypress e2e integration testing lgtm Indicates that a PR is ready to be merged. plugin-api-approved Indicates a PR with plugin API changes has been approved by an API reviewer plugin-api-changed Categorizes a PR as containing plugin API changes 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.

6 participants