Skip to content

OCPBUGS-88319, CONSOLE-5355: Allow customizing skipImportPrefixes when building Console plugins and begin adoption of api types package#16585

Open
vojtechszocs wants to merge 6 commits into
openshift:mainfrom
vojtechszocs:plugin-import-transform-skip-customization
Open

OCPBUGS-88319, CONSOLE-5355: Allow customizing skipImportPrefixes when building Console plugins and begin adoption of api types package#16585
vojtechszocs wants to merge 6 commits into
openshift:mainfrom
vojtechszocs:plugin-import-transform-skip-customization

Conversation

@vojtechszocs

@vojtechszocs vojtechszocs commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Analysis / Root cause

When building Console with webpack, the following warning is emitted by DynamicModuleImportPlugin

LOG from @console/dynamic-plugin-sdk/dist/webpack/lib/webpack/loaders/dynamic-module-import-loader ./node_modules/thread-loader/dist/cjs.js!./node_modules/esbuild-loader/dist/index.cjs??ruleSet[1].rules[2].use[1]!./packages/console-shared/src/components/dropdown/ResponsiveActionDropdown.tsx
<w> Non-index and non-dynamic module import @patternfly/react-core/dist/esm/components/OverflowMenu/OverflowMenuContext

This is caused by @patternfly/react-core package not exposing OverflowMenuContext directly via package index

import { OverflowMenuContext } from '@patternfly/react-core'; // does not work

so the relevant import in ResponsiveActionDropdown.tsx cannot be transformed into something like

import { OverflowMenuContext } from '@patternfly/react-core/dist/dynamic/components/OverflowMenu';

which means OverflowMenuContext code will not be shared with other Console plugins via such dist/dynamic module.

To fix this particular issue in Console as well as any similar issues in Console plugins - maintainers of vendor packages that support dynamic modules such as @patternfly/react-core should add the relevant export and ensure that dist/dynamic-modules.json has relevant entries like

"OverflowMenuContext": "dist/dynamic/components/OverflowMenu",

Solution description

Allow Console and its dynamic plugins to customize skipImportPrefixes as a workaround to reduce build warning noise for known issues related to dynamic module import processing.

Test cases

  • Console webpack build passes
  • Console webpack build log does not include the above mentioned warning about OverflowMenuContext

Reviewers and assignees

/assign @logonoff

Summary by CodeRabbit

  • New Features

    • Added a configurable option to skip specified import prefixes during dynamic-module import processing to reduce unwanted transformations and build warnings.
    • Loader now auto-detects JSX/TSX files by path, enabling appropriate JSX parsing when needed and simplifying module handling.
  • Documentation

    • Updated changelog for the upcoming 4.23.0-prerelease.3 with these additions and references to related fixes.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR makes dynamic-module import skip prefixes configurable end-to-end: ConsoleRemotePlugin accepts caller prefixes, DynamicModuleImportPlugin merges them with built-in PatternFly defaults and forwards the deduped list to the loader, and the loader now computes JSX resourceMetadata from the resource path by default.

Changes

Import-skip configuration refactoring

Layer / File(s) Summary
Loader defaults and resourceMetadata
src/webpack/loaders/dynamic-module-import-loader.ts
Loader now defaults resourceMetadata.jsx to `/.(jsx
DynamicModuleImportPlugin: defaults and option
src/webpack/DynamicModuleImportPlugin.ts
Introduce defaultDynamicModuleImportSkipPrefixes, add skipImportPrefixes: string[] to DynamicModuleImportPluginOptions, merge/dedupe caller prefixes with defaults, and forward merged list to loader options; register a module.rules entry using moduleFilter.
ConsoleRemotePlugin wiring and option surface
src/webpack/ConsoleRemotePlugin.ts
Add sharedDynamicModuleSettings.skipImportPrefixes: string[] to exported options and pass prefixes into DynamicModuleImportPlugin during instantiation.
Changelog
CHANGELOG-webpack.md
Add unreleased 4.23.0-prerelease.3 entry documenting skipImportPrefixes and add reference link definitions.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description check ✅ Passed The description covers analysis/root cause, solution description, test cases, and includes a Jira reference. However, several non-critical template sections (screenshots, test setup, browser conformance, reviewers assignment commands) are not completed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed Custom check for "Ginkgo test names" is not applicable to this PR. The PR modifies TypeScript/JavaScript webpack plugins with Jest tests, not Go files with Ginkgo tests.
Test Structure And Quality ✅ Passed The custom check targets Ginkgo (Go) test code quality, but the PR contains only TypeScript webpack plugin/loader implementations and changelog documentation—no Ginkgo tests.
Microshift Test Compatibility ✅ Passed No Ginkgo e2e tests were added in this PR. All changes are TypeScript/JavaScript webpack plugin configurations and a changelog, making this check not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No Ginkgo e2e tests were added in this PR. All changes are TypeScript webpack plugins/loaders for dynamic module import handling, not test code.
Topology-Aware Scheduling Compatibility ✅ Passed This PR modifies webpack plugin configurations and loaders for dynamic module imports only. It contains no deployment manifests, operator code, controllers, or Kubernetes scheduling constraints. Th...
Ote Binary Stdout Contract ✅ Passed PR modifies only TypeScript/JavaScript webpack plugins, not Go test binaries. OTE Binary Stdout Contract check is inapplicable to this PR.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR contains no new Ginkgo e2e tests. Changes are to webpack plugins/loaders and changelog documentation, not test files.
No-Weak-Crypto ✅ Passed The PR adds skipImportPrefixes configuration to webpack plugins for dynamic module imports. No weak cryptography usage found: no MD5, SHA1, DES, RC4, 3DES, Blowfish, or ECB mode usage; no custom cr...
Container-Privileges ✅ Passed Check is not applicable; PR only modifies TypeScript webpack plugins and markdown changelog, with no container or Kubernetes manifest files present.
No-Sensitive-Data-In-Logs ✅ Passed No sensitive data logging found. The PR does not add logging of passwords, tokens, API keys, PII, session IDs, or customer data. Pre-existing logging only emits public package names and standard we...
Title check ✅ Passed The title accurately references the main change: adding customizable skipImportPrefixes for dynamic module import processing, along with mentions of related tracking identifiers.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci openshift-ci Bot requested review from fsgreco and jhadvig June 9, 2026 19:33
@openshift-ci openshift-ci Bot added component/sdk Related to console-plugin-sdk approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 9, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@frontend/packages/console-dynamic-plugin-sdk/src/webpack/ConsoleRemotePlugin.ts`:
- Around line 210-217: Add JSDoc for the exported function
getDynamicModuleImportSkipPrefixes explaining its purpose (returns an array of
module path prefixes that should be skipped during dynamic module import
resolution), describe the return value (unique array combining default skip
prefixes and any provided additionalPrefixes), list what the default prefixes
cover (PatternFly deprecated/internal ESM paths such as
'`@patternfly/react-core/deprecated`' and specific internal
Tooltip/Popover/createIcon paths), and document how additionalPrefixes are
merged (appended to defaults and deduplicated via _.uniq). Include a short usage
example showing calling getDynamicModuleImportSkipPrefixes() with no args and
with a custom array, and mention the parameter name and type
(additionalPrefixes: string[] = []).

In
`@frontend/packages/console-dynamic-plugin-sdk/src/webpack/DynamicModuleImportPlugin.ts`:
- Around line 136-139: The options type currently requires skipImportPrefixes
which breaks public API; change the DynamicModuleImportPluginOptions type so
skipImportPrefixes is optional (skipImportPrefixes?: string[]) and ensure the
DynamicModuleImportPlugin constructor or initialization uses a default empty
array ([]) when options.skipImportPrefixes is undefined; update references
inside DynamicModuleImportPlugin to rely on the defaulted value so external
callers can omit this field.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ff15f541-54ff-464f-917e-3beef4d2bbc8

📥 Commits

Reviewing files that changed from the base of the PR and between 9d30029 and 19a65e7.

📒 Files selected for processing (3)
  • frontend/packages/console-dynamic-plugin-sdk/src/webpack/ConsoleRemotePlugin.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/webpack/DynamicModuleImportPlugin.ts
  • frontend/webpack.config.ts

Comment on lines +210 to +217
export const getDynamicModuleImportSkipPrefixes = (additionalPrefixes: string[] = []) =>
_.uniq([
'@patternfly/react-core/deprecated',
'@patternfly/react-icons/dist/esm/createIcon',
'@patternfly/react-core/dist/esm/components/Tooltip/',
'@patternfly/react-core/dist/esm/components/Popover/',
...additionalPrefixes,
]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Document this public API function.

getDynamicModuleImportSkipPrefixes is exported from the console-dynamic-plugin-sdk package, making it part of the public API. External plugins may use this function to configure their skip prefixes. Add JSDoc documentation explaining:

  • Purpose and return value
  • What the default prefixes cover (deprecated/internal PatternFly paths)
  • How additionalPrefixes are merged with defaults
📝 Suggested JSDoc
+/**
+ * Get the list of import prefixes to skip during dynamic module import transformation.
+ *
+ * This function combines a default list of PatternFly-specific paths (deprecated/internal modules)
+ * with optional caller-provided prefixes. The result is deduplicated.
+ *
+ * `@param` additionalPrefixes - Optional array of additional import prefixes to skip.
+ * `@returns` Deduplicated array of import prefixes to skip.
+ *
+ * `@example`
+ * ```ts
+ * // Use default skip prefixes only
+ * const prefixes = getDynamicModuleImportSkipPrefixes();
+ *
+ * // Add custom skip prefixes
+ * const prefixes = getDynamicModuleImportSkipPrefixes([
+ *   '`@patternfly/react-core/dist/esm/components/OverflowMenu/OverflowMenuContext`',
+ * ]);
+ * ```
+ */
 export const getDynamicModuleImportSkipPrefixes = (additionalPrefixes: string[] = []) =>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/packages/console-dynamic-plugin-sdk/src/webpack/ConsoleRemotePlugin.ts`
around lines 210 - 217, Add JSDoc for the exported function
getDynamicModuleImportSkipPrefixes explaining its purpose (returns an array of
module path prefixes that should be skipped during dynamic module import
resolution), describe the return value (unique array combining default skip
prefixes and any provided additionalPrefixes), list what the default prefixes
cover (PatternFly deprecated/internal ESM paths such as
'`@patternfly/react-core/deprecated`' and specific internal
Tooltip/Popover/createIcon paths), and document how additionalPrefixes are
merged (appended to defaults and deduplicated via _.uniq). Include a short usage
example showing calling getDynamicModuleImportSkipPrefixes() with no args and
with a custom array, and mention the parameter name and type
(additionalPrefixes: string[] = []).

@logonoff

Copy link
Copy Markdown
Member

/retitle OCPBUGS-88319: Allow customizing skipImportPrefixes when building Console plugins

@openshift-ci openshift-ci Bot changed the title Allow customizing skipImportPrefixes when building Console plugins OCPBUGS-88319: Allow customizing skipImportPrefixes when building Console plugins Jun 11, 2026
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Jun 11, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@vojtechszocs: This pull request references Jira Issue OCPBUGS-88319, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Analysis / Root cause

When building Console with webpack, the following warning is emitted by DynamicModuleImportPlugin

LOG from @console/dynamic-plugin-sdk/dist/webpack/lib/webpack/loaders/dynamic-module-import-loader ./node_modules/thread-loader/dist/cjs.js!./node_modules/esbuild-loader/dist/index.cjs??ruleSet[1].rules[2].use[1]!./packages/console-shared/src/components/dropdown/ResponsiveActionDropdown.tsx
<w> Non-index and non-dynamic module import @patternfly/react-core/dist/esm/components/OverflowMenu/OverflowMenuContext

This is caused by @patternfly/react-core package not exposing OverflowMenuContext directly via package index

import { OverflowMenuContext } from '@patternfly/react-core'; // does not work

so the relevant import in ResponsiveActionDropdown.tsx cannot be transformed into something like

import { OverflowMenuContext } from '@patternfly/react-core/dist/dynamic/components/OverflowMenu';

which means OverflowMenuContext code will not be shared with other Console plugins via such dist/dynamic module.

To fix this particular issue in Console as well as any similar issues in Console plugins - maintainers of vendor packages that support dynamic modules such as @patternfly/react-core should add the relevant export and ensure that dist/dynamic-modules.json has relevant entries like

"OverflowMenuContext": "dist/dynamic/components/OverflowMenu",

Solution description

Allow Console and its dynamic plugins to customize skipImportPrefixes as a workaround to reduce build warning noise for known issues related to dynamic module import processing.

Test cases

  • Console webpack build passes
  • Console webpack build log does not include the above mentioned warning about OverflowMenuContext

Reviewers and assignees

/assign @logonoff

Summary by CodeRabbit

  • New Features
  • Enhanced dynamic module import configuration to allow customization of which imports bypass dynamic rewriting, providing more control over module transformation behavior.

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 plugin-import-transform-skip-customization branch from 19a65e7 to dad0a2e Compare June 11, 2026 12:38
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@vojtechszocs: This pull request references Jira Issue OCPBUGS-88319, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

Analysis / Root cause

When building Console with webpack, the following warning is emitted by DynamicModuleImportPlugin

LOG from @console/dynamic-plugin-sdk/dist/webpack/lib/webpack/loaders/dynamic-module-import-loader ./node_modules/thread-loader/dist/cjs.js!./node_modules/esbuild-loader/dist/index.cjs??ruleSet[1].rules[2].use[1]!./packages/console-shared/src/components/dropdown/ResponsiveActionDropdown.tsx
<w> Non-index and non-dynamic module import @patternfly/react-core/dist/esm/components/OverflowMenu/OverflowMenuContext

This is caused by @patternfly/react-core package not exposing OverflowMenuContext directly via package index

import { OverflowMenuContext } from '@patternfly/react-core'; // does not work

so the relevant import in ResponsiveActionDropdown.tsx cannot be transformed into something like

import { OverflowMenuContext } from '@patternfly/react-core/dist/dynamic/components/OverflowMenu';

which means OverflowMenuContext code will not be shared with other Console plugins via such dist/dynamic module.

To fix this particular issue in Console as well as any similar issues in Console plugins - maintainers of vendor packages that support dynamic modules such as @patternfly/react-core should add the relevant export and ensure that dist/dynamic-modules.json has relevant entries like

"OverflowMenuContext": "dist/dynamic/components/OverflowMenu",

Solution description

Allow Console and its dynamic plugins to customize skipImportPrefixes as a workaround to reduce build warning noise for known issues related to dynamic module import processing.

Test cases

  • Console webpack build passes
  • Console webpack build log does not include the above mentioned warning about OverflowMenuContext

Reviewers and assignees

/assign @logonoff

Summary by CodeRabbit

  • New Features

  • Added skipImportPrefixes configuration option to ConsoleRemotePlugin, enabling control over which import prefixes are excluded during dynamic module import transformation and warning suppression.

  • Introduced getDynamicModuleImportSkipPrefixes() helper function to construct deduplicated lists of import-specifier prefixes by combining default and custom prefixes.

  • Documentation

  • Updated changelog for version 4.23.0-prerelease.3 with new capability 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 openshift-eng/jira-lifecycle-plugin repository.

@logonoff logonoff force-pushed the plugin-import-transform-skip-customization branch 2 times, most recently from be36d09 to 29d153d Compare June 11, 2026 12:41
For older 1.x plugin SDK packages, refer to "OpenShift Console Versions vs SDK Versions" compatibility
table in [Console dynamic plugins README](./README.md).

## 4.23.0-prerelease.3 - TBD

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Skipped prerelease.2 because 4.23.0-prerelease.2 is out for lib-core. Better to avoid confusion

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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-dynamic-plugin-sdk/CHANGELOG-webpack.md (1)

151-151: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add missing link references for OCPBUGS-88319 and #16585.

Once line 15 is corrected, the changelog will need link references for OCPBUGS-88319 and #16585. Add them to the link reference section following the existing pattern.

📝 Proposed additions

Add after line 151 in the OCPBUGS section:

 [OCPBUGS-84338]: https://issues.redhat.com/browse/OCPBUGS-84338
+[OCPBUGS-88319]: https://issues.redhat.com/browse/OCPBUGS-88319
 [`#13188`]: https://github.com/openshift/console/pull/13188

Add after line 178 in the PR reference section:

 [`#16376`]: https://github.com/openshift/console/pull/16376
+[`#16585`]: https://github.com/openshift/console/pull/16585
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-webpack.md` at line
151, Add missing Markdown link reference entries for OCPBUGS-88319 and `#16585` in
the changelog's link reference section, following the existing pattern used by
the OCPBUGS and PR references (e.g., mirror the format of the existing
"[OCPBUGS-84338]: https://issues.redhat.com/browse/OCPBUGS-84338" line and the
PR reference entries), so add a "[OCPBUGS-88319]: <JIRA-URL>" entry in the
OCPBUGS references and a "[`#16585`]: <PR-URL>" entry in the PR reference section
using the correct upstream URLs for those identifiers.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-webpack.md`:
- Line 15: Update the changelog entry to correct typos and references and make
the feature description precise: change "surpress" to "suppress", replace JIRA
reference CONSOLE-5065 with OCPBUGS-88319 and PR reference `#16224` with `#16585`,
and reword the description to state that DynamicModuleImportLoaderOptions allows
customizing skipImportPrefixes to suppress dynamic module import warnings
(rather than a general "extension of imports"); ensure the entry mentions the
DynamicModuleImportLoaderOptions type and skipImportPrefixes explicitly.

---

Outside diff comments:
In `@frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-webpack.md`:
- Line 151: Add missing Markdown link reference entries for OCPBUGS-88319 and
`#16585` in the changelog's link reference section, following the existing pattern
used by the OCPBUGS and PR references (e.g., mirror the format of the existing
"[OCPBUGS-84338]: https://issues.redhat.com/browse/OCPBUGS-84338" line and the
PR reference entries), so add a "[OCPBUGS-88319]: <JIRA-URL>" entry in the
OCPBUGS references and a "[`#16585`]: <PR-URL>" entry in the PR reference section
using the correct upstream URLs for those identifiers.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 18600ce7-15f8-49ec-acfc-cf5e6e95fd7e

📥 Commits

Reviewing files that changed from the base of the PR and between 19a65e7 and dad0a2e.

📒 Files selected for processing (4)
  • frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-webpack.md
  • frontend/packages/console-dynamic-plugin-sdk/src/webpack/ConsoleRemotePlugin.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/webpack/DynamicModuleImportPlugin.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/webpack/loaders/dynamic-module-import-loader.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/packages/console-dynamic-plugin-sdk/src/webpack/ConsoleRemotePlugin.ts

Comment thread frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-webpack.md Outdated
@logonoff logonoff force-pushed the plugin-import-transform-skip-customization branch 4 times, most recently from 4a3adfb to c4b2123 Compare June 11, 2026 13:49

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@frontend/packages/console-dynamic-plugin-sdk/src/webpack/ConsoleRemotePlugin.ts`:
- Line 479: The forwarded value for skipImportPrefixes from
sharedDynamicModuleSettings can be undefined and causes a runtime spread error
in DynamicModuleImportPlugin.apply; in ConsoleRemotePlugin where you pass
skipImportPrefixes: sharedDynamicModuleSettings.skipImportPrefixes, default it
to an empty array (e.g. use sharedDynamicModuleSettings.skipImportPrefixes ??
[]) so DynamicModuleImportPlugin receives an iterable; update the forwarding
site in ConsoleRemotePlugin (the skipImportPrefixes property) to ensure a safe
default before calling DynamicModuleImportPlugin.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 423fc980-3361-4b8d-8d1c-b281b7cf22b8

📥 Commits

Reviewing files that changed from the base of the PR and between 4a3adfb and c4b2123.

📒 Files selected for processing (3)
  • frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-webpack.md
  • frontend/packages/console-dynamic-plugin-sdk/src/webpack/ConsoleRemotePlugin.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/webpack/DynamicModuleImportPlugin.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-webpack.md
  • frontend/packages/console-dynamic-plugin-sdk/src/webpack/DynamicModuleImportPlugin.ts

@logonoff logonoff force-pushed the plugin-import-transform-skip-customization branch 2 times, most recently from 1602b57 to 569b7f0 Compare June 11, 2026 18:21
vojtechszocs and others added 3 commits June 11, 2026 17:56
Replace the webpack-only `NormalModule.beforeLoaders` hook with a standard module rule.

The loader now derives the `jsx` flag from `this.resourcePath` instead of receiving it per-module via hook-injected options.

This is also supported by rspack while the previous impl. was not.
@logonoff logonoff force-pushed the plugin-import-transform-skip-customization branch from 569b7f0 to df61270 Compare June 11, 2026 21:57
@openshift-ci openshift-ci Bot added the component/core Related to console core functionality label Jun 11, 2026
@openshift-ci openshift-ci Bot changed the title OCPBUGS-88319: Allow customizing skipImportPrefixes when building Console plugins OCPBUGS-88319, CONSOLE-5355: Allow customizing skipImportPrefixes when building Console plugins and begin adoption of api types package Jun 11, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

@vojtechszocs: This pull request references Jira Issue OCPBUGS-88319, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

This pull request references CONSOLE-5355 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Analysis / Root cause

When building Console with webpack, the following warning is emitted by DynamicModuleImportPlugin

LOG from @console/dynamic-plugin-sdk/dist/webpack/lib/webpack/loaders/dynamic-module-import-loader ./node_modules/thread-loader/dist/cjs.js!./node_modules/esbuild-loader/dist/index.cjs??ruleSet[1].rules[2].use[1]!./packages/console-shared/src/components/dropdown/ResponsiveActionDropdown.tsx
<w> Non-index and non-dynamic module import @patternfly/react-core/dist/esm/components/OverflowMenu/OverflowMenuContext

This is caused by @patternfly/react-core package not exposing OverflowMenuContext directly via package index

import { OverflowMenuContext } from '@patternfly/react-core'; // does not work

so the relevant import in ResponsiveActionDropdown.tsx cannot be transformed into something like

import { OverflowMenuContext } from '@patternfly/react-core/dist/dynamic/components/OverflowMenu';

which means OverflowMenuContext code will not be shared with other Console plugins via such dist/dynamic module.

To fix this particular issue in Console as well as any similar issues in Console plugins - maintainers of vendor packages that support dynamic modules such as @patternfly/react-core should add the relevant export and ensure that dist/dynamic-modules.json has relevant entries like

"OverflowMenuContext": "dist/dynamic/components/OverflowMenu",

Solution description

Allow Console and its dynamic plugins to customize skipImportPrefixes as a workaround to reduce build warning noise for known issues related to dynamic module import processing.

Test cases

  • Console webpack build passes
  • Console webpack build log does not include the above mentioned warning about OverflowMenuContext

Reviewers and assignees

/assign @logonoff

Summary by CodeRabbit

  • New Features

  • Added a configurable option to skip specified import prefixes during dynamic-module import processing to reduce unwanted transformations and build warnings.

  • Loader now auto-detects JSX/TSX files by path, enabling appropriate JSX parsing when needed and simplifying module handling.

  • Documentation

  • Updated changelog for the upcoming 4.23.0-prerelease.3 with these additions and references to related fixes.

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 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm
/label plugin-api-approved

@openshift-ci openshift-ci Bot added plugin-api-approved Indicates a PR with plugin API changes has been approved by an API reviewer lgtm Indicates that a PR is ready to be merged. labels Jun 11, 2026
@logonoff

Copy link
Copy Markdown
Member

build infra only changes
/verified by ci

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jun 11, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

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

Details

In response to this:

build infra only changes
/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.

logonoff added 2 commits June 11, 2026 18:13
Replace local K8sResourceCommon-based type definitions with the official OpenShift API types. Import ConsoleCLIDownloadKind and ConsoleNotificationKind from @openshift/api-types and update useK8sWatchResource generics and props to use those types. Removes now-unused local CLIDownload and ConsoleNotification type declarations and cleans up imports. No functional changes intended; this aligns types with upstream API definitions.
@logonoff logonoff force-pushed the plugin-import-transform-skip-customization branch from a58aa2a to d66f375 Compare June 11, 2026 22:13
@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Jun 11, 2026
@openshift-ci openshift-ci Bot added kind/demo-plugin Related to dynamic-demo-plugin and removed lgtm Indicates that a PR is ready to be merged. labels Jun 11, 2026
@logonoff

Copy link
Copy Markdown
Member

/lgtm
/verified by ci

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jun 11, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

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

Details

In response to this:

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

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 11, 2026
Replace hand-written K8sResourceCommon type definitions with re-exports
from `@openshift/api-types` where structurally compatible. This covers
10 Kind types in `module/k8s/types.ts` and the vsphere Secret type.

Intersect shipwright `@kubernetes-models` types with K8sResourceCommon
to bridge metadata type incompatibility between `IObjectMeta` and the
`ObjectMetadata` now re-exported from `@openshift/api-types`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@logonoff logonoff force-pushed the plugin-import-transform-skip-customization branch from d66f375 to 1731bc8 Compare June 11, 2026 23:57
@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Jun 11, 2026
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 11, 2026
@logonoff

Copy link
Copy Markdown
Member

/lgtm
/verified by ci

@openshift-ci

openshift-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

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

Test name Commit Details Required Rerun command
ci/prow/frontend d66f375 link true /test frontend

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-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jun 11, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

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

Details

In response to this:

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

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 11, 2026
@openshift-ci

openshift-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

[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

1 similar comment
@openshift-ci

openshift-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

[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-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 639355c and 2 for PR HEAD d66f375 in total

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/sdk Related to console-plugin-sdk jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/demo-plugin Related to dynamic-demo-plugin 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 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