-
Notifications
You must be signed in to change notification settings - Fork 526
tech-insights: ability to add filters on the checks #6697
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
base: main
Are you sure you want to change the base?
Conversation
Changed Packages
|
816f4b0 to
cf031e1
Compare
Signed-off-by: surajnarwade <[email protected]> Signed-off-by: surajnarwade <[email protected]>
Signed-off-by: surajnarwade <[email protected]> Signed-off-by: surajnarwade <[email protected]>
cf031e1 to
d16ac69
Compare
Signed-off-by: surajnarwade <[email protected]>
Signed-off-by: surajnarwade <[email protected]>
Signed-off-by: surajnarwade <[email protected]>
Signed-off-by: surajnarwade <[email protected]>
| deps: { | ||
| config: coreServices.rootConfig, | ||
| logger: coreServices.logger, | ||
| discovery: coreServices.discovery, | ||
| techInsights: techInsightsFactCheckerFactoryExtensionPoint, | ||
| }, | ||
| async init({ config, logger, techInsights }) { | ||
| async init({ config, logger, discovery, techInsights }) { | ||
| const catalogClient = new CatalogClient({ discoveryApi: discovery }); | ||
| const factory = JsonRulesEngineFactCheckerFactory.fromConfig(config, { | ||
| logger, | ||
| catalogApi: catalogClient, |
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.
A better route is having the module define catalog as a dependency with catalogServiceRef from @backstage/plugin-catalog-node. This is the newer way of communicating with the catalog as it includes auth support. In this scenario, I think passing { credentials: await this.auth.getOwnServiceCredentials() } as the second argument to the catalog api calls would suffice.
deps: {
config: coreServices.rootConfig,
logger: coreServices.logger,
- discovery: coreServices.discovery,
+ catalog: catalogServiceRef,
+ auth: coreServices.auth,
techInsights: techInsightsFactCheckerFactoryExtensionPoint,
}wdyt?
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 thought it's discouraged: https://backstage.io/docs/features/software-catalog/faq/#can-i-call-the-catalog-itself-from-inside-a-processor--provider 🤔
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.
That is referring to the ingestion and processing of entities in the catalog, known as EntityProvider and EntityProcessor. This factory class is neither a catalog provider or processor.
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.
ah okay, now it make sense. sorry I misunderstood earlier. I now found the similar references:
community-plugins/workspaces/lighthouse/plugins/lighthouse-backend/src/service/EntitiesLoader.ts
Line 32 in a872eb7
const { token } = await auth.getPluginRequestToken({ catalogClient: catalogServiceRef,
I will update my code accordingly, thank you for the review.
Signed-off-by: surajnarwade <[email protected]>
This PR solves this issue: #4259
Hey, I just made a Pull Request!
✔️ Checklist
Signed-off-byline in the message. (more info)