Skip to content

CONSOLE-3769: Update OpenShift Dynamic Plugin SDK + webpack-related deps#15892

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
logonoff:CONSOLE-3769-s3e2-the-convention
Jan 10, 2026
Merged

CONSOLE-3769: Update OpenShift Dynamic Plugin SDK + webpack-related deps#15892
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
logonoff:CONSOLE-3769-s3e2-the-convention

Conversation

@logonoff
Copy link
Member

@logonoff logonoff commented Jan 6, 2026

This PR bumps all OpenShift dynamic plugin SDK, esbuild, and webpack-related deps. Removed hoist-non-react-statics due to non usage

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

openshift-ci-robot commented Jan 6, 2026

@logonoff: This pull request references CONSOLE-3769 which is a valid jira issue.

Details

In response to this:

Depends on #15778

Other notable changes:

  • Removed support for very old Console plugins (where plugin SDK packages used @openshift-console/dynamic-plugin-sdk-webpack 0.x)

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 logonoff marked this pull request as draft January 6, 2026 16:11
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

Walkthrough

Refactors a manifest/type import to type-only and switches PluginManifest to RemotePluginManifest; updates frontend build and SDK dependency versions; changes some imports to ES-module variants; replaces crypto-browserify with Node crypto; broadens a fetch return type and tightens Webpack/Topology TypeScript shapes.

Changes

Cohort / File(s) Summary
Type import & manifest change
frontend/packages/console-dynamic-plugin-sdk/src/build-types.ts
Converted several imports to type-only and changed ConsolePluginManifest to extend RemotePluginManifest instead of PluginManifest.
Build & SDK dependency updates
frontend/package.json, frontend/packages/console-dynamic-plugin-sdk/package.json
Removed crypto-browserify and hoist-non-react-statics from deps; bumped multiple tooling/runtime versions (webpack ~5.100.0, webpack-cli ^6.0.1, typescript 5.9.3, @openshift dynamic-plugin-sdk packages to ^6.0.0/^5.0.0, etc.).
Module variant imports (i18n/pseudo)
frontend/packages/console-app/src/components/quick-starts/utils/quick-start-context.tsx, frontend/public/i18n.js
Switched imports from i18next-pseudo to i18next-pseudo/es.
Crypto migration
frontend/packages/console-shared/src/hooks/useUserSettings.ts
Replaced createHash import from crypto-browserify with Node built-in crypto.
Return type broadened
frontend/packages/shipwright-plugin/src/components/logs/tekton-results.ts
fetchTaskRunLogs return type changed from Promise<T> to `Promise<T
Topology factories & webpack signature refinements
frontend/packages/topology/src/data-transforms/DataModelProvider.tsx, frontend/webpack.config.ts
Normalized static factory shape and adjusted resolvedFactories typing; changed Webpack cacheGroup test to webpack.NormalModule; removed overlay options when instantiating ReactRefreshWebpackPlugin().
Changelog
frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-webpack.md
Added 4.22.0-prerelease.1 entry noting breaking requirement for webpack ^5.100.0 and new issue/PR references.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

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

📥 Commits

Reviewing files that changed from the base of the PR and between 620f452 and 905cbbb.

⛔ Files ignored due to path filters (1)
  • frontend/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (10)
  • frontend/package.json
  • frontend/packages/console-app/src/components/quick-starts/utils/quick-start-context.tsx
  • frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-webpack.md
  • frontend/packages/console-dynamic-plugin-sdk/package.json
  • frontend/packages/console-dynamic-plugin-sdk/src/build-types.ts
  • frontend/packages/console-shared/src/hooks/useUserSettings.ts
  • frontend/packages/shipwright-plugin/src/components/logs/tekton-results.ts
  • frontend/packages/topology/src/data-transforms/DataModelProvider.tsx
  • frontend/public/i18n.js
  • frontend/webpack.config.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • frontend/webpack.config.ts
  • frontend/packages/console-dynamic-plugin-sdk/package.json
  • frontend/package.json
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

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

Files:

  • frontend/public/i18n.js
  • frontend/packages/console-shared/src/hooks/useUserSettings.ts
  • frontend/packages/console-app/src/components/quick-starts/utils/quick-start-context.tsx
  • frontend/packages/shipwright-plugin/src/components/logs/tekton-results.ts
  • frontend/packages/topology/src/data-transforms/DataModelProvider.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/build-types.ts
  • frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-webpack.md
🧬 Code graph analysis (2)
frontend/packages/shipwright-plugin/src/components/logs/tekton-results.ts (1)
pkg/devconsole/tekton-results/types.go (1)
  • TaskRunLogRequest (13-15)
frontend/packages/topology/src/data-transforms/DataModelProvider.tsx (1)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/topology.ts (1)
  • TopologyDataModelFactory (36-54)
🔇 Additional comments (7)
frontend/packages/topology/src/data-transforms/DataModelProvider.tsx (1)

31-39: LGTM! Improved type safety and structural consistency.

The type refinement using Omit correctly ensures that resolved factories always have resources as WatchK8sResourcesGeneric (not a CodeRef), and the updated return structure for static resources (lines 75-78) now matches the async resolution path (lines 57-60), creating a uniform shape across both code paths. This improves maintainability and type safety.

Also applies to: 75-78

frontend/packages/console-shared/src/hooks/useUserSettings.ts (1)

1-1: No action required. The webpack configuration already includes NodePolyfillPlugin (line 291 of frontend/webpack.config.ts), which automatically provides polyfills for Node.js built-in modules including crypto in browser contexts. The import change from crypto-browserify to crypto is properly supported by the existing bundler setup.

Likely an incorrect or invalid review comment.

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

13-16: LGTM! Changelog entry is properly documented.

The prerelease entry correctly marks the webpack minimum version increase as a breaking change and follows the established changelog format.

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

1-5: LGTM! Type-only imports follow best practices.

Using import type syntax is the correct approach since these imports are only used in type positions, ensuring they are fully erased from the emitted JavaScript.


52-52: Type change is compatible across the codebase.

The shift to extend RemotePluginManifest is sound and well-integrated. The type correctly intersects RemotePluginManifest with console-specific properties (customProperties and extra metadata), and all usages throughout the codebase—including runtime loading, plugin store integration, and test utilities—are compatible with this structure. No breaking changes or type incompatibilities detected.

frontend/packages/console-app/src/components/quick-starts/utils/quick-start-context.tsx (1)

9-9: The import path change to 'i18next-pseudo/es' is safe and properly supported. The i18next-pseudo@2.2.1 library (as specified in package.json) includes the ES module export. The Pseudo class constructor remains compatible with this ES variant.

frontend/packages/shipwright-plugin/src/components/logs/tekton-results.ts (1)

417-438: Verify how getTaskRunLog calls fetchTaskRunLogs and confirm type handling.

The return type broadened from Promise<T> to Promise<T | string> reflects the implementation can return either parsed JSON (type T) or raw string. However, if getTaskRunLog calls fetchTaskRunLogs without an explicit type parameter, TypeScript will infer T as any from JSON.parse(), potentially masking a type mismatch at runtime if logs contain JSON-structured data rather than plain strings.

Confirm:

  • Whether getTaskRunLog explicitly passes a type parameter when calling fetchTaskRunLogs (e.g., fetchTaskRunLogs<string>())
  • Whether task run logs are always plain strings or can be JSON objects
  • If logs can be JSON, ensure the caller properly handles the T | string union type

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

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 6, 2026
@openshift-ci openshift-ci bot added component/core Related to console core functionality component/dashboard Related to dashboard approved Indicates a PR has been approved by an approver from all required OWNERS files. 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 plugin-api-changed Categorizes a PR as containing plugin API changes labels Jan 6, 2026
Copy link
Contributor

@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: 5

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-dynamic-plugin-sdk/src/extensions/feature-flags.ts (1)

5-31: Complete the migration guide referenced in CHANGELOG before release.

The type changes from ExtensionDeclaration<...> to Extension<...> are correctly implemented and no old type references remain in the codebase. However, the CHANGELOG for version 4.22.0-prerelease.1 references upgrade-sdk.md for migration details, but the upgrade guide section for 4.22 is incomplete (marked TODO). This migration guidance must be completed before the release to help plugin authors adapt to the breaking changes.

🤖 Fix all issues with AI Agents
In
@frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx:
- Around line 338-349: The CSP violations lookup is inconsistent: change the
lookup key to use the plugin manifest name (the same identification used to find
pluginInfo) rather than plugin?.metadata?.name; specifically, in the block
handling loadedPluginInfo/notLoadedPluginInfo replace
cspViolations[plugin?.metadata?.name] with cspViolations[plugin?.manifest?.name]
(or use loadedPluginInfo?.manifest?.name / notLoadedPluginInfo?.manifest?.name
as appropriate) so pluginName, pluginInfo, loadedPluginInfo, notLoadedPluginInfo
and cspViolations all use manifest.name consistently.

In @frontend/packages/console-dynamic-plugin-sdk/src/app/useReduxStore.ts:
- Line 5: The SDK store is missing the FLAGS reducer so featureFlagMiddleware
(which calls s.getState().FLAGS.toObject()) will throw; fix by adding the FLAGS
reducer to SDKReducers alongside sdkCore and k8s (import and include the
existing FLAGS reducer implementation) or, alternatively, only apply
featureFlagMiddleware in useReduxStore when the created store's state contains
FLAGS (e.g., check s.getState().FLAGS !== undefined before using/applying
middleware) so featureFlagMiddleware never runs against an undefined FLAGS.

In @frontend/packages/console-dynamic-plugin-sdk/upgrade-sdk.md:
- Around line 3-4: The 4.22 upgrade notes are still a TODO and must be completed
or deferred; update the "## 4.22" section in upgrade-sdk.md to list the breaking
changes introduced (e.g., removal of legacy plugin support and any refactors),
provide concrete migration steps for plugin authors (how to replace legacy APIs,
updated entry points, config keys, and examples), and include links to any
renamed functions/classes and sample diffs, or alternatively remove the
placeholder and move the full migration guide to a follow-up docs PR so this
branch does not ship incomplete guidance.

In @frontend/packages/console-plugin-sdk/src/codegen/active-plugins.ts:
- Line 15: The generated module from getActivePluginsModule is missing the
required version field for ActivePlugin; update the activePlugins.push(...) call
inside getActivePluginsModule to include version: '${pkg.version}' alongside
name and extensions so the produced objects match the ActivePlugin type and
mirror loadActivePluginsForTestPurposes (which already uses version).

In @frontend/public/reducers/features.ts:
- Around line 75-80: The code weakens type safety by casting
pluginStore.getExtensions().filter(isModelFeatureFlag) to any and also uses
referenceForModel incorrectly for ExtensionK8sModel; update the logic to
preserve types and use the correct reference function: remove the `as any` cast
by narrowing the array with the isModelFeatureFlag type guard so the items are
typed as ExtensionK8sModel, then call
addToCRDs(referenceForExtensionModel(ff.properties.model), ff.properties.flag)
instead of referenceForModel; if immediate SDK migration isn't possible, add a
runtime type check/assert around ff.properties.model to ensure it matches
ExtensionK8sModel shape before calling referenceForExtensionModel to avoid
runtime errors.
🧹 Nitpick comments (6)
frontend/packages/console-plugin-sdk/src/api/pluginSubscriptionService.ts (1)

44-88: Remove unused feature flag tracking code.

Feature flags are retrieved and tracked (lines 44, 46, 67-68, 76, 78, 83) but are no longer used after the removal of flag-based filtering. This is dead code that can be cleaned up.

🔎 Suggested cleanup
  const getExtensions = () => pluginStore.getExtensions();
- const getFlags = () => reduxStore.getState().FLAGS;
-
- type FeatureFlags = ReturnType<typeof getFlags>;

  const invokeExtensionListener = (sub: ExtensionSubscription, currentExtensions: Extension[]) => {
    // Narrow extensions according to type guards
    const matchedExtensions = _.flatMap(sub.typeGuards.map((tg) => currentExtensions.filter(tg)));

    // Invoke listener only if the extension list has changed
    if (!_.isEqual(matchedExtensions, sub.listenerLastArgs)) {
      sub.listenerLastArgs = matchedExtensions;
      sub.listener(matchedExtensions);
    }
  };

  onExtensionSubscriptionAdded = (sub) => {
    invokeExtensionListener(sub, getExtensions());
  };

  onDynamicPluginListenerAdded = (listener) => {
    listener(pluginStore.getPluginInfo());
  };

  let lastExtensions: Extension[] = null;
- let lastFlags: FeatureFlags = null;

  const invokeAllExtensionListeners = () => {
    if (extensionSubscriptions.length === 0) {
      return;
    }

    const nextExtensions = getExtensions();
-   const nextFlags = getFlags();

-   if (_.isEqual(nextExtensions, lastExtensions) && nextFlags === lastFlags) {
+   if (_.isEqual(nextExtensions, lastExtensions)) {
      return;
    }

    lastExtensions = nextExtensions;
-   lastFlags = nextFlags;

    extensionSubscriptions.forEach((sub) => {
      invokeExtensionListener(sub, nextExtensions);
    });
  };
frontend/packages/console-plugin-sdk/src/store.ts (1)

51-60: Consider clarifying the testing-only nature of this implementation.

The JSDoc on line 51-53 states this is "intended for testing purposes," but the class is exported publicly. The options parameter (line 57) is typed as {} but unused beyond passing to super(). Consider adding a more explicit type or removing if not needed.

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

16-20: Consider stronger typing for console custom properties.

The as any cast at Line 17 suppresses type checking when accessing manifest.customProperties?.console. This could mask type mismatches or missing properties.

🔎 Proposed fix for type safety

Define a proper interface for the console custom properties:

interface ConsoleCustomProperties {
  console?: {
    description?: string;
  };
}

// Then use it with proper typing:
const description = (pluginInfo.manifest.customProperties as ConsoleCustomProperties)?.console?.description || DASH;
frontend/packages/console-dynamic-plugin-sdk/src/extensions/guided-tour.ts (1)

4-4: Import path inconsistency with peer files

This file uses an absolute import path @console/dynamic-plugin-sdk/src/types, while other files in the same extensions/ directory use the relative path ../types. Consider using the relative import for consistency with the rest of the codebase.

🔎 Proposed fix
-import type { Extension, CodeRef } from '@console/dynamic-plugin-sdk/src/types';
+import type { Extension, CodeRef } from '../types';
frontend/packages/console-dynamic-plugin-sdk/src/extensions/pages.ts (1)

41-47: Remove unnecessary & {} intersections.

The & {} intersections on ResourceListPage and ResourceDetailsPage are redundant since intersecting with an empty object type has no effect.

🔎 Suggested simplification
-export type ResourceListPage = Extension<'console.page/resource/list', ResourcePageProperties & {}>;
+export type ResourceListPage = Extension<'console.page/resource/list', ResourcePageProperties>;

 /** Adds new resource details page to Console router. */
-export type ResourceDetailsPage = Extension<
-  'console.page/resource/details',
-  ResourcePageProperties & {}
->;
+export type ResourceDetailsPage = Extension<'console.page/resource/details', ResourcePageProperties>;
frontend/public/plugins.ts (1)

37-46: Consider stronger typing for the middleware.

The middleware currently uses any types for next and action parameters, reducing type safety. Consider using Redux's Middleware type for better type checking:

import type { Middleware } from 'redux';

export const featureFlagMiddleware: Middleware<{}, RootState> = 
  (store) => (next) => (action) => {
    const result = next(action);
    pluginStore.setFeatureFlags(store.getState().FLAGS.toObject());
    return result;
  };

This middleware runs on every dispatched action. While likely necessary for synchronization, be mindful of performance if the flag set is large or actions are frequent.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

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

📥 Commits

Reviewing files that changed from the base of the PR and between d00353d and 6341d35.

📒 Files selected for processing (111)
  • frontend/packages/console-app/src/__tests__/plugin-test-utils.ts
  • frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginDescriptionDetail.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginEnabledStatusDetail.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginManifestPage.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginStatusDetail.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginVersionDetail.tsx
  • 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/NotLoadedDynamicPlugins.tsx
  • frontend/packages/console-app/src/components/detect-perspective/__tests__/PerspectiveDetector.spec.tsx
  • frontend/packages/console-app/src/components/nav/NavSection.tsx
  • frontend/packages/console-app/src/components/nav/PluginNavItem.tsx
  • frontend/packages/console-app/src/components/nav/useNavExtensionForPerspective.ts
  • frontend/packages/console-app/src/components/nav/useNavExtensionsForSection.ts
  • frontend/packages/console-app/src/components/nav/utils.ts
  • frontend/packages/console-app/src/components/user-preferences/perspective/PreferredPerspectiveSelect.tsx
  • frontend/packages/console-app/src/components/user-preferences/perspective/__tests__/perspective.data.ts
  • frontend/packages/console-app/src/hooks/useCSPViolationDetector.tsx
  • frontend/packages/console-app/src/hooks/usePluginRoutes.tsx
  • frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-core.md
  • frontend/packages/console-dynamic-plugin-sdk/README.md
  • frontend/packages/console-dynamic-plugin-sdk/scripts/generate-schema.ts
  • frontend/packages/console-dynamic-plugin-sdk/scripts/parsers/ExtensionParser.ts
  • frontend/packages/console-dynamic-plugin-sdk/scripts/utils/type-resolver.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/api/useResolvedExtensions.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/app/useReduxStore.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/build-types.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/coderefs/__tests__/coderef-resolver.spec.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/coderefs/coderef-resolver.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/actions.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/add-actions.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/alerts.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/breadcrumbs.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/catalog.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/cluster-configuration.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/cluster-overview.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/cluster-settings.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/console-types.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/context-providers.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/create-project-modal.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/create-resource.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/custom.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/dashboard-data-source.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/dashboards.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/details-item.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/feature-flags.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/file-upload.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/guided-tour.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/horizontal-nav-tabs.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/import-environments.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/navigation.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/node.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/notification-alert.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/pages.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/perspectives.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/project-overview.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/pvc.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/redux.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/resource-metadata.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/storage-class-provisioner.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/storage-provider.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/telemetry.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/topology-details.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/topology.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/user-preferences.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/yaml-templates.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/__tests__/plugin-dependencies.spec.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/__tests__/plugin-loader.spec.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-dependencies.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-init.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-loader.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-utils.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/schema/plugin-manifest.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/types.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/utils/k8s/k8s-utils.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/utils/test-utils.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/validation/__tests__/ExtensionValidator.spec.ts
  • frontend/packages/console-dynamic-plugin-sdk/upgrade-sdk.md
  • frontend/packages/console-plugin-sdk/src/__tests__/store.spec.ts
  • frontend/packages/console-plugin-sdk/src/api/pluginSubscriptionService.ts
  • frontend/packages/console-plugin-sdk/src/api/useExtensions.ts
  • frontend/packages/console-plugin-sdk/src/codegen/__tests__/active-plugins.spec.ts
  • frontend/packages/console-plugin-sdk/src/codegen/active-plugins.ts
  • frontend/packages/console-plugin-sdk/src/index.ts
  • frontend/packages/console-plugin-sdk/src/store.ts
  • frontend/packages/console-plugin-sdk/src/typings/base.ts
  • frontend/packages/console-plugin-sdk/src/typings/index.ts
  • frontend/packages/console-plugin-sdk/src/utils/__tests__/extension-i18n.spec.ts
  • frontend/packages/console-plugin-sdk/src/utils/extension-i18n.ts
  • frontend/packages/console-shared/src/components/actions/__tests__/utils-test-data.ts
  • frontend/packages/console-shared/src/components/actions/utils.ts
  • frontend/packages/console-shared/src/components/dashboard/status-card/OperatorStatusBody.tsx
  • frontend/packages/console-shared/src/hooks/create-resource-hook.ts
  • frontend/packages/console-shared/src/hooks/perspective-utils.ts
  • frontend/packages/console-shared/src/utils/sample-utils.ts
  • frontend/packages/dev-console/src/components/add/AddCardSection.tsx
  • frontend/packages/dev-console/src/components/add/__tests__/add-page-test-data.tsx
  • frontend/packages/dev-console/src/components/import/import-types.ts
  • frontend/packages/topology/src/components/workload/utils.ts
  • frontend/public/actions/flags.ts
  • frontend/public/components/about-modal.tsx
  • frontend/public/components/dashboard/dashboards-page/cluster-dashboard/health-item.tsx
  • frontend/public/components/notification-drawer.tsx
  • frontend/public/components/utils/__tests__/nav.spec.ts
  • frontend/public/components/utils/async.tsx
  • frontend/public/module/k8s/__tests__/get-resources.spec.ts
  • frontend/public/module/k8s/get-resources.ts
  • frontend/public/module/k8s/k8s-models.ts
  • frontend/public/plugins.ts
  • frontend/public/reducers/features.ts
  • frontend/public/redux.ts
💤 Files with no reviewable changes (7)
  • frontend/packages/console-dynamic-plugin-sdk/src/utils/k8s/k8s-utils.ts
  • frontend/packages/console-plugin-sdk/src/typings/index.ts
  • frontend/packages/console-plugin-sdk/src/index.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/tests/plugin-loader.spec.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-init.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/tests/plugin-dependencies.spec.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/packages/console-plugin-sdk/src/utils/__tests__/extension-i18n.spec.ts
  • frontend/public/actions/flags.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/validation/__tests__/ExtensionValidator.spec.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/schema/plugin-manifest.ts
  • frontend/packages/console-app/src/components/detect-perspective/__tests__/PerspectiveDetector.spec.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginEnabledStatusDetail.tsx
  • frontend/public/module/k8s/get-resources.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/file-upload.ts
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginStatusDetail.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-dependencies.ts
  • frontend/packages/console-dynamic-plugin-sdk/upgrade-sdk.md
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/notification-alert.ts
  • frontend/packages/console-app/src/components/nav/useNavExtensionsForSection.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/utils/test-utils.ts
  • frontend/public/components/about-modal.tsx
  • frontend/packages/console-shared/src/hooks/create-resource-hook.ts
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginManifestPage.tsx
  • frontend/packages/console-shared/src/components/dashboard/status-card/OperatorStatusBody.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginVersionDetail.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-utils.ts
  • frontend/packages/console-app/src/hooks/usePluginRoutes.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/horizontal-nav-tabs.ts
  • frontend/packages/console-plugin-sdk/src/utils/extension-i18n.ts
  • frontend/packages/console-dynamic-plugin-sdk/scripts/utils/type-resolver.ts
  • frontend/packages/console-shared/src/components/actions/utils.ts
  • frontend/public/reducers/features.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/guided-tour.ts
  • frontend/packages/console-shared/src/components/actions/__tests__/utils-test-data.ts
  • frontend/packages/console-app/src/components/nav/utils.ts
  • frontend/public/module/k8s/k8s-models.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/storage-class-provisioner.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/custom.ts
  • frontend/packages/console-app/src/components/nav/useNavExtensionForPerspective.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/redux.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/dashboard-data-source.ts
  • frontend/packages/console-app/src/hooks/useCSPViolationDetector.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/perspectives.ts
  • frontend/packages/console-dynamic-plugin-sdk/scripts/generate-schema.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/breadcrumbs.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/app/useReduxStore.ts
  • frontend/packages/console-dynamic-plugin-sdk/README.md
  • frontend/packages/console-dynamic-plugin-sdk/scripts/parsers/ExtensionParser.ts
  • frontend/public/module/k8s/__tests__/get-resources.spec.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/user-preferences.ts
  • frontend/packages/console-app/src/__tests__/plugin-test-utils.ts
  • frontend/packages/topology/src/components/workload/utils.ts
  • frontend/public/components/utils/async.tsx
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/DynamicPluginsPopover.tsx
  • frontend/packages/console-shared/src/utils/sample-utils.ts
  • frontend/packages/console-app/src/components/nav/PluginNavItem.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/coderefs/coderef-resolver.ts
  • frontend/packages/console-plugin-sdk/src/codegen/__tests__/active-plugins.spec.ts
  • frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-core.md
  • frontend/packages/console-dynamic-plugin-sdk/src/api/useResolvedExtensions.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/details-item.ts
  • frontend/packages/console-app/src/components/user-preferences/perspective/__tests__/perspective.data.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/add-actions.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/yaml-templates.ts
  • frontend/packages/dev-console/src/components/import/import-types.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/build-types.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/create-resource.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/create-project-modal.ts
  • frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/NotLoadedDynamicPlugins.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/feature-flags.ts
  • frontend/public/redux.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/project-overview.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/context-providers.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/pages.ts
  • frontend/packages/console-shared/src/hooks/perspective-utils.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/cluster-configuration.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/resource-metadata.ts
  • frontend/public/plugins.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/telemetry.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/console-types.ts
  • frontend/packages/console-plugin-sdk/src/typings/base.ts
  • frontend/packages/dev-console/src/components/add/AddCardSection.tsx
  • frontend/packages/console-app/src/components/nav/NavSection.tsx
  • frontend/packages/console-plugin-sdk/src/api/pluginSubscriptionService.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/topology-details.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/navigation.ts
  • frontend/packages/console-plugin-sdk/src/codegen/active-plugins.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-loader.ts
  • frontend/packages/console-plugin-sdk/src/api/useExtensions.ts
  • frontend/public/components/utils/__tests__/nav.spec.ts
  • frontend/packages/console-app/src/components/console-operator/ConsolePluginDescriptionDetail.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/dashboards.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/import-environments.ts
  • frontend/public/components/notification-drawer.tsx
  • frontend/packages/dev-console/src/components/add/__tests__/add-page-test-data.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/node.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/cluster-overview.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/cluster-settings.ts
  • frontend/public/components/dashboard/dashboards-page/cluster-dashboard/health-item.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/storage-provider.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/alerts.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/actions.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/pvc.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/types.ts
  • frontend/packages/console-app/src/components/user-preferences/perspective/PreferredPerspectiveSelect.tsx
  • frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/topology.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/coderefs/__tests__/coderef-resolver.spec.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/catalog.ts
  • frontend/packages/console-plugin-sdk/src/store.ts
🧬 Code graph analysis (33)
frontend/packages/console-dynamic-plugin-sdk/src/schema/plugin-manifest.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/build-types.ts (1)
  • ConsolePluginManifest (43-49)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/file-upload.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • Extension (12-12)
frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-dependencies.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/build-types.ts (1)
  • ConsolePluginManifest (43-49)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/notification-alert.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • Extension (12-12)
frontend/packages/console-dynamic-plugin-sdk/src/utils/test-utils.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/build-types.ts (1)
  • ConsolePluginManifest (43-49)
frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-utils.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/build-types.ts (1)
  • ConsolePluginManifest (43-49)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/horizontal-nav-tabs.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • Extension (12-12)
frontend/packages/console-dynamic-plugin-sdk/scripts/utils/type-resolver.ts (1)
frontend/packages/console-dynamic-plugin-sdk/scripts/utils/typescript.ts (1)
  • getTypeReferenceNode (55-60)
frontend/public/reducers/features.ts (2)
frontend/public/plugins.ts (1)
  • pluginStore (30-30)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/feature-flags.ts (1)
  • isModelFeatureFlag (37-38)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/storage-class-provisioner.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • Extension (12-12)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/dashboard-data-source.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • Extension (12-12)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/perspectives.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • Extension (12-12)
frontend/packages/console-dynamic-plugin-sdk/scripts/generate-schema.ts (1)
frontend/packages/console-dynamic-plugin-sdk/scripts/parsers/ExtensionParser.ts (1)
  • ExtensionParser (10-38)
frontend/packages/console-dynamic-plugin-sdk/src/app/useReduxStore.ts (1)
frontend/public/plugins.ts (1)
  • featureFlagMiddleware (40-46)
frontend/public/components/utils/async.tsx (2)
frontend/public/components/factory/table.tsx (1)
  • ComponentProps (733-738)
frontend/packages/console-shared/src/components/loading/LoadingBox.tsx (1)
  • LoadingBox (20-31)
frontend/packages/console-dynamic-plugin-sdk/src/coderefs/coderef-resolver.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (2)
  • Extension (12-12)
  • ExtensionProperties (47-47)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/create-project-modal.ts (2)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/console-types.ts (1)
  • K8sResourceCommon (67-71)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • Extension (12-12)
frontend/packages/console-app/src/components/dashboards-page/dynamic-plugins-health-resource/NotLoadedDynamicPlugins.tsx (1)
frontend/public/models/index.ts (1)
  • ConsolePluginModel (1296-1311)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/feature-flags.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • Extension (12-12)
frontend/public/redux.ts (1)
frontend/public/plugins.ts (1)
  • featureFlagMiddleware (40-46)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/project-overview.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • Extension (12-12)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/pages.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • Extension (12-12)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/resource-metadata.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • Extension (12-12)
frontend/public/plugins.ts (2)
frontend/packages/console-plugin-sdk/src/store.ts (1)
  • PluginStore (54-81)
frontend/public/redux.ts (1)
  • RootState (20-28)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/navigation.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • Extension (12-12)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/dashboards.ts (2)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • Extension (12-12)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/console-types.ts (1)
  • K8sResourceCommon (67-71)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/import-environments.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • Extension (12-12)
frontend/public/components/notification-drawer.tsx (2)
frontend/public/components/utils/resource-link.tsx (1)
  • resourcePath (54-66)
frontend/public/models/index.ts (1)
  • ConsolePluginModel (1296-1311)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/node.ts (2)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/console-types.ts (1)
  • ResourcesObject (200-200)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • Extension (12-12)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/cluster-overview.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • Extension (12-12)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/cluster-settings.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • Extension (12-12)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/catalog.ts (1)
frontend/packages/console-dynamic-plugin-sdk/src/types.ts (1)
  • Extension (12-12)
frontend/packages/console-plugin-sdk/src/store.ts (1)
frontend/packages/console-plugin-sdk/src/typings/base.ts (1)
  • ActivePlugin (7-11)

Comment on lines 338 to 349
.find((i) => i?.manifest?.name === pluginName);
const notLoadedPluginInfo = pluginInfo
.filter((p) => p.status !== 'loaded')
.find((i) => i?.pluginName === pluginName);
.find((i) => i?.manifest?.name === pluginName);
if (loadedPluginInfo) {
return {
name: plugin?.metadata?.name,
version: loadedPluginInfo?.metadata?.version,
description: loadedPluginInfo?.metadata?.customProperties?.console?.description,
version: loadedPluginInfo?.manifest?.version,
description: (loadedPluginInfo?.manifest?.customProperties?.console as any)?.description,
enabled,
status: loadedPluginInfo?.status,
hasCSPViolations: cspViolations[plugin.metadata.name] ?? false,
hasCSPViolations: cspViolations[plugin?.metadata?.name] ?? false,
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Inconsistent CSP violations lookup on Line 349.

Line 349 uses plugin?.metadata?.name for the CSP violations lookup, while DevPluginsPage at Line 310 uses plugin.manifest.name. This inconsistency contradicts the stated goal of migrating to manifest-based identification.

Since pluginName (from plugin?.metadata?.name at Line 334) is used to find matching pluginInfo by comparing manifest.name (Lines 338, 341), the lookup should also use manifest.name for consistency.

🔎 Proposed fix
       if (loadedPluginInfo) {
         return {
           name: plugin?.metadata?.name,
           version: loadedPluginInfo?.manifest?.version,
           description: (loadedPluginInfo?.manifest?.customProperties?.console as any)?.description,
           enabled,
           status: loadedPluginInfo?.status,
-          hasCSPViolations: cspViolations[plugin?.metadata?.name] ?? false,
+          hasCSPViolations: cspViolations[loadedPluginInfo?.manifest?.name] ?? false,
         };
       }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.find((i) => i?.manifest?.name === pluginName);
const notLoadedPluginInfo = pluginInfo
.filter((p) => p.status !== 'loaded')
.find((i) => i?.pluginName === pluginName);
.find((i) => i?.manifest?.name === pluginName);
if (loadedPluginInfo) {
return {
name: plugin?.metadata?.name,
version: loadedPluginInfo?.metadata?.version,
description: loadedPluginInfo?.metadata?.customProperties?.console?.description,
version: loadedPluginInfo?.manifest?.version,
description: (loadedPluginInfo?.manifest?.customProperties?.console as any)?.description,
enabled,
status: loadedPluginInfo?.status,
hasCSPViolations: cspViolations[plugin.metadata.name] ?? false,
hasCSPViolations: cspViolations[plugin?.metadata?.name] ?? false,
.find((i) => i?.manifest?.name === pluginName);
const notLoadedPluginInfo = pluginInfo
.filter((p) => p.status !== 'loaded')
.find((i) => i?.manifest?.name === pluginName);
if (loadedPluginInfo) {
return {
name: plugin?.metadata?.name,
version: loadedPluginInfo?.manifest?.version,
description: (loadedPluginInfo?.manifest?.customProperties?.console as any)?.description,
enabled,
status: loadedPluginInfo?.status,
hasCSPViolations: cspViolations[loadedPluginInfo?.manifest?.name] ?? false,
🤖 Prompt for AI Agents
In
@frontend/packages/console-app/src/components/console-operator/ConsoleOperatorConfig.tsx
around lines 338 - 349, The CSP violations lookup is inconsistent: change the
lookup key to use the plugin manifest name (the same identification used to find
pluginInfo) rather than plugin?.metadata?.name; specifically, in the block
handling loadedPluginInfo/notLoadedPluginInfo replace
cspViolations[plugin?.metadata?.name] with cspViolations[plugin?.manifest?.name]
(or use loadedPluginInfo?.manifest?.name / notLoadedPluginInfo?.manifest?.name
as appropriate) so pluginName, pluginInfo, loadedPluginInfo, notLoadedPluginInfo
and cspViolations all use manifest.name consistently.

import { useStore } from 'react-redux';
import { applyMiddleware, combineReducers, createStore, compose, Store } from 'redux';
import thunk from 'redux-thunk';
import { featureFlagMiddleware } from '@console/internal/plugins';
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify FLAGS reducer is included in SDKReducers and check pluginStore initialization

# Check if FLAGS is included in SDKReducers
echo "=== Checking SDKReducers for FLAGS ===" 
rg -nP --type=ts -A10 'export const SDKReducers' frontend/packages/console-dynamic-plugin-sdk/src/app/redux.ts

# Check pluginStore initialization relative to middleware usage
echo -e "\n=== Checking pluginStore initialization ===" 
rg -nP --type=ts 'pluginStore.*=' frontend/packages/console-dynamic-plugin-sdk/ frontend/public/

Repository: openshift/console

Length of output: 1149


🏁 Script executed:

# Check the full useReduxStore.ts file to see the context
echo "=== Full useReduxStore.ts file ===" 
cat -n frontend/packages/console-dynamic-plugin-sdk/src/app/useReduxStore.ts

Repository: openshift/console

Length of output: 2093


🏁 Script executed:

# Check featureFlagMiddleware implementation
echo "=== Checking featureFlagMiddleware implementation ===" 
rg -nP --type=ts -B5 -A10 'featureFlagMiddleware' frontend/packages/console-dynamic-plugin-sdk/src/

Repository: openshift/console

Length of output: 3313


🏁 Script executed:

# Check if FLAGS is defined in SDKReducers
echo "=== Checking for FLAGS definition ===" 
rg -nP --type=ts 'FLAGS' frontend/packages/console-dynamic-plugin-sdk/src/app/redux.ts

Repository: openshift/console

Length of output: 98


🏁 Script executed:

# Find where featureFlagMiddleware is defined
echo "=== Locating featureFlagMiddleware implementation ===" 
fd -t f "plugins" frontend/packages/console-internal/ | head -20

# Search for featureFlagMiddleware in the entire codebase
echo -e "\n=== Searching for featureFlagMiddleware definition ===" 
rg -nP --type=ts -B5 -A15 'export.*featureFlagMiddleware' frontend/packages/

Repository: openshift/console

Length of output: 310


🏁 Script executed:

# Check what featureFlagMiddleware accesses
echo "=== Checking featureFlagMiddleware for FLAGS access ===" 
rg -nP --type=ts 'FLAGS' frontend/packages/console-internal/ --max-count=20

Repository: openshift/console

Length of output: 209


🏁 Script executed:

# Search for featureFlagMiddleware definition across entire repo
echo "=== Searching for featureFlagMiddleware definition ===" 
rg -nP --type=ts 'export.*featureFlagMiddleware|const featureFlagMiddleware'

# Check tsconfig for path aliases
echo -e "\n=== Checking path aliases ===" 
rg -nP '@console/internal' frontend/ --max-count=5

Repository: openshift/console

Length of output: 50374


🏁 Script executed:

# Look for plugins directory
echo "=== Finding plugins directory ===" 
fd -type d "plugins" frontend/

# Search for featureFlagMiddleware more broadly
echo -e "\n=== Broad search for featureFlagMiddleware ===" 
rg -nP 'featureFlagMiddleware' --max-count=20

Repository: openshift/console

Length of output: 922


🏁 Script executed:

# Get the full featureFlagMiddleware implementation
cat -n frontend/public/plugins.ts | sed -n '35,65p'

Repository: openshift/console

Length of output: 960


🏁 Script executed:

# Also check the main store setup in redux.ts for comparison
echo "=== Frontend redux.ts store setup ===" 
cat -n frontend/public/redux.ts | sed -n '1,50p'

Repository: openshift/console

Length of output: 2050


🏁 Script executed:

# Check the featureReducerName value
echo "=== Checking featureReducerName ===" 
rg -n 'featureReducerName|FLAGS' frontend/public/reducers/features.ts | head -20

Repository: openshift/console

Length of output: 1348


🏁 Script executed:

# Check SDKReducers definition
echo "=== SDK Reducers definition ===" 
cat -n frontend/packages/console-dynamic-plugin-sdk/src/app/redux.ts

Repository: openshift/console

Length of output: 619


FLAGS reducer is missing from SDKReducers, causing featureFlagMiddleware to fail at runtime.

The middleware calls s.getState().FLAGS.toObject() after each action, but the SDK store is created with only SDKReducers (which contains only sdkCore and k8s). When featureFlagMiddleware executes in standalone SDK mode, it will attempt to access an undefined FLAGS state and throw an error.

Add the FLAGS reducer to SDKReducers or conditionally apply the middleware only when FLAGS is available in the store state.

🤖 Prompt for AI Agents
In @frontend/packages/console-dynamic-plugin-sdk/src/app/useReduxStore.ts at
line 5, The SDK store is missing the FLAGS reducer so featureFlagMiddleware
(which calls s.getState().FLAGS.toObject()) will throw; fix by adding the FLAGS
reducer to SDKReducers alongside sdkCore and k8s (import and include the
existing FLAGS reducer implementation) or, alternatively, only apply
featureFlagMiddleware in useReduxStore when the created store's state contains
FLAGS (e.g., check s.getState().FLAGS !== undefined before using/applying
middleware) so featureFlagMiddleware never runs against an undefined FLAGS.

Comment on lines 3 to 4
## 4.22
TODO
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Complete the upgrade documentation before merging.

The PR introduces breaking changes (removal of legacy plugin support and other refactoring), but the 4.22 upgrade notes section contains only a placeholder. Plugin developers will need clear, actionable migration guidance for a breaking release.

Either populate the upgrade guide with the actual changes and migration steps, or defer this file to a separate documentation PR to avoid shipping incomplete guidance.

🤖 Prompt for AI Agents
In @frontend/packages/console-dynamic-plugin-sdk/upgrade-sdk.md around lines 3 -
4, The 4.22 upgrade notes are still a TODO and must be completed or deferred;
update the "## 4.22" section in upgrade-sdk.md to list the breaking changes
introduced (e.g., removal of legacy plugin support and any refactors), provide
concrete migration steps for plugin authors (how to replace legacy APIs, updated
entry points, config keys, and examples), and include links to any renamed
functions/classes and sample diffs, or alternatively remove the placeholder and
move the full migration guide to a follow-up docs PR so this branch does not
ship incomplete guidance.

import { ValidationResult } from '@console/dynamic-plugin-sdk/src/validation/ValidationResult';
import { validateConsoleExtensionsFileSchema } from '@console/dynamic-plugin-sdk/src/webpack/ConsoleRemotePlugin';
import { Extension, ActivePlugin } from '../typings';
import { ActivePlugin } from '../typings/base';
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify ActivePlugin type definition includes version field and check for usage patterns.

# Check ActivePlugin type definition in typings/base
echo "=== ActivePlugin type definition ==="
rg -n -A 5 'type ActivePlugin\s*=' frontend/packages/console-plugin-sdk/src/typings/

# Check for consumers of ActivePlugin that may need updates
echo -e "\n=== ActivePlugin usage patterns ==="
rg -n -C 3 'ActivePlugin' frontend/packages/console-plugin-sdk/src/ -g '!*.spec.ts' -g '!*.test.ts'

Repository: openshift/console

Length of output: 10075


🏁 Script executed:

sed -n '82,95p' frontend/packages/console-plugin-sdk/src/codegen/active-plugins.ts

Repository: openshift/console

Length of output: 301


🏁 Script executed:

sed -n '45,71p' frontend/packages/console-plugin-sdk/src/codegen/active-plugins.ts

Repository: openshift/console

Length of output: 625


Fix the generated activePlugins code to include the version field.

The ActivePlugin type now requires a version field, but getActivePluginsModule (lines 45-71) generates code that omits it. Update the generated activePlugins.push() call to include version: '${pkg.version}' alongside name and extensions, keeping it in sync with loadActivePluginsForTestPurposes (line 85-87).

🤖 Prompt for AI Agents
In @frontend/packages/console-plugin-sdk/src/codegen/active-plugins.ts at line
15, The generated module from getActivePluginsModule is missing the required
version field for ActivePlugin; update the activePlugins.push(...) call inside
getActivePluginsModule to include version: '${pkg.version}' alongside name and
extensions so the produced objects match the ActivePlugin type and mirror
loadActivePluginsForTestPurposes (which already uses version).

Comment on lines 75 to 80
// TODO: When migrating to @openshift/dynamic-plugin-sdk, use the type parameter from
// pluginStore.getExtensions<...>() to avoid `as any` cast.
(pluginStore.getExtensions().filter(isModelFeatureFlag) as any).forEach((ff) => {
// This is incorrect (for `ExtensionK8sModel` we should use `referenceForExtensionModel`).
addToCRDs(referenceForModel(ff.properties.model), ff.properties.flag);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify if referenceForExtensionModel exists and identify its usage patterns

# Search for referenceForExtensionModel definition
echo "=== Searching for referenceForExtensionModel definition ==="
rg -n "referenceForExtensionModel" --type ts -C 3

# Search for ExtensionK8sModel usage to understand the type
echo -e "\n=== Searching for ExtensionK8sModel usage ==="
rg -n "ExtensionK8sModel" --type ts -C 2

# Find other usages of referenceForModel with plugin extensions
echo -e "\n=== Finding other extension model references ==="
rg -n "referenceForModel.*\.properties\.model" --type ts -C 2

# Search for isModelFeatureFlag type guard definition
echo -e "\n=== Searching for isModelFeatureFlag definition ==="
rg -n "isModelFeatureFlag" --type ts -C 3

Repository: openshift/console

Length of output: 40971


Address type-safety degradation and acknowledged incorrect usage.

The as any cast defeats TypeScript's type checking and nullifies the benefit of the isModelFeatureFlag type guard. Additionally, the inline comment explicitly states that using referenceForModel is incorrect for ExtensionK8sModel types and should use referenceForExtensionModel instead.

While the TODOs indicate this is temporary migration work, both issues create maintenance risk and potential runtime correctness issues if the data or types evolve. The correct function referenceForExtensionModel exists and is used throughout the codebase for handling extension models.

Consider prioritizing the migration to the type-safe SDK approach or, at minimum, wrapping this logic with runtime validation to catch any type mismatches until the proper migration is complete.

🤖 Prompt for AI Agents
In @frontend/public/reducers/features.ts around lines 75 - 80, The code weakens
type safety by casting pluginStore.getExtensions().filter(isModelFeatureFlag) to
any and also uses referenceForModel incorrectly for ExtensionK8sModel; update
the logic to preserve types and use the correct reference function: remove the
`as any` cast by narrowing the array with the isModelFeatureFlag type guard so
the items are typed as ExtensionK8sModel, then call
addToCRDs(referenceForExtensionModel(ff.properties.model), ff.properties.flag)
instead of referenceForModel; if immediate SDK migration isn't possible, add a
runtime type check/assert around ff.properties.model to ensure it matches
ExtensionK8sModel shape before calling referenceForExtensionModel to avoid
runtime errors.

@logonoff logonoff force-pushed the CONSOLE-3769-s3e2-the-convention branch from 6341d35 to 8284285 Compare January 8, 2026 13:28
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 8, 2026

@logonoff: This pull request references CONSOLE-3769 which is a valid jira issue.

Details

In response to this:

This PR updates Console dynamic plugin runtime infrastructure to use lib-core code from OpenShift Dynamic Plugin SDK.

Console runtime plugin infrastructure has been updated in #15778 to remove support both legacy plugin manifests (plugins built with @openshift-console/dynamic-plugin-sdk-webpack 0.x)

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-robot
Copy link
Contributor

openshift-ci-robot commented Jan 8, 2026

@logonoff: This pull request references CONSOLE-3769 which is a valid jira issue.

Details

In response to this:

This PR updates Console dynamic plugin runtime infrastructure to use lib-core code from OpenShift Dynamic Plugin SDK.

Console runtime plugin infrastructure has been updated in #15778 to remove support both legacy plugin manifests (plugins built with @openshift-console/dynamic-plugin-sdk-webpack 0.x)

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 logonoff changed the title CONSOLE-3769: Phase 2 of using OpenShift Dynamic Plugin SDK CONSOLE-3769: Update OpenShift Dynamic Plugin SDK + webpack-related deps Jan 8, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 8, 2026

@logonoff: This pull request references CONSOLE-3769 which is a valid jira issue.

Details

In response to this:

This PR bumps all OpenShift dynamic plugin SDK and webpack-related deps

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-robot
Copy link
Contributor

openshift-ci-robot commented Jan 8, 2026

@logonoff: This pull request references CONSOLE-3769 which is a valid jira issue.

Details

In response to this:

This PR bumps all OpenShift dynamic plugin SDK, esbuild, and webpack-related deps. Removed hoist-non-react-statics due to non usage

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 logonoff force-pushed the CONSOLE-3769-s3e2-the-convention branch 3 times, most recently from 0e69f0d to 4622ac2 Compare January 8, 2026 16:23
@logonoff logonoff marked this pull request as ready for review January 8, 2026 16:26
@logonoff
Copy link
Member Author

logonoff commented Jan 8, 2026

/label px-approved
/label docs-approved

@openshift-ci openshift-ci bot added px-approved Signifies that Product Support has signed off on this PR docs-approved Signifies that Docs has signed off on this PR and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Jan 8, 2026
@openshift-ci openshift-ci bot requested review from cajieh and spadgett January 8, 2026 16:28
@logonoff logonoff force-pushed the CONSOLE-3769-s3e2-the-convention branch from 4622ac2 to 362d7ad Compare January 8, 2026 18:11
Copy link
Contributor

@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: 2

Caution

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

⚠️ Outside diff range comments (1)
frontend/packages/shipwright-plugin/src/components/logs/tekton-results.ts (1)

440-446: Add explicit type parameter to match declared return type.

getTaskRunLog declares Promise<string> but returns the result of fetchTaskRunLogs({...}) without a type parameter. When T is not specified, it defaults to unknown, making the actual return type Promise<unknown | string>, which is incompatible with the declared Promise<string> in strict TypeScript.

Call fetchTaskRunLogs<string>({...}) to explicitly set the type parameter and ensure type safety.

🤖 Fix all issues with AI agents
In @frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-webpack.md:
- Line 15: Add the missing PR reference [#15945] to the references section of
CHANGELOG-webpack.md: insert the reference entry for [#15945] in the PR
references list between the existing [#15802] entry and the issue references
block so the in-text citation on line 15 resolves; ensure the new entry follows
the same link format and ordering as the other PR reference lines.

In @frontend/packages/console-dynamic-plugin-sdk/package.json:
- Around line 20-21: The package.json references non-existent versions for
@openshift/dynamic-plugin-sdk (^6.0.0) and @openshift/dynamic-plugin-sdk-webpack
(^5.0.0); confirm the intended releases and update these entries to published
versions (e.g., @openshift/dynamic-plugin-sdk to 5.0.1 and
@openshift/dynamic-plugin-sdk-webpack to a published 4.x version) or change them
to the correct prerelease tags/registry entries used in your build environment;
ensure the dependencies fields for "@openshift/dynamic-plugin-sdk" and
"@openshift/dynamic-plugin-sdk-webpack" are updated accordingly and validate by
running npm/yarn install before merging.
🧹 Nitpick comments (2)
frontend/packages/topology/src/data-transforms/DataModelProvider.tsx (1)

75-78: Consider refining the type assertion for better type safety.

The type assertion resources as WatchK8sResourcesGeneric on line 76 works but could be more precise. Since resources at this point could be undefined (when the factory doesn't specify resources), consider:

properties: { ...rest, resources: resources as WatchK8sResourcesGeneric | undefined },

Or simply omit the assertion if TypeScript can infer the type correctly after the function check:

properties: { ...rest, resources },

This maintains type safety while still creating the uniform structure for both async and static resolution paths.

♻️ Optional refinement
 return {
-  properties: { ...rest, resources: resources as WatchK8sResourcesGeneric },
+  properties: { ...rest, resources },
   pluginID: factory.pluginID,
 };
frontend/packages/shipwright-plugin/src/components/logs/tekton-results.ts (1)

417-438: Consider removing or constraining the generic type parameter.

The function signature declares <T> but always returns Promise<T | string>, which makes the generic type parameter less meaningful. Since the function now handles both JSON and non-JSON responses, consider one of these approaches:

  1. Remove the generic and return Promise<unknown | string> or Promise<any | string>
  2. Constrain the generic to ensure type safety: <T extends object = object>
  3. Add type narrowing logic or return a discriminated union

Currently, getTaskRunLog calls this function without specifying T, meaning it defaults to unknown, and the function returns the result directly without type narrowing, which could lead to type safety issues.

♻️ Suggested refactor options

Option 1: Remove generic and return explicit union

-const fetchTaskRunLogs = async <T>(taskRunLogRequest: TaskRunLogRequest): Promise<T | string> => {
+const fetchTaskRunLogs = async (taskRunLogRequest: TaskRunLogRequest): Promise<unknown | string> => {

Option 2: Return discriminated union for better type safety

+type TaskRunLogResult<T> = 
+  | { type: 'json'; data: T }
+  | { type: 'string'; data: string };
+
-const fetchTaskRunLogs = async <T>(taskRunLogRequest: TaskRunLogRequest): Promise<T | string> => {
+const fetchTaskRunLogs = async <T>(taskRunLogRequest: TaskRunLogRequest): Promise<TaskRunLogResult<T>> => {
   // ... existing code ...
-  return isJSONString(taskRunLogResponse.body)
-    ? JSON.parse(taskRunLogResponse.body)
-    : taskRunLogResponse.body;
+  return isJSONString(taskRunLogResponse.body)
+    ? { type: 'json', data: JSON.parse(taskRunLogResponse.body) }
+    : { type: 'string', data: taskRunLogResponse.body };
 };
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6341d35 and 362d7ad.

⛔ Files ignored due to path filters (1)
  • frontend/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (10)
  • frontend/package.json
  • frontend/packages/console-app/src/components/quick-starts/utils/quick-start-context.tsx
  • frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-webpack.md
  • frontend/packages/console-dynamic-plugin-sdk/package.json
  • frontend/packages/console-dynamic-plugin-sdk/src/build-types.ts
  • frontend/packages/console-shared/src/hooks/useUserSettings.ts
  • frontend/packages/shipwright-plugin/src/components/logs/tekton-results.ts
  • frontend/packages/topology/src/data-transforms/DataModelProvider.tsx
  • frontend/public/i18n.js
  • frontend/webpack.config.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/i18n.js
  • frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-webpack.md
  • frontend/packages/shipwright-plugin/src/components/logs/tekton-results.ts
  • frontend/packages/console-app/src/components/quick-starts/utils/quick-start-context.tsx
  • frontend/packages/topology/src/data-transforms/DataModelProvider.tsx
  • frontend/packages/console-dynamic-plugin-sdk/package.json
  • frontend/packages/console-shared/src/hooks/useUserSettings.ts
  • frontend/webpack.config.ts
  • frontend/package.json
  • frontend/packages/console-dynamic-plugin-sdk/src/build-types.ts
🧬 Code graph analysis (2)
frontend/packages/shipwright-plugin/src/components/logs/tekton-results.ts (1)
pkg/devconsole/tekton-results/types.go (1)
  • TaskRunLogRequest (13-15)
frontend/packages/topology/src/data-transforms/DataModelProvider.tsx (2)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/topology.ts (1)
  • TopologyDataModelFactory (36-54)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/console-types.ts (1)
  • WatchK8sResourcesGeneric (216-221)
🔇 Additional comments (10)
frontend/packages/topology/src/data-transforms/DataModelProvider.tsx (1)

31-39: LGTM! Type refinement improves type safety.

The use of Omit to exclude resources before adding it back with a specific type is a sound approach. This prevents type conflicts that could arise from the original union type (WatchK8sResourcesGeneric | CodeRef<...>) and ensures the resolved factories always have a consistent, predictable type.

frontend/packages/console-app/src/components/quick-starts/utils/quick-start-context.tsx (1)

9-9: LGTM!

The import path update to use the ES module variant of i18next-pseudo is consistent with the broader i18n updates in this PR.

frontend/public/i18n.js (1)

5-5: LGTM!

The import path update aligns with the ES module variant changes throughout the codebase.

frontend/webpack.config.ts (2)

239-239: LGTM! Improved type safety.

The type signature refinement from { resource?: string } to webpack.NormalModule provides better type safety while maintaining the same functionality.


325-325: Default ReactRefreshWebpackPlugin configuration is safe and appropriate.

The simplification is correct. Hot reload configuration is properly handled by the devServer settings (hot, webSocketServer: 'sockjs'), and ReactRefreshWebpackPlugin v0.6.2 uses sensible defaults that integrate seamlessly. No port conflicts exist, and no custom socket configuration is required.

frontend/packages/console-shared/src/hooks/useUserSettings.ts (1)

1-1: The crypto module setup is properly configured for browser use.

The crypto import is correctly polyfilled by NodePolyfillPlugin, which is installed and configured in webpack.config.ts. The plugin handles the crypto module by default—the additionalAliases: ['process'] configuration adds additional aliases beyond the default Node.js modules, not a whitelist excluding crypto. The removal of crypto-browserify in favor of Node's built-in crypto module with webpack polyfilling is the correct approach and requires no further changes.

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

1-5: LGTM: Type-only imports correctly applied.

The switch to type-only imports (import type) is appropriate since these symbols are used exclusively in type positions. This helps optimize tree-shaking and makes the intent clearer.


46-52: Remove unsupported claims about breaking changes and legacy manifest support.

The review comment suggests verifying compatibility with legacy plugin manifests (0.x), but no evidence of legacy manifest support exists in the codebase. No PluginManifest type is defined; all code consistently uses ConsolePluginManifest which extends RemotePluginManifest. All consuming code in plugin loading logic, dependencies resolution, and the plugin store already work with the current structure without any compatibility issues.

Likely an incorrect or invalid review comment.

frontend/package.json (2)

226-314: Webpack ecosystem updates are compatible with current configuration.

The webpack configuration in frontend/webpack.config.ts is compatible with the updated versions:

  • webpack 5.100.0 configuration follows standard patterns
  • devServer settings are compatible with webpack-dev-server 5.2.2
  • Plugin configurations (HtmlWebpackPlugin, MiniCssExtractPlugin, ForkTsCheckerWebpackPlugin, CopyWebpackPlugin, etc.) use standard setups matching their versions
  • Loaders (esbuild-loader, thread-loader, babel-loader, sass-loader) are properly configured for their respective versions
  • The minimal node: { global: true } configuration does not conflict with webpack 5

No deprecated webpack 5 options or breaking changes detected. The build process should work correctly with these versions.


193-193: Crypto functionality is adequately provided by the updated polyfill.

The node-polyfill-webpack-plugin@~4.0.0 is properly configured in the webpack build and includes crypto-browserify@^3.12.0 as a transitive dependency, ensuring all crypto functionality is available. The codebase correctly uses import { createHash } from 'crypto' in browser code (e.g., useUserSettings.ts), which gets polyfilled by webpack, while Node.js-based code (e.g., cypress configs) uses the native crypto module. The PR's decision to remove the direct crypto-browserify dependency and rely on the plugin's polyfill is sound and properly implemented.

Comment on lines +20 to +21
"@openshift/dynamic-plugin-sdk": "^6.0.0",
"@openshift/dynamic-plugin-sdk-webpack": "^5.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify usage of dynamic-plugin-sdk APIs across the codebase

echo "=== Searching for dynamic-plugin-sdk imports and usage ==="
rg -n --type=ts --type=tsx -C2 "@openshift/dynamic-plugin-sdk" -g '!**/node_modules/**' -g '!**/dist/**' | head -100

echo -e "\n=== Searching for ConsolePluginManifest usage ==="
rg -n --type=ts --type=tsx -C2 "ConsolePluginManifest|PluginManifest|RemotePluginManifest" -g '!**/node_modules/**' -g '!**/dist/**' | head -100

Repository: openshift/console

Length of output: 243


🏁 Script executed:

# Check if there are any changelog or release notes references
find . -name "CHANGELOG*" -o -name "RELEASE*" -o -name "HISTORY*" 2>/dev/null | head -20

Repository: openshift/console

Length of output: 193


🏁 Script executed:

# Search for webpack configuration files that might need updates
fd -e "webpack.*\.(ts|js|mjs|json)" --type f | grep -v node_modules | head -20

Repository: openshift/console

Length of output: 43


🏁 Script executed:

#!/bin/bash
# Read the CHANGELOG files to understand breaking changes
echo "=== CHANGELOG-core.md (first 200 lines) ==="
head -200 ./frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-core.md

echo -e "\n=== CHANGELOG-webpack.md (first 200 lines) ==="
head -200 ./frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-webpack.md

Repository: openshift/console

Length of output: 17255


🏁 Script executed:

#!/bin/bash
# Search for SDK imports with corrected file types
echo "=== Searching for dynamic-plugin-sdk imports (TS files) ==="
rg -n --type=ts -C2 "@openshift/dynamic-plugin-sdk" -g '!**/node_modules/**' -g '!**/dist/**' 2>/dev/null | head -150

echo -e "\n=== Searching for ConsolePluginManifest/PluginManifest ==="
rg -n --type=ts -C2 "ConsolePluginManifest|RemotePluginManifest" -g '!**/node_modules/**' -g '!**/dist/**' 2>/dev/null | head -150

Repository: openshift/console

Length of output: 21464


🏁 Script executed:

#!/bin/bash
# Find and check build-types.ts
echo "=== Looking for build-types.ts ==="
fd "build-types.ts" --type f 2>/dev/null

echo -e "\n=== Looking for manifest-related files ==="
fd "manifest" --type f -e ts -e tsx 2>/dev/null | grep -v node_modules | head -20

Repository: openshift/console

Length of output: 1282


🌐 Web query:

@openshift/dynamic-plugin-sdk v6.0.0 release notes breaking changes

💡 Result:

I couldn't find a published @openshift/dynamic-plugin-sdk v6.0.0 or release notes for it. The repository is at github.com/openshift/dynamic-plugin-sdk and the latest npm release for @openshift/dynamic-plugin-sdk appears to be v5.0.1. [1][2]

If you meant a different package (for example @openshift-console/dynamic-plugin-sdk) or a prerelease, tell me which package/name and I’ll look up that package's changelog/release notes and breaking changes.

Sources:

  • GitHub repository overview. [1]
  • npm package page for @openshift/dynamic-plugin-sdk (shows latest published v5.0.1). [2]

🌐 Web query:

@openshift/dynamic-plugin-sdk-webpack v5.0.0 release notes breaking changes

💡 Result:

Do you want me to search the web and show the v5.0.0 release notes and list the breaking changes for @openshift/dynamic-plugin-sdk-webpack?


🏁 Script executed:

#!/bin/bash
# Check the actual package.json content for the SDK versions
echo "=== Package.json SDK dependencies ==="
sed -n '15,30p' ./frontend/packages/console-dynamic-plugin-sdk/package.json

echo -e "\n=== Full dependencies section ==="
jq '.dependencies' ./frontend/packages/console-dynamic-plugin-sdk/package.json 2>/dev/null | head -30

Repository: openshift/console

Length of output: 588


🏁 Script executed:

#!/bin/bash
# Search for any version constraints or range specifications
echo "=== Looking for SDK version info anywhere in build config ==="
grep -r "@openshift/dynamic-plugin-sdk" ./frontend/packages/console-dynamic-plugin-sdk --include="*.json" --include="*.ts" | grep -E "version|dependencies" | head -20

Repository: openshift/console

Length of output: 122


🌐 Web query:

npm package @openshift/dynamic-plugin-sdk versions available releases

💡 Result:

Latest published version (npm): 5.0.1. [1]

To see the full list of published versions locally run:

  • npm view @openshift/dynamic-plugin-sdk versions --json
  • or yarn info @openshift/dynamic-plugin-sdk versions

Sources:
[1] npm package page for @openshift/dynamic-plugin-sdk.
[2] GitHub repository for openshift/dynamic-plugin-sdk.


The specified SDK versions do not appear to exist on npm—package installation will fail.

The package.json references @openshift/dynamic-plugin-sdk: ^6.0.0 and @openshift/dynamic-plugin-sdk-webpack: ^5.0.0, but the latest published versions on npm are @openshift/dynamic-plugin-sdk: 5.0.1 and likely @openshift/dynamic-plugin-sdk-webpack: 4.x.z respectively. Confirm that these version numbers are correct or update them to available releases. If these are intended as prerelease/development versions, ensure they are published or available in your build environment before merging.

🤖 Prompt for AI Agents
In @frontend/packages/console-dynamic-plugin-sdk/package.json around lines 20 -
21, The package.json references non-existent versions for
@openshift/dynamic-plugin-sdk (^6.0.0) and @openshift/dynamic-plugin-sdk-webpack
(^5.0.0); confirm the intended releases and update these entries to published
versions (e.g., @openshift/dynamic-plugin-sdk to 5.0.1 and
@openshift/dynamic-plugin-sdk-webpack to a published 4.x version) or change them
to the correct prerelease tags/registry entries used in your build environment;
ensure the dependencies fields for "@openshift/dynamic-plugin-sdk" and
"@openshift/dynamic-plugin-sdk-webpack" are updated accordingly and validate by
running npm/yarn install before merging.

@logonoff logonoff force-pushed the CONSOLE-3769-s3e2-the-convention branch from 362d7ad to 620f452 Compare January 8, 2026 21:43
Remove `hoist-non-react-statics` due to non usage. Did not bump `css-loader` due to incompatibility with `thread-loader`. Removed `crypto-browserify` and used the webpack node polyfill instead.
@logonoff logonoff force-pushed the CONSOLE-3769-s3e2-the-convention branch from 620f452 to 905cbbb Compare January 8, 2026 21:51
getTaskStatusKey,
} from '@patternfly/quickstarts';
import Pseudo from 'i18next-pseudo';
import Pseudo from 'i18next-pseudo/es';
Copy link
Member Author

Choose a reason for hiding this comment

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

fixes "synthetic import needs to be enabled" errors

@@ -1,6 +1,6 @@
import { createHash } from 'crypto';
Copy link
Member Author

Choose a reason for hiding this comment

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

not needed but this helps us not ship two copies of crypto-browserify at least

*/
const fetchTaskRunLogs = async <T>(taskRunLogRequest: TaskRunLogRequest): Promise<T> => {
const fetchTaskRunLogs = async <T>(taskRunLogRequest: TaskRunLogRequest): Promise<T | string> => {
const TEKTON_RESULTS_TASKRUN_LOGS_URL = '/api/dev-console/tekton-results/logs';
Copy link
Member Author

Choose a reason for hiding this comment

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

reflects actual return type

const [resolvedFactories, setResolvedFactories] = useState<
| {
properties: ResolvedExtension<TopologyDataModelFactory>['properties'] & {
properties: Omit<ResolvedExtension<TopologyDataModelFactory>['properties'], 'resources'> & {
Copy link
Member Author

Choose a reason for hiding this comment

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

this is a cleaner type definition because this removes the types of resources that we will not exist in this state

Comment on lines -327 to +325
new ReactRefreshWebpackPlugin({
overlay: {
sockPort: WDS_PORT,
},
}),
]
: []),
...(REACT_REFRESH ? [new ReactRefreshWebpackPlugin()] : []),
Copy link
Member Author

Choose a reason for hiding this comment

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

react-refresh-webpack-plugin now integrates directly with webpack-dev-server, so providing sockPort is no longer necessary.

https://github.com/pmmmwh/react-refresh-webpack-plugin/releases/tag/v0.6.0

},
'vendor-plugins-shared': {
test(module: { resource?: string }) {
test(module: webpack.NormalModule) {
Copy link
Member Author

Choose a reason for hiding this comment

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

more accurate type definition for module

"monaco-yaml": "^5.3.1",
"murmurhash-js": "1.0.x",
"node-polyfill-webpack-plugin": "^4.0.0",
"node-polyfill-webpack-plugin": "~4.0.0",
Copy link
Member Author

Choose a reason for hiding this comment

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

4.1.0 adds new polyfills we don't need

@vojtechszocs
Copy link
Contributor

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 9, 2026

[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

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

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

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 9, 2026
@logonoff
Copy link
Member Author

logonoff commented Jan 9, 2026

dev dependency only changes so we can just run this by CI

/verified by CI

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jan 9, 2026
@openshift-ci-robot
Copy link
Contributor

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

Details

In response to this:

dev dependency only changes so we can just run this by CI

/verified by CI

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

/label plugin-api-approved

@openshift-ci openshift-ci bot added the plugin-api-approved Indicates a PR with plugin API changes has been approved by an API reviewer label Jan 9, 2026
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 8ed410b and 2 for PR HEAD 905cbbb in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 355f552 and 1 for PR HEAD 905cbbb in total

@logonoff
Copy link
Member Author

/retest

1 similar comment
@logonoff
Copy link
Member Author

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 10, 2026

@logonoff: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 3c4ed28 into openshift:main Jan 10, 2026
8 checks passed
@logonoff logonoff deleted the CONSOLE-3769-s3e2-the-convention branch January 10, 2026 22:31
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. 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.

5 participants