-
Notifications
You must be signed in to change notification settings - Fork 17
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
Dynamic plugin #64
Dynamic plugin #64
Conversation
Signed-off-by: Ali Ok <aliok@redhat.com>
@aliok: The label(s) 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 kubernetes-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aliok 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 |
Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
…xport-dynamic` command overrides it Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
Going to do the release scripts in another problem, because I see there are some issues. |
Signed-off-by: Ali Ok <aliok@redhat.com>
@Zaperex could you take a look at this PR? |
/lgtm |
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.
register(env) { | ||
env.registerInit({ | ||
deps: { | ||
catalog: catalogProcessingExtensionPoint, |
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.
catalog: catalogProcessingExtensionPoint, | |
catalog: catalogProcessingExtensionPoint, | |
catalogApi: catalogServiceRef, |
const catalogApi = new CatalogClient({ | ||
discoveryApi: discovery, | ||
}); | ||
|
||
const knativeEventMeshProcessor = new KnativeEventMeshProcessor(catalogApi, loggerToWinstonLogger(logger)); |
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.
const catalogApi = new CatalogClient({ | |
discoveryApi: discovery, | |
}); | |
const knativeEventMeshProcessor = new KnativeEventMeshProcessor(catalogApi, loggerToWinstonLogger(logger)); | |
const knativeEventMeshProcessor = new KnativeEventMeshProcessor(catalogApi, loggerToWinstonLogger(logger)); |
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.
Also heads up, but for your processor, you should change the CatalogClient
to CatalogApi
since CatalogClient
is a class not a type/interface.
import {CatalogClient} from "@backstage/catalog-client"; | ||
import {catalogProcessingExtensionPoint} from '@backstage/plugin-catalog-node/alpha'; |
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.
import {CatalogClient} from "@backstage/catalog-client"; | |
import {catalogProcessingExtensionPoint} from '@backstage/plugin-catalog-node/alpha'; | |
import { catalogServiceRef, catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha'; |
scheduler: coreServices.scheduler, | ||
discovery: coreServices.discovery, | ||
}, | ||
async init({catalog, config, logger, scheduler, discovery}) { |
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.
async init({catalog, config, logger, scheduler, discovery}) { | |
async init({ catalogApi, catalog, config, logger, scheduler }) { |
Changes
🎁 Made the plugin dynamic
Backstage has a WIP proposal to allow plugins to be loaded dynamically. While this is not done in upstream Backstage yet, Janus IDP has implemented this feature.
With this PR, we make the plugin dynamic so that it can be used by Janus IDP without changing the source code of Backstage.
For testing, you can clone my fork of Janus Showcase, using the
feature-dynamic-plugin-works-now
branch: https://github.com/aliok/backstage-showcase/tree/feature-dynamic-plugin-works-nowI've overridden the Git ignore rules to check in the generated files, so you should be able to simply do
yarn install
andyarn start
to start the showcase and see the plugin working. However, please note that it requires a couple of things:Essentially the same steps from https://github.com/aliok/knative-backstage-demo?tab=readme-ov-file#starting-up until the "Start Backstage" step.
Screenshot:
Next steps:
knative-extensions
org