CONSOLE-4863: Create extension point for plugins to display dynamic alerts in catalogs
Summary
This PR introduces a new dynamic plugin extension point (console.catalog/alert) that allows plugins to contribute alert banner components to catalog pages. Plugins can target specific catalogs and catalog item types, and alerts are automatically sorted by priority with higher priority alerts appearing first.
Key Changes
Extension Definition:
- New
console.catalog/alertextension type in the dynamic plugin SDK - Properties:
catalogId(required) - The catalog to display the alert intype(optional) - Target a specific catalog item typecomponent(required) - React component to renderpriority(optional) - Sort order (higher priority first, defaults to 0)
Implementation:
- Added extension type and type guard in
catalog.ts - Updated
useCatalogExtensionshook to resolve and filter alert extensions by catalogId and type - Modified
CatalogControllerto render alert components at the top of the catalog (inside StatusBox, before CatalogView) - Added automatic sorting by priority
- Updated
CatalogServiceProviderto pass alert extensions through the catalog service - Comprehensive test coverage for extension filtering and priority sorting
Use Case:
This enables plugins to provide contextual information, warnings, or status updates directly in catalog interfaces without modifying core catalog code. For example, the operator-lifecycle-manager-v1 plugin can show alerts about OLMv1 feature status, version switching options, or important notices to users.
Documentation
SDK documentation has been updated in console-extensions.md with the new extension type definition and property descriptions.
Test Plan
- [ ] Verify the extension type is properly exported and type guards work
- [ ] Run unit tests for
useCatalogExtensionshook:cd frontend && yarn test useCatalogExtensions.spec.ts - [ ] Build the frontend to ensure no TypeScript errors:
cd frontend && yarn build:console - [ ] Manual testing with a plugin that uses this extension (will be done in follow-up OLMv1 PRs)
- [ ] Verify alerts render in the correct location (above catalog content)
- [ ] Verify priority sorting works correctly (higher priority alerts appear first)
🤖 Generated with Claude Code
@TheRealJon: This pull request references CONSOLE-4863 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 sub-task to target the "4.21.0" version, but no target version was set.
In response to this:
Summary
This PR introduces a new dynamic plugin extension point (
console.catalog/alert) that allows plugins to contribute alert banner components to catalog pages. Plugins can target specific catalogs and catalog item types, and alerts are automatically sorted by priority with higher priority alerts appearing first.Key Changes
Extension Definition:
- New
console.catalog/alertextension type in the dynamic plugin SDK- Properties:
catalogId(required) - The catalog to display the alert intype(optional) - Target a specific catalog item typecomponent(required) - React component to renderpriority(optional) - Sort order (higher priority first, defaults to 0)Implementation:
- Added extension type and type guard in
catalog.ts- Updated
useCatalogExtensionshook to resolve and filter alert extensions by catalogId and type- Modified
CatalogControllerto render alert components at the top of the catalog (inside StatusBox, before CatalogView)- Added automatic sorting by priority
- Updated
CatalogServiceProviderto pass alert extensions through the catalog service- Comprehensive test coverage for extension filtering and priority sorting
Use Case: This enables plugins to provide contextual information, warnings, or status updates directly in catalog interfaces without modifying core catalog code. For example, the
operator-lifecycle-manager-v1plugin can show alerts about OLMv1 feature status, version switching options, or important notices to users.Documentation
SDK documentation has been updated in
console-extensions.mdwith the new extension type definition and property descriptions.Test Plan
- [ ] Verify the extension type is properly exported and type guards work
- [ ] Run unit tests for
useCatalogExtensionshook:cd frontend && yarn test useCatalogExtensions.spec.ts- [ ] Build the frontend to ensure no TypeScript errors:
cd frontend && yarn build:console- [ ] Manual testing with a plugin that uses this extension (will be done in follow-up OLMv1 PRs)
- [ ] Verify alerts render in the correct location (above catalog content)
- [ ] Verify priority sorting works correctly (higher priority alerts appear first)
🤖 Generated with Claude Code
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.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: TheRealJon
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~frontend/OWNERS~~ [TheRealJon]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
@TheRealJon: 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/e2e-gcp-console | 1668eb88cb69834adccd4182289c49cc7dbcc07a | 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.