Skip to content
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

Merged

Conversation

rohitkrai03
Copy link
Contributor

Fixes:

Analysis / Root cause: We needed a way to extend dev catalog using plugin extensions.

Solution Description:
This PR -

  • Adds new type definitions from catalog extensions.
  • Create new extension providers for all the catalog items.
  • Add a new catalog service provider component that fetches all the catalog items and provides an API to search and query items.
  • Adds new catalog page and controller components to test the service provider.

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:

  • Chrome
  • Firefox
  • Safari
  • Edge

@openshift-ci-robot openshift-ci-robot added component/dev-console Related to dev-console component/olm Related to OLM labels Oct 28, 2020
@openshift-ci-robot openshift-ci-robot added component/sdk Related to console-plugin-sdk approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 28, 2020
@rohitkrai03
Copy link
Contributor Author

/assign @christianvogt

@rohitkrai03
Copy link
Contributor Author

/retest

@rohitkrai03
Copy link
Contributor Author

/retest

frontend/packages/console-plugin-sdk/src/typings/base.ts Outdated Show resolved Hide resolved
Comment on lines +15 to +16
const itemTypeExtensions = useResolvedExtensions<CatalogItemType>(isCatalogItemType);
const itemProviderExtensions = useResolvedExtensions<CatalogItemProvider>(isCatalogItemProvider);
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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:

Suggested change
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);

@rohitkrai03 rohitkrai03 force-pushed the catalog-extensibility branch 7 times, most recently from 245361f to d812809 Compare November 9, 2020 20:36
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.',
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Comment on lines +15 to +16
const itemTypeExtensions = useResolvedExtensions<CatalogItemType>(isCatalogItemType);
const itemProviderExtensions = useResolvedExtensions<CatalogItemProvider>(isCatalogItemProvider);
Copy link
Contributor

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:

Suggested change
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);

itemsMap: { [key: string]: CatalogItem[] };
loaded: boolean;
loadError: any;
searchCatalog: (query: string) => CatalogItem[];
Copy link
Contributor

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.

@christianvogt
Copy link
Contributor

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 10, 2020
@openshift-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rohitkrai03
Copy link
Contributor Author

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot
Copy link
Contributor

@rohitkrai03: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-gcp-console 1cf8944 link /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/test-infra repository. I understand the commands that are listed here.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 18e98ac into openshift:master Nov 11, 2020
@spadgett spadgett added this to the v4.7 milestone Nov 16, 2020
@rohitkrai03 rohitkrai03 deleted the catalog-extensibility branch July 24, 2021 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/dev-console Related to dev-console component/olm Related to OLM component/sdk Related to console-plugin-sdk lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants