console icon indicating copy to clipboard operation
console copied to clipboard

CONSOLE-3769: Even more openshift/dynamic-plugin-sdk prep work

Open logonoff opened this issue 1 month ago โ€ข 9 comments

  • BREAKING: Removed support for plugins that provide LegacyConsolePluginManifest
  • BREAKING: Followed up on #15671 and removed setPluginStore
  • Type breaking:ExtensionDeclaration renamed to Extension, because there are no more "static extensions". ExtensionDeclaration type is removed and its replacement is the Extension type.
  • The idea of "dynamic" vs "static" extensions are entirely removed, we only have "extensions".
  • @console/plugin-sdk barrel files and type reexports are removed
  • LazyLoader type in @console/plugin-sdk migrated to AsyncComponent because it's only used in that context

logonoff avatar Nov 26 '25 13:11 logonoff

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

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "4.21." or "openshift-4.21.", but it targets "openshift-4.15" instead.

In response to this:

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

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

openshift-ci-robot avatar Nov 26 '25 13:11 openshift-ci-robot

Skipping CI for Draft Pull Request. If you want CI signal for your change, please convert it to an actual PR. You can still manually trigger a test run with /test all

openshift-ci[bot] avatar Nov 26 '25 13:11 openshift-ci[bot]

Walkthrough

Widespread TypeScript type migration and API surface changes: replaced ExtensionDeclaration with Extension across the SDK, tightened generics and moved many imports to type-only (dynamic-plugin-sdk), consolidated manifest types to ConsolePluginManifest (removed adapter), renamed parser class, and introduced LazyLoader/AsyncComponent lifecycle updates.

Changes

Cohort / File(s) Change Summary
Extension type migration
frontend/packages/console-dynamic-plugin-sdk/src/extensions/*
Replaced ExtensionDeclaration<...> with Extension<...> across many extension modules; removed ExtensionDeclaration imports; updated exported type aliases and updated type guard signatures where applicable.
Core types & generics
frontend/packages/console-dynamic-plugin-sdk/src/types.ts, .../src/coderefs/coderef-resolver.ts, .../src/api/useResolvedExtensions.ts
Tightened generics (use Extension<string, P> / AnyObject defaults), adjusted helper types (ExtensionProperties, UpdateExtensionProperties, ResolvedExtension), and converted several imports to type-only.
Manifest types & runtime API
frontend/packages/console-dynamic-plugin-sdk/src/build-types.ts, .../src/schema/plugin-manifest.ts, .../src/runtime/*, .../src/utils/test-utils.ts, .../src/runtime/__tests__/*
Consolidated manifest types to ConsolePluginManifest; updated function/test signatures and internal types to use ConsolePluginManifest; removed legacy manifest types and related utilities.
Removed adapter & noop APIs
frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-loader.ts, frontend/packages/console-dynamic-plugin-sdk/src/utils/k8s/k8s-utils.ts
Removed exported adaptPluginManifest and deprecated setPluginStore; loader now consumes ConsolePluginManifest directly.
Parsers / schema generator
frontend/packages/console-dynamic-plugin-sdk/scripts/generate-schema.ts, frontend/packages/console-dynamic-plugin-sdk/scripts/parsers/ExtensionParser.ts, .../scripts/utils/type-resolver.ts
Renamed ExtensionDeclarationParser โ†’ ExtensionParser; updated registrations and replaced ExtensionDeclaration references with Extension in parser and type-resolver logic and messages.
Async & LazyLoader refactor
frontend/public/components/utils/async.tsx, plus consumers
Introduced public LazyLoader type, reworked AsyncComponent props/state and lifecycle (getDerivedStateFromProps, componentDidMount/Update/WillUnmount) to use LazyLoader; updated consumers to import new type or local async utils.
Plugin SDK barrel & typings rework
frontend/packages/console-plugin-sdk/src/index.ts, .../src/typings/*, .../src/store.ts, .../src/typings/base.ts
Removed legacy re-exports and several deprecated exported types, added ActivePlugin, migrated store APIs/types to ConsolePluginManifest, and moved many type imports to @console/dynamic-plugin-sdk.
Type-only import migrations (consumers & tests)
e.g. frontend/packages/console-app/src/**, frontend/packages/console-shared/src/**, frontend/packages/dev-console/src/**, frontend/public/**, frontend/packages/topology/src/**, frontend/packages/console-plugin-sdk/src/**
Converted many value imports to type-only imports and redirected types to @console/dynamic-plugin-sdk/src/types (e.g., Extension, LoadedExtension, EncodedCodeRef); updated tests accordingly.
Changelog / README / docs
frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-core.md, .../README.md, .../upgrade-sdk.md
Added prerelease changelog entries, updated README paths/formatting, and added SDK upgrade notes.
Misc consumer runtime tweaks
examples: frontend/public/components/notification-drawer.tsx, frontend/public/reducers/features.ts, frontend/public/components/dashboard/.../health-item.tsx
Switched some runtime imports to type-only or to internal async utils; one reducer relaxes types with as any; adjusted imports to new types and updated consumers to new async utilities.

Estimated code review effort

๐ŸŽฏ 4 (Complex) | โฑ๏ธ ~60 minutes

Areas to pay extra attention:

  • frontend/packages/console-dynamic-plugin-sdk/src/types.ts โ€” verify generic changes, exported surface, and downstream compatibility.
  • frontend/packages/console-dynamic-plugin-sdk/src/runtime/plugin-loader.ts & plugin-dependencies.ts โ€” confirm callers/tests align with removal of adaptPluginManifest and new ConsolePluginManifest usage.
  • frontend/public/components/utils/async.tsx โ€” inspect LazyLoader/AsyncComponent lifecycle, typings, and consumer compatibility.
  • scripts/parsers/ExtensionParser.ts, scripts/generate-schema.ts, scripts/utils/type-resolver.ts โ€” ensure schema generation/parsing matches Extension<T,P>.
  • frontend/packages/console-plugin-sdk barrel and typings changes โ€” search for residual imports referencing removed/relocated exports.
โœจ Finishing touches
  • [ ] ๐Ÿ“ Generate docstrings
๐Ÿงช Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

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

coderabbitai[bot] avatar Nov 26 '25 13:11 coderabbitai[bot]

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

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "4.21." or "openshift-4.21.", but it targets "openshift-4.15" instead.

In response to this:

  • ExtensionDeclaration renamed to Extension, because there are no more "static extensions". ExtensionDeclaration type is removed and its replacement is the Extension type.
  • The idea of "dynamic" vs "static" extensions are entirely removed, we only have "extensions".
  • @console/plugin-sdk barrel files and type reexports are removed
  • LazyLoader type in @console/plugin-sdk migrated to AsyncComponent because it's only used in that context
  • Removed support for plugins that provide LegacyConsolePluginManifest

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 avatar Nov 28 '25 17:11 openshift-ci-robot

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

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "4.21." or "openshift-4.21.", but it targets "openshift-4.15" instead.

In response to this:

  • BREAKING: Removed support for plugins that provide LegacyConsolePluginManifest
  • BREAKING: Followed up on #15671 and removed setPluginStore
  • Type breaking:ExtensionDeclaration renamed to Extension, because there are no more "static extensions". ExtensionDeclaration type is removed and its replacement is the Extension type.
  • The idea of "dynamic" vs "static" extensions are entirely removed, we only have "extensions".
  • @console/plugin-sdk barrel files and type reexports are removed
  • LazyLoader type in @console/plugin-sdk migrated to AsyncComponent because it's only used in that context

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

openshift-ci-robot avatar Nov 28 '25 17:11 openshift-ci-robot

/label px-approved /label docs-approved

logonoff avatar Dec 08 '25 20:12 logonoff

/label acknowledge-critical-fixes-only

logonoff avatar Dec 16 '25 01:12 logonoff

[APPROVALNOTIFIER] This PR is APPROVED

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

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

The pull request process is described here

Needs approval from an approver in each of these files:

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

openshift-ci[bot] avatar Dec 19 '25 21:12 openshift-ci[bot]

/label plugin-api-approved

vojtechszocs avatar Dec 19 '25 21:12 vojtechszocs

@logonoff: The following tests 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/okd-scos-images 17ce13e074938813d47e6b39998354656071c297 link true /test okd-scos-images
ci/prow/e2e-gcp-console 17ce13e074938813d47e6b39998354656071c297 link true /test e2e-gcp-console

Full PR test history. Your PR dashboard.

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

openshift-ci[bot] avatar Dec 22 '25 23:12 openshift-ci[bot]