Skip to content

CONSOLE-5065: Plugin runtime init code tweaks#16816

Open
vojtechszocs wants to merge 1 commit into
openshift:mainfrom
vojtechszocs:plugin-init-tweaks
Open

CONSOLE-5065: Plugin runtime init code tweaks#16816
vojtechszocs wants to merge 1 commit into
openshift:mainfrom
vojtechszocs:plugin-init-tweaks

Conversation

@vojtechszocs

@vojtechszocs vojtechszocs commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Minor improvements to Console plugin runtime init code

  • ensure that static (local) plugins are loaded before we proceed to load dynamic (remote) plugins
  • window global webpackSharedScope renamed to pluginSharedScope

Summary by CodeRabbit

  • Bug Fixes
    • Improved Console plugin initialization so all locally configured plugins complete loading before they are enabled.
    • Increased startup reliability by loading static/local plugins concurrently and then enabling them together.
  • Documentation
    • Clarified terminology for loading/enabling “Console dynamic plugins.”
  • Development Diagnostics
    • Updated development-only plugin sharing diagnostics to use a clearer, plugin-specific global name.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot

openshift-ci-robot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@vojtechszocs: This pull request references CONSOLE-5065 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:

Minor improvements to Console plugin runtime init code

  • ensure that static (local) plugins are loaded before we proceed to load dynamic (remote) plugins
  • window global webpackSharedScope renamed to pluginSharedScope

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 openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 23, 2026
@openshift-ci
openshift-ci Bot requested review from Leo6Leo and jhadvig July 23, 2026 19:15
@openshift-ci openshift-ci Bot added component/core Related to console core functionality component/sdk Related to console-plugin-sdk approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 225b2fae-c8e5-4dea-95eb-1781965dabf9

📥 Commits

Reviewing files that changed from the base of the PR and between d97b8f2 and 31878a9.

📒 Files selected for processing (4)
  • frontend/.eslintrc.js
  • frontend/@types/console/window.d.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-init.ts
  • frontend/public/plugins.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/.eslintrc.js

Walkthrough

Console plugin initialization now exposes the shared scope as pluginSharedScope, updates its Window declaration, waits for all static plugin loads to settle before dynamic initialization, and removes explicit callback registration.

Changes

Console plugin initialization

Layer / File(s) Summary
Plugin shared-scope contract and runtime exposure
frontend/@types/console/window.d.ts, frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-init.ts, frontend/.eslintrc.js
The development shared-scope global and Window property now use pluginSharedScope; related documentation and lodash-es lint guidance were updated.
Static plugin loading orchestration
frontend/public/plugins.ts
Static plugins load concurrently with Promise.allSettled before initConsolePlugins runs, and the explicit callback registration flag was removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant StaticPlugins
  participant PluginStore
  participant DynamicPluginInitializer
  StaticPlugins->>PluginStore: Start local plugin loads concurrently
  PluginStore-->>StaticPlugins: Settle loading promises
  StaticPlugins->>DynamicPluginInitializer: Initialize after all loads settle
Loading

Suggested labels: plugin-api-changed

Suggested reviewers: jhadvig, leo6leo

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is too brief and misses required template sections like root cause, solution, testing, and reviewers. Fill in the required template sections: analysis/root cause, solution details, test setup, test cases, browser conformance, additional info, and reviewers.
✅ Passed checks (14 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the plugin runtime init changes.
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 No Ginkgo tests were added or modified; the patch only changes plugin runtime/config files.
Test Structure And Quality ✅ Passed The PR only changes frontend runtime/config files; no Ginkgo test code was added or modified, so the test-quality check is not applicable.
Microshift Test Compatibility ✅ Passed No Ginkgo/e2e tests were added or modified; the PR only changes frontend runtime/config files, so MicroShift API compatibility is not implicated.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the PR only changes plugin runtime/types/eslint, so there are no SNO-specific assumptions to flag.
Topology-Aware Scheduling Compatibility ✅ Passed No deployment/controller/manifests were modified; touched files only affect frontend plugin runtime/types and ESLint, with no scheduling logic.
Ote Binary Stdout Contract ✅ Passed The PR only changes frontend plugin init/browser code; no new stdout writes were added in any binary main/init/setup path.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added or modified in this PR; only frontend runtime/config files changed.
No-Weak-Crypto ✅ Passed PASS: touched files only adjust plugin init ordering/type docs and an ESLint message; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB or custom crypto/secret-compare code appears.
Container-Privileges ✅ Passed PR only changes frontend JS/TS files; no container/K8s manifests were modified and no privileged securityContext fields were introduced.
No-Sensitive-Data-In-Logs ✅ Passed No new sensitive logging was added; the PR only renames a debug global, reorders plugin init, and tweaks comments/lint text.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@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/public/plugins.ts`:
- Around line 134-137: Update the static plugin loading flow around Promise.all
and initConsolePlugins so one rejected pluginStore.loadPlugin call cannot
prevent dynamic initialization. Use Promise.allSettled or handle each load
failure individually, preserve error logging for failed static plugins, and
ensure initConsolePlugins(pluginStore) runs after all static load attempts
complete.
🪄 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: 4d8d77f3-fab2-4f90-bd5b-179994db0f32

📥 Commits

Reviewing files that changed from the base of the PR and between 88f2840 and d97b8f2.

📒 Files selected for processing (4)
  • frontend/.eslintrc.js
  • frontend/@types/console/window.d.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-init.ts
  • frontend/public/plugins.ts

Comment thread frontend/public/plugins.ts

@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

@logonoff

Copy link
Copy Markdown
Member

tech debt:

/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 labels Jul 23, 2026
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 23, 2026
@openshift-ci

openshift-ci Bot commented Jul 23, 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

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-gcp-console
/test e2e-playwright

@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 23, 2026
@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

New changes are detected. LGTM label has been removed.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/sdk Related to console-plugin-sdk docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. px-approved Signifies that Product Support has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants