-
Notifications
You must be signed in to change notification settings - Fork 605
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
Add new catalog extensions and catalog service provider #7023
Add new catalog extensions and catalog service provider #7023
Conversation
/assign @christianvogt |
2458118
to
7e405f3
Compare
/retest |
7e405f3
to
fd39f1a
Compare
/retest |
frontend/packages/dev-console/src/components/catalog/providers/index.ts
Outdated
Show resolved
Hide resolved
frontend/packages/console-plugin-sdk/src/typings/dev-catalog.ts
Outdated
Show resolved
Hide resolved
const itemTypeExtensions = useResolvedExtensions<CatalogItemType>(isCatalogItemType); | ||
const itemProviderExtensions = useResolvedExtensions<CatalogItemProvider>(isCatalogItemProvider); |
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.
Would be good to have support for resolving a specific set of extensions so that we can filter by type first.
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.
You mean have ability in useResolvedExtensions to resolve specific types of extensions?
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.
We don't need to do this now but I was just suggesting something like this to prevent resolving of references we don't yet intend on using:
const itemTypeExtensions = useResolvedExtensions<CatalogItemType>(isCatalogItemType); | |
const itemProviderExtensions = useResolvedExtensions<CatalogItemProvider>(isCatalogItemProvider); | |
const itemTypeExtensions = useResolvedExtensions<CatalogItemType>(isCatalogItemType); | |
const itemProviderExtensions = useResolvedExtensions<CatalogItemType>(isCatalogItemProvider); | |
const resolvedItemTypeExtensions = useResolvedExtensions(itemTypeExtensions.filter(e => e.properties.type === catalogType); | |
const resolvedItemProviderExtensions = useResolvedExtensions(itemProviderExtensions.filter(e => e.properties.type === catalogType); |
frontend/packages/dev-console/src/components/catalog/service/CatalogExtensionHookResolver.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/dev-console/src/components/catalog/service/CatalogItemsLoader.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/dev-console/src/components/catalog/service/CatalogItemsLoader.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/operator-lifecycle-manager/src/utils/useClusterServiceVersions.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/console-plugin-sdk/src/typings/dev-catalog.ts
Outdated
Show resolved
Hide resolved
245361f
to
d812809
Compare
frontend/packages/console-dynamic-plugin-sdk/src/coderefs/coderef-utils.ts
Show resolved
Hide resolved
frontend/packages/console-plugin-sdk/src/typings/dev-catalog.ts
Outdated
Show resolved
Hide resolved
frontend/packages/console-plugin-sdk/src/typings/dev-catalog.ts
Outdated
Show resolved
Hide resolved
catalogDescription: | ||
'Browse for container images that support a particular language or framework. Cluster administrators can customize the content made available in the catalog.', | ||
typeDescription: | ||
'Builder images are container images that build source code for a particular language or framework.', |
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.
UX had the type string as bold. Do we need to bold it? Which means supporting react components here instead of strings. I'm happier to keep it as a string.
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.
I would like to keep it a string. We can talk to UX about this. If needed we can make it a markdown instead which will still be string type.
const itemTypeExtensions = useResolvedExtensions<CatalogItemType>(isCatalogItemType); | ||
const itemProviderExtensions = useResolvedExtensions<CatalogItemProvider>(isCatalogItemProvider); |
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.
We don't need to do this now but I was just suggesting something like this to prevent resolving of references we don't yet intend on using:
const itemTypeExtensions = useResolvedExtensions<CatalogItemType>(isCatalogItemType); | |
const itemProviderExtensions = useResolvedExtensions<CatalogItemProvider>(isCatalogItemProvider); | |
const itemTypeExtensions = useResolvedExtensions<CatalogItemType>(isCatalogItemType); | |
const itemProviderExtensions = useResolvedExtensions<CatalogItemType>(isCatalogItemProvider); | |
const resolvedItemTypeExtensions = useResolvedExtensions(itemTypeExtensions.filter(e => e.properties.type === catalogType); | |
const resolvedItemProviderExtensions = useResolvedExtensions(itemProviderExtensions.filter(e => e.properties.type === catalogType); |
frontend/packages/dev-console/src/components/catalog/providers/useHelmCharts.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/dev-console/src/components/catalog/service/CatalogItemsLoader.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/dev-console/src/components/catalog/service/CatalogServiceProvider.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/dev-console/src/components/catalog/service/CatalogServiceProvider.tsx
Outdated
Show resolved
Hide resolved
d812809
to
1cf8944
Compare
itemsMap: { [key: string]: CatalogItem[] }; | ||
loaded: boolean; | ||
loadError: any; | ||
searchCatalog: (query: string) => CatalogItem[]; |
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.
Unsure if this is the best API for searching the catalog vs a simple util or something else. This feature isn't used yet in this PR. We can re-visit this when we get to implementing the search capabilities.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt, rohitkrai03 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 |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
@rohitkrai03: 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/test-infra repository. I understand the commands that are listed here. |
/retest Please review the full test history for this PR and help us cut down flakes. |
Fixes:
Analysis / Root cause: We needed a way to extend dev catalog using plugin extensions.
Solution Description:
This PR -
Unit test coverage report: Coming soon.
Test setup:
Right now the PR doesn't change anything from UI perspective. It just adds new extensions, providers and APIs to access catalog items. There is a test component and route added which can be used to test the PR changes. To test in the UI try the below URLs -
Browser conformance: