CONSOLE-3769: Phase 2 of using OpenShift Dynamic Plugin SDK#15904
CONSOLE-3769: Phase 2 of using OpenShift Dynamic Plugin SDK#15904openshift-merge-bot[bot] merged 14 commits intoopenshift:mainfrom
Conversation
|
@logonoff: This pull request references CONSOLE-3705 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.22." or "openshift-4.22.", but it targets "openshift-4.15" instead. DetailsIn 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. |
|
Skipping CI for Draft Pull Request. |
📝 WalkthroughWalkthroughReplaces legacy Console plugin runtime and store with SDK-managed PluginStore and hooks; migrates consumers from metadata/pluginID to manifest/uid; introduces Jest Webpack mock; adds resource-sidebar samples hook; removes many legacy runtime modules and tests; updates numerous callers and test providers. Changes
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Important Action Needed: IP Allowlist UpdateIf your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:
Failure to add the new IP will result in interrupted reviews. Comment |
|
@logonoff: This pull request references CONSOLE-3769 which is a valid jira issue. DetailsIn 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-3769 which is a valid jira issue. DetailsIn 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-3769 which is a valid jira issue. DetailsIn 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-3769 which is a valid jira issue. DetailsIn 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-3769 which is a valid jira issue. DetailsIn 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. |
ef41480 to
ffdfee4
Compare
005e7c3 to
9858519
Compare
@yapei, hopefully this should be fixed now |
remove subscribeToDynamicPlugins cause it's not used
- Improve renderWithProviders with options to pass a custom pluginStore - Introduce renderHookWithProviders which is the same thing but for renderHook
hack around coderefs not working by stealing the `Symbol` from upstream Update plugin-init.ts
The schema and doc generation scripts would fail when CodeRef and EncodedCodeRef are re-exports instead of direct type alias declarations. - Updated CodeRefTypeReferenceParser to find EncodedCodeRef from the same module as CodeRef when it's not found directly - Fixed generate-doc to use the re-export source file path instead of linking to node_modules when types are re-exported from dependencies Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Vojtech Szocs <vojtech.szocs@gmail.com>
This reverts the `useResolvedExtnensions` refactor in the previous commit. We've seen that for some reason, the SDK's `useResolvedExtensions` impl causes console to go into an infinite rerender loop. We will investigate and fix this in a followup PR.
cdd7c77 to
876e1f0
Compare
|
/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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Nice work @logonoff - there's some potential for follow-up improvements but this looks great overall 💯 |
This test case should pass now - fixed in openshift/dynamic-plugin-sdk#305 |
|
@yapei Can you please re-verify test scenario 1-5-foo-has-optionaldependencies-on-bar-bar-is-not-available ? |
|
@logonoff: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
verified the optional dependencies cases manually, can do additional verification later /verified later @vojtechszocs |
|
@logonoff: This PR has been marked to be verified later by DetailsIn 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. |
This PR updates Console dynamic plugin runtime infrastructure to use lib-core code from OpenShift Dynamic Plugin SDK ("upstream").
Console runtime plugin infrastructure has been updated in to support both current (legacy) and new (upstream) plugin entry schemes.
Console plugins built with updated
ConsoleRemotePluginwill now use the defaultentryCallbackSettingsprovided by upstream'sDynamicRemotePlugin.There is one difference between Console legacy and upstream's
entryCallbackSettings:pluginIdno longer includes the version string.When upstream's
PluginLoadertries to load a plugin, it makes the assumption inPluginLoader.loadPluginScriptsthat the plugin name passed to the plugin entry callback always matches the plugin name.However, this precondition was not met previously. To solve this, we introduce a new
window.__load_plugin_entry__global method, which is the default plugin callback provided by upstream. This is now the default plugin entry callback for plugins, starting with 4.22.After upstream
PluginStoreregisters that callback, we register our ownwindow.loadPluginEntrymethod, which strips the version from the plugin name, providing backwards compatibility for plugins built for 4.21 or older.How to test:
window.store.getState().FLAGS.toObject()) with the newPluginStore(usingwindow.pluginStore.featureFlags). The keys and values of both should be identical, given both pages are fully loaded, and both the page and cluster state are also identical. You can do the comparison by casting both to a JSON object usingJSON.stringifyand then performing a semantic diffmonitoring-plugin,networking-plugin,kubevirt-plugin,acm, etc.) work exactly the same as before. Builddynamic-demo-pluginfrom this branch and ensure that works as well (this tests the new plugin entry callback)CreateProjectModalextensionOther notable changes:
subscribeToExtensionsandsubscribeToDynamicPluginssubscription services. React hooks are now the only way to consume extensionsconsole.flagside effects are now handled byFeatureFlagExtensionLoaderrenderHookWithProviders, akin to ourrenderWithProviders@types/lodashwhich is fixed in this PR)@openshift/dynamic-plugin-sdkis added to shared modules so that thePluginStoreContextcontext can be sharedpluginIDis no longer a field inLoadedExtensionNot-in-scope follow up work:
codeRefhandling code by fixinguseResolvedExtensionsupstream so we can consume it here