-
Notifications
You must be signed in to change notification settings - Fork 665
CONSOLE-4840: Remove all plugin entry points + topology static extension cleanup #15699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@logonoff: This pull request references CONSOLE-4840 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 "4.21.0" version, but no target version was set. In response to this:
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: This pull request references CONSOLE-4840 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 "4.21.0" version, but no target version was set. In response to this:
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. |
|
/label px-approved |
6b56c04 to
3bce283
Compare
| - Begin alignment of plugin SDK types with `@openshift/dynamic-plugin-sdk` ([CONSOLE-3769], [#15509]) | ||
| - Add optional `fetch` property to extension `console.dashboards/overview/health/url` ([CONSOLE-4796], [#15526]) | ||
| - Add optional `infrastructure` parameter to `PrometheusHealthHandler` type ([CONSOLE-4796], [#15526]) | ||
| - Allow `K8sResourceKind` in `TopologyDataObject` and `TopologyResourcesObject` type ([CONSOLE-4840], [#15699]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required to fix 57 type errors on knative and topology unit tests. Not a breaking change because all extra properties of K8sResourceKind are optional
6b3fd26 to
df7767f
Compare
|
analysis from #15658: Plugin API Review ReportAPI change: Updated SummaryThe changes consolidate topology-related types into the
Key changes:
Backwards Compatibility AnalysisThis change is backwards compatible because:
Findings
Issues found during reviewNone - all requirements are satisfied. Actions takenNo actions required. The change is properly documented and backwards compatible. Compliance score: 10/10Reason for score:
This is a well-executed refactoring that improves the plugin API organization without introducing any breaking changes. |
df7767f to
66528c3
Compare
|
/assign @yapei |
8c11bfe to
f8a987c
Compare
|
@XiyunZhao Please help verify, thanks! |
f8a987c to
3be0a20
Compare
|
/verified by @XiyunZhao |
|
@logonoff: This PR has been marked as verified by In response to this:
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. |
1b7def0 to
15d5482
Compare
|
rebase /verified by active-plugins.spec.ts,XiyunZhao |
|
@logonoff: This PR has been marked as verified by In response to this:
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (4)
frontend/packages/console-plugin-sdk/src/codegen/__tests__/plugin-resolver.spec.ts (1)
15-23: Add test coverage for the positive case.The
isPluginPackagetest suite only covers the negative case (whenconsolePluginis missing). Consider adding a test to explicitly verify thatisPluginPackagereturnstruewhenconsolePlugin: {}is present, ensuring the new plugin package shape is correctly recognized.+ it('returns true if package.consolePlugin is present', () => { + expect( + isPluginPackage({ + ...getTemplatePackage(), + consolePlugin: {}, + }), + ).toBe(true); + });frontend/packages/console-dynamic-plugin-sdk/src/extensions/topology-types.ts (1)
50-50: Topology type alignment toK8sResourceKindis coherent and non-invasiveSwitching
TopologyResourcesObject,OverviewItem(defaultTandhpas),TopologyDataObject.pods/resource, and the various helper signatures (GetTopologyResourceObject,GetResource, edge/group/node helpers,GetWorkloadResources) over toK8sResourceKindtightens typings in a way that matches how these APIs are actually used, without introducing new runtime behavior.Retaining
K8sResourceCommonin a few ancillary types (likeTopologyDataModelDepictedandBuildConfigOverviewItem) is acceptable and can be unified toK8sResourceKindlater if you decide consistency there is worth the churn.Also applies to: 104-107, 131-140, 264-267, 268-283, 305-309
frontend/packages/topology/src/topology-types.ts (1)
1-31: Re-exporting topology types from SDK simplifies the type surfaceConsolidating all topology-related types and constants into re-exports from the SDK module keeps
frontend/packages/topology/src/topology-types.tsas a stable import point while ensuring there’s a single source of truth for the actual definitions, which improves maintainability and reduces duplication.frontend/packages/topology/src/components/page/TopologyView.tsx (1)
231-273: Consider decoupling filtersLoaded from “has any displayFilterExtensions” and reducing redundant updatesTwo subtle behaviors in this effect are worth tightening up:
filtersLoadednever flips to true if there are zero display filter extensions
filtersLoadedis only set inside thedisplayFilterExtensions.forEachbody.- If
displayFilterExtensionsResolvedis true butdisplayFilterExtensionsis empty, theifblock runs but theforEachbody never executes, sofiltersLoadedremainsfalse.- Because the downstream effect that calls
updateModelFromFiltersis guarded byif (filtersLoaded),filteredModelwould never be set in a “no display filters” configuration, and the component would keep returningnull.Today there is at least one
TopologyDisplayFiltersprovider, so this likely doesn’t surface, but the current implementation relies on that assumption.
onFiltersChangeandsetFiltersLoaded(true)are invoked once per extension
- Both are called inside the
displayFilterExtensions.forEachloop. With multiple extensions, this triggers multiple identical or incremental updates and re-renders.- Functionally it works, but it’s noisier than necessary and makes the control flow harder to follow.
You can address both points by aggregating filters across all extensions first, then calling
onFiltersChange/setFiltersLoaded(true)once, even when there are no extensions:React.useEffect(() => { - if (displayFilterExtensionsResolved) { - const updateFilters = [...filters]; - displayFilterExtensions.forEach((extension) => { - const extFilters = extension.properties.getTopologyFilters(); - extFilters?.forEach((filter) => { - if (!updateFilters.find((f) => f.id === filter.id)) { - if (appliedFilters[filter.id] !== undefined) { - filter.value = appliedFilters[filter.id]; - } - updateFilters.push(filters.find((f) => f.id === filter.id) || filter); - } - }); - onFiltersChange(updateFilters); - setFiltersLoaded(true); - }); - } + if (displayFilterExtensionsResolved) { + const updateFilters = [...filters]; + + displayFilterExtensions.forEach((extension) => { + const extFilters = extension.properties.getTopologyFilters(); + extFilters?.forEach((filter) => { + if (!updateFilters.find((f) => f.id === filter.id)) { + if (appliedFilters[filter.id] !== undefined) { + filter.value = appliedFilters[filter.id]; + } + updateFilters.push(filters.find((f) => f.id === filter.id) || filter); + } + }); + }); + + onFiltersChange(updateFilters); + setFiltersLoaded(true); + } // Only update on extension changes // eslint-disable-next-line react-hooks/exhaustive-deps - }, [displayFilterExtensionsResolved, displayFilterExtensions]); + }, [displayFilterExtensionsResolved, displayFilterExtensions]);This keeps the existing behavior when extensions are present, avoids redundant updates, and makes the
filtersLoadedflag robust even if the system ever runs without display-filter providers.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (48)
frontend/packages/console-app/package.json(0 hunks)frontend/packages/console-app/src/plugin.ts(0 hunks)frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-core.md(3 hunks)frontend/packages/console-dynamic-plugin-sdk/src/extensions/topology-types.ts(3 hunks)frontend/packages/console-dynamic-plugin-sdk/src/types.ts(1 hunks)frontend/packages/console-plugin-sdk/src/codegen/__tests__/active-plugins.spec.ts(9 hunks)frontend/packages/console-plugin-sdk/src/codegen/__tests__/plugin-resolver.spec.ts(5 hunks)frontend/packages/console-plugin-sdk/src/codegen/active-plugins.ts(2 hunks)frontend/packages/console-plugin-sdk/src/codegen/plugin-resolver.ts(1 hunks)frontend/packages/console-plugin-sdk/src/typings/base.ts(0 hunks)frontend/packages/console-telemetry-plugin/package.json(0 hunks)frontend/packages/console-telemetry-plugin/src/plugin.ts(0 hunks)frontend/packages/container-security/package.json(0 hunks)frontend/packages/container-security/src/plugin.ts(0 hunks)frontend/packages/dev-console/package.json(0 hunks)frontend/packages/dev-console/src/plugin.ts(0 hunks)frontend/packages/helm-plugin/package.json(0 hunks)frontend/packages/helm-plugin/src/plugin.ts(0 hunks)frontend/packages/insights-plugin/package.json(0 hunks)frontend/packages/insights-plugin/src/plugin.ts(0 hunks)frontend/packages/knative-plugin/package.json(0 hunks)frontend/packages/knative-plugin/src/plugin.ts(0 hunks)frontend/packages/knative-plugin/src/topology/knative-topology-utils.ts(2 hunks)frontend/packages/knative-plugin/src/topology/topology-types.ts(1 hunks)frontend/packages/metal3-plugin/package.json(0 hunks)frontend/packages/metal3-plugin/src/plugin.ts(0 hunks)frontend/packages/operator-lifecycle-manager-v1/package.json(0 hunks)frontend/packages/operator-lifecycle-manager-v1/src/plugin.ts(0 hunks)frontend/packages/operator-lifecycle-manager/package.json(0 hunks)frontend/packages/operator-lifecycle-manager/src/plugin.ts(0 hunks)frontend/packages/pipelines-plugin/package.json(0 hunks)frontend/packages/pipelines-plugin/src/plugin.ts(0 hunks)frontend/packages/shipwright-plugin/package.json(0 hunks)frontend/packages/shipwright-plugin/src/plugin.ts(0 hunks)frontend/packages/topology/package.json(0 hunks)frontend/packages/topology/src/components/graph-view/Topology.tsx(4 hunks)frontend/packages/topology/src/components/page/TopologyView.tsx(5 hunks)frontend/packages/topology/src/data-transforms/DataModelProvider.tsx(3 hunks)frontend/packages/topology/src/data-transforms/transform-utils.ts(2 hunks)frontend/packages/topology/src/extensions/index.ts(0 hunks)frontend/packages/topology/src/extensions/topology.ts(0 hunks)frontend/packages/topology/src/plugin.ts(0 hunks)frontend/packages/topology/src/topology-types.ts(1 hunks)frontend/packages/vsphere-plugin/package.json(0 hunks)frontend/packages/vsphere-plugin/src/plugin.ts(0 hunks)frontend/packages/webterminal-plugin/package.json(0 hunks)frontend/packages/webterminal-plugin/src/plugin.ts(0 hunks)frontend/webpack.config.ts(0 hunks)
💤 Files with no reviewable changes (34)
- frontend/packages/knative-plugin/package.json
- frontend/packages/operator-lifecycle-manager/package.json
- frontend/packages/vsphere-plugin/src/plugin.ts
- frontend/packages/helm-plugin/package.json
- frontend/packages/console-app/package.json
- frontend/packages/console-plugin-sdk/src/typings/base.ts
- frontend/packages/operator-lifecycle-manager/src/plugin.ts
- frontend/packages/container-security/src/plugin.ts
- frontend/webpack.config.ts
- frontend/packages/helm-plugin/src/plugin.ts
- frontend/packages/topology/package.json
- frontend/packages/shipwright-plugin/src/plugin.ts
- frontend/packages/insights-plugin/package.json
- frontend/packages/metal3-plugin/src/plugin.ts
- frontend/packages/console-telemetry-plugin/src/plugin.ts
- frontend/packages/operator-lifecycle-manager-v1/src/plugin.ts
- frontend/packages/knative-plugin/src/plugin.ts
- frontend/packages/dev-console/src/plugin.ts
- frontend/packages/console-telemetry-plugin/package.json
- frontend/packages/pipelines-plugin/src/plugin.ts
- frontend/packages/metal3-plugin/package.json
- frontend/packages/webterminal-plugin/src/plugin.ts
- frontend/packages/shipwright-plugin/package.json
- frontend/packages/topology/src/extensions/topology.ts
- frontend/packages/insights-plugin/src/plugin.ts
- frontend/packages/console-app/src/plugin.ts
- frontend/packages/webterminal-plugin/package.json
- frontend/packages/vsphere-plugin/package.json
- frontend/packages/operator-lifecycle-manager-v1/package.json
- frontend/packages/dev-console/package.json
- frontend/packages/pipelines-plugin/package.json
- frontend/packages/topology/src/extensions/index.ts
- frontend/packages/container-security/package.json
- frontend/packages/topology/src/plugin.ts
🚧 Files skipped from review as they are similar to previous changes (6)
- frontend/packages/console-dynamic-plugin-sdk/src/types.ts
- frontend/packages/console-plugin-sdk/src/codegen/active-plugins.ts
- frontend/packages/topology/src/components/graph-view/Topology.tsx
- frontend/packages/knative-plugin/src/topology/knative-topology-utils.ts
- frontend/packages/knative-plugin/src/topology/topology-types.ts
- frontend/packages/console-plugin-sdk/src/codegen/plugin-resolver.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/codegen/__tests__/plugin-resolver.spec.tsfrontend/packages/topology/src/data-transforms/DataModelProvider.tsxfrontend/packages/console-dynamic-plugin-sdk/CHANGELOG-core.mdfrontend/packages/console-plugin-sdk/src/codegen/__tests__/active-plugins.spec.tsfrontend/packages/topology/src/topology-types.tsfrontend/packages/console-dynamic-plugin-sdk/src/extensions/topology-types.tsfrontend/packages/topology/src/data-transforms/transform-utils.tsfrontend/packages/topology/src/components/page/TopologyView.tsx
🔇 Additional comments (16)
frontend/packages/console-plugin-sdk/src/codegen/__tests__/plugin-resolver.spec.ts (2)
36-87: LGTM!The
readPackagestest correctly validates that plugin packages withconsolePlugin: {}are identified and returned, aligning with the removal of theentryfield requirement.
90-169: LGTM!The
filterActivePluginPackagestests correctly verify plugin filtering logic with the updatedconsolePlugin: {}shape across multiple scenarios (app dependencies, app as plugin, ordering).frontend/packages/console-plugin-sdk/src/codegen/__tests__/active-plugins.spec.ts (4)
32-103: LGTM!The test correctly verifies that
getActivePluginsModulegenerates the expected module code with dynamic-only extensions for plugins withconsolePlugin: {}, consistent with the removal of static entry-based plugin loading.
105-167: LGTM!The test correctly verifies that
loadActivePluginsForTestPurposesloads and returns plugins with dynamic-only extensions, aligning with the refactor to remove static plugin entry points.
169-239: LGTM!The
getExecutableCodeRefSourcetests correctly validate code reference transformation. The helper function properly usesconsolePlugin: { exposedModules }to provide module mapping when needed for code reference resolution.
241-475: LGTM!The
getDynamicExtensionstests comprehensively verify dynamic extension loading fromconsole-extensions.jsonfiles across multiple scenarios (valid extensions, missing file, schema errors, transformation errors), correctly usingconsolePlugin: {}throughout.frontend/packages/topology/src/data-transforms/DataModelProvider.tsx (5)
1-8: LGTM: Import updates align with SDK consolidation.The switch to named imports and updated SDK types (
isTopologyDataModelFactory,TopologyDataModelFactory,ResolvedExtension,WatchK8sResourcesGeneric) correctly implements the PR objective to consolidate topology types with the dynamic-plugin-sdk.
18-23: LGTM: Component signature and state initialization.The switch from
React.FCtoFCand named hook imports is consistent with modern React patterns and the updated imports.
26-28: LGTM: Updated extension resolution.The variable renaming (
modelFactories,factoriesResolved) and type updates (TopologyDataModelFactory,isTopologyDataModelFactory) improve clarity and align with the SDK consolidation.
31-39: LGTM: Enhanced type safety for resolved factories.The explicit typing using
ResolvedExtension<TopologyDataModelFactory>['properties']with the optionalresourcesfield improves type safety and clearly documents the shape of resolved factories.
42-83: LGTM: Enhanced resource resolution with error handling.The refactored effect correctly updates variable references and adds valuable error handling for resource resolution failures. The fallback to
undefinedresources allows graceful degradation while logging helps with debugging.frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-core.md (1)
21-22: Changelog entries accurately describe topology type updatesThe new bullets for allowing
K8sResourceKindin topology types and asyncresourcesforconsole.topology/data/factory, plus the added[CONSOLE-4806]reference, are consistent with the PR scope and keep the changelog aligned with the implemented API changes.Also applies to: 140-140
frontend/packages/topology/src/data-transforms/transform-utils.ts (1)
10-16: Import realignment with SDK topology types looks correctPulling
OverviewItemfrom the SDK topology-types module and importingisKnativeServingfrompod-utilsaligns this file with the new type/utility layout without changing runtime behavior; thecreateTopologyNodeDatasignature and usage remain consistent.Also applies to: 32-32, 104-112
frontend/packages/topology/src/components/page/TopologyView.tsx (3)
19-29: Static topology imports and useResolvedExtensions wiring look consistentSwitching to
useResolvedExtensionsand importing topology extension types / type guards from@console/dynamic-plugin-sdk/src/extensions/topologyaligns this component with the static SDK topology extension surface and keeps a single source of truth for these contracts. No issues spotted here.
133-145: Extension resolution for filters/connectors/decorators is wired correctlyThe
useResolvedExtensionshooks forTopologyDisplayFilters,TopologyCreateConnector,TopologyDecoratorProvider, andTopologyRelationshipProviderare set up consistently: you gate filter/connector/decorator usage on the corresponding...Resolvedflag where needed and pass the resolved extension arrays throughgraphDataand subsequent effects. This matches the intended SDK usage and keeps the topology view driven entirely by the resolved extension set.
206-229: Decorator aggregation from extension providers is soundThe decorator effect reduces
extensionDecoratorsinto quadrant buckets, initializes all quadrants up front, and sorts byprioritybefore storing in state. This ensures deterministic ordering and avoids quadrant key checks downstream. The dependency list (extensionDecorators,extensionDecoratorsResolved) is correct for only recomputing when the decorator extension set changes.
15d5482 to
fc1e954
Compare
|
readme fix /verified by active-plugins.spec.ts,XiyunZhao |
|
@logonoff: This PR has been marked as verified by In response to this:
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: The following test failed, say
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. |
as well as the concept of "static extensions" Co-Authored-By: Vojtech Szocs <[email protected]>
fc1e954 to
303a839
Compare
|
rebase /verified by active-plugins.spec.ts,XiyunZhao |
|
@logonoff: This PR has been marked as verified by In response to this:
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/topology-types.ts (1)
131-140: Fix type compatibility between OdcNodeModel and TopologyDataObject.The PR introduces a type mismatch:
OdcNodeModel.resourceisK8sResourceCommon, butTopologyDataObject.resourceis nowK8sResourceKind | null. These types are incompatible—K8sResourceKindis a superset ofK8sResourceCommonwith additional optional fields (spec,status,data), so assigning aK8sResourceCommonto aK8sResourceKindfield is not type-safe.The conversion function
dataObjectFromModel(line 58 infrontend/packages/topology/src/data-transforms/transform-utils.ts) directly assignsnode.resourcewithout type conversion, which will cause TypeScript compilation errors.Update
OdcNodeModel.resourceto useK8sResourceKindconsistently withTopologyDataObject.resource, or adjust the conversion logic to handle the type difference appropriately.
🧹 Nitpick comments (1)
frontend/packages/topology/src/components/graph-view/Topology.tsx (1)
294-301: Consider separating static vs dynamic component factory registrationThe effect correctly waits for
extensionsResolvedbefore registering plugin-driven factories, and the dependency list should limit it to one meaningful run in normal usage. However, it currently re-registers the staticcomponentFactoryeach time the effect runs:visualization.registerComponentFactory(componentFactory); componentFactoryExtensions.forEach((factory) => { visualization.registerComponentFactory(factory.properties.getFactory); });To avoid any chance of duplicate registrations (if extension resolution ever changes at runtime) and to make intent clearer, you could:
- Register the static
componentFactoryonce when creating theVisualization(insidecreateVisualization), and- Keep this effect focused solely on registering
componentFactoryExtensionsonceextensionsResolvedis true.This is a maintainability/performance polish rather than a correctness issue.
Also applies to: 311-311
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (48)
frontend/packages/console-app/package.json(0 hunks)frontend/packages/console-app/src/plugin.ts(0 hunks)frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-core.md(3 hunks)frontend/packages/console-dynamic-plugin-sdk/src/extensions/topology-types.ts(3 hunks)frontend/packages/console-dynamic-plugin-sdk/src/types.ts(1 hunks)frontend/packages/console-plugin-sdk/src/codegen/__tests__/active-plugins.spec.ts(9 hunks)frontend/packages/console-plugin-sdk/src/codegen/__tests__/plugin-resolver.spec.ts(5 hunks)frontend/packages/console-plugin-sdk/src/codegen/active-plugins.ts(2 hunks)frontend/packages/console-plugin-sdk/src/codegen/plugin-resolver.ts(1 hunks)frontend/packages/console-plugin-sdk/src/typings/base.ts(0 hunks)frontend/packages/console-telemetry-plugin/package.json(0 hunks)frontend/packages/console-telemetry-plugin/src/plugin.ts(0 hunks)frontend/packages/container-security/package.json(0 hunks)frontend/packages/container-security/src/plugin.ts(0 hunks)frontend/packages/dev-console/package.json(0 hunks)frontend/packages/dev-console/src/plugin.ts(0 hunks)frontend/packages/helm-plugin/package.json(0 hunks)frontend/packages/helm-plugin/src/plugin.ts(0 hunks)frontend/packages/insights-plugin/package.json(0 hunks)frontend/packages/insights-plugin/src/plugin.ts(0 hunks)frontend/packages/knative-plugin/package.json(0 hunks)frontend/packages/knative-plugin/src/plugin.ts(0 hunks)frontend/packages/knative-plugin/src/topology/knative-topology-utils.ts(2 hunks)frontend/packages/knative-plugin/src/topology/topology-types.ts(1 hunks)frontend/packages/metal3-plugin/package.json(0 hunks)frontend/packages/metal3-plugin/src/plugin.ts(0 hunks)frontend/packages/operator-lifecycle-manager-v1/package.json(0 hunks)frontend/packages/operator-lifecycle-manager-v1/src/plugin.ts(0 hunks)frontend/packages/operator-lifecycle-manager/package.json(0 hunks)frontend/packages/operator-lifecycle-manager/src/plugin.ts(0 hunks)frontend/packages/pipelines-plugin/package.json(0 hunks)frontend/packages/pipelines-plugin/src/plugin.ts(0 hunks)frontend/packages/shipwright-plugin/package.json(0 hunks)frontend/packages/shipwright-plugin/src/plugin.ts(0 hunks)frontend/packages/topology/package.json(0 hunks)frontend/packages/topology/src/components/graph-view/Topology.tsx(4 hunks)frontend/packages/topology/src/components/page/TopologyView.tsx(5 hunks)frontend/packages/topology/src/data-transforms/DataModelProvider.tsx(3 hunks)frontend/packages/topology/src/data-transforms/transform-utils.ts(2 hunks)frontend/packages/topology/src/extensions/index.ts(0 hunks)frontend/packages/topology/src/extensions/topology.ts(0 hunks)frontend/packages/topology/src/plugin.ts(0 hunks)frontend/packages/topology/src/topology-types.ts(1 hunks)frontend/packages/vsphere-plugin/package.json(0 hunks)frontend/packages/vsphere-plugin/src/plugin.ts(0 hunks)frontend/packages/webterminal-plugin/package.json(0 hunks)frontend/packages/webterminal-plugin/src/plugin.ts(0 hunks)frontend/webpack.config.ts(0 hunks)
💤 Files with no reviewable changes (34)
- frontend/packages/console-app/src/plugin.ts
- frontend/packages/webterminal-plugin/src/plugin.ts
- frontend/packages/console-telemetry-plugin/package.json
- frontend/packages/operator-lifecycle-manager/package.json
- frontend/packages/console-app/package.json
- frontend/packages/dev-console/src/plugin.ts
- frontend/packages/metal3-plugin/package.json
- frontend/packages/console-telemetry-plugin/src/plugin.ts
- frontend/packages/container-security/src/plugin.ts
- frontend/packages/topology/package.json
- frontend/packages/pipelines-plugin/src/plugin.ts
- frontend/packages/dev-console/package.json
- frontend/packages/shipwright-plugin/src/plugin.ts
- frontend/packages/vsphere-plugin/src/plugin.ts
- frontend/packages/operator-lifecycle-manager-v1/package.json
- frontend/packages/shipwright-plugin/package.json
- frontend/packages/insights-plugin/package.json
- frontend/packages/helm-plugin/src/plugin.ts
- frontend/packages/vsphere-plugin/package.json
- frontend/packages/topology/src/extensions/index.ts
- frontend/packages/operator-lifecycle-manager/src/plugin.ts
- frontend/packages/insights-plugin/src/plugin.ts
- frontend/packages/helm-plugin/package.json
- frontend/packages/metal3-plugin/src/plugin.ts
- frontend/packages/pipelines-plugin/package.json
- frontend/packages/console-plugin-sdk/src/typings/base.ts
- frontend/webpack.config.ts
- frontend/packages/topology/src/extensions/topology.ts
- frontend/packages/topology/src/plugin.ts
- frontend/packages/knative-plugin/src/plugin.ts
- frontend/packages/container-security/package.json
- frontend/packages/operator-lifecycle-manager-v1/src/plugin.ts
- frontend/packages/knative-plugin/package.json
- frontend/packages/webterminal-plugin/package.json
🚧 Files skipped from review as they are similar to previous changes (8)
- frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-core.md
- frontend/packages/console-plugin-sdk/src/codegen/tests/active-plugins.spec.ts
- frontend/packages/topology/src/data-transforms/DataModelProvider.tsx
- frontend/packages/topology/src/data-transforms/transform-utils.ts
- frontend/packages/topology/src/topology-types.ts
- frontend/packages/knative-plugin/src/topology/knative-topology-utils.ts
- frontend/packages/console-dynamic-plugin-sdk/src/types.ts
- frontend/packages/console-plugin-sdk/src/codegen/active-plugins.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/topology/src/components/graph-view/Topology.tsxfrontend/packages/console-dynamic-plugin-sdk/src/extensions/topology-types.tsfrontend/packages/console-plugin-sdk/src/codegen/plugin-resolver.tsfrontend/packages/console-plugin-sdk/src/codegen/__tests__/plugin-resolver.spec.tsfrontend/packages/topology/src/components/page/TopologyView.tsxfrontend/packages/knative-plugin/src/topology/topology-types.ts
🔇 Additional comments (11)
frontend/packages/topology/src/components/graph-view/Topology.tsx (1)
26-30: Topology component factory resolution wiring looks consistentImporting
useResolvedExtensions,isTopologyComponentFactory, andTopologyComponentFactoryand then wiring them via:const [componentFactoryExtensions, extensionsResolved] = useResolvedExtensions<TopologyComponentFactory>(isTopologyComponentFactory);is type-safe, aligns with the SDK topology extension pattern, and keeps the dynamic plugin dependency surface clear in this component.
Also applies to: 150-152
frontend/packages/topology/src/components/page/TopologyView.tsx (5)
19-29: Import consolidation looks good.The imports have been cleanly refactored to use the dynamic-plugin-SDK types and APIs directly, aligning with the PR objectives to consolidate topology extension definitions.
133-141: Extension resolution properly unified.All extension types now use the consistent
useResolvedExtensionspattern with appropriate type guards and resolved flags.
207-229: Decorator aggregation correctly refactored.The effect properly uses the static extension decorators with correct dependency tracking and maintains the existing quadrant-based grouping logic.
232-250: Display filter resolution correctly updated.The effect properly uses static display filter extensions with correct dependency tracking, maintaining the intentional design to update only when extensions change.
252-273: Model filtering correctly uses static extensions.The filtered model update properly maps over the static display filter extensions and includes them in the dependency array.
frontend/packages/console-plugin-sdk/src/codegen/plugin-resolver.ts (1)
22-25: isPluginPackage guard matches new plugin shape and looks correctThe new guard (
!_.isNil(consolePlugin) && _.isObject(consolePlugin)) correctly treats any non-null objectconsolePluginas a plugin marker, aligning with the updatedPluginPackage.consolePlugintype and the entry-less configuration model. No functional or maintainability issues here.frontend/packages/console-plugin-sdk/src/codegen/__tests__/plugin-resolver.spec.ts (1)
45-53: Tests correctly exercise the new “presence-only” consolePlugin contractUpdating fixtures to use
consolePlugin: {}ensures the tests now validate the intended behavior: any package with a consolePlugin object is treated as a plugin, including the app package when applicable. The coverage around dependencies and ordering still holds and now aligns with the updated type/guard semantics.Also applies to: 102-118, 122-129, 134-161
frontend/packages/knative-plugin/src/topology/topology-types.ts (1)
1-2: Import consolidation is correct and functional.Verification confirms:
- Both imported types exist and are properly exported from the SDK
OverviewItem(withK8sResourceKinddefault) andPodControllerOverviewItemare available at the specified pathsKnativeServiceOverviewItemproperly extendsOverviewItemand includesPodControllerOverviewItemfor thecurrentproperty- All usages in
knative-topology-utils.tsand test files are compatible with the type definitionsNo issues detected.
frontend/packages/console-dynamic-plugin-sdk/src/extensions/topology-types.ts (2)
50-50: Type change from K8sResourceCommon to K8sResourceKind is valid and type-safe.The change narrows
TopologyResourcesObjectto useK8sResourceKind[]instead ofK8sResourceCommon[]. Since K8sResourceKind extends K8sResourceCommon, this is a valid type narrowing. All identified consumers in the codebase (data-transforms, TopologyDataRetriever) are compatible with the more specific type. No type mismatches detected.
104-106: No issues found. The generic default change is backward compatible.K8sResourceKind is defined as K8sResourceCommon & { spec?, status?, data? }, making it a structural supertype. All code using
OverviewItemwithout explicit generic parameters will receiveK8sResourceKindinstead of the previousK8sResourceCommondefault. Since K8sResourceKind extends K8sResourceCommon, this change is safe and backward compatible. No usages ofOverviewItem<K8sResourceCommon>were found in the codebase, confirming that this modification poses no breaking changes.Likely an incorrect or invalid review comment.
|
/lgtm |
|
[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 |
@console/topologytypes with SDK onesTopologyDisplayFiltersTopologyDecoratorProviderTopologyComponentFactoryTopologyDisplayFiltersTopologyDecoratorProvider[]and do not have imports. Thus they are a noopTopologyDataModelFactorywill be removed in #15641. Thanks @Leo6Leo!