Merge pull request #10071 from Erog38/feature/insights-tasks

updating backend-tasks and tech-insights to work together
This commit is contained in:
Fredrik Adelöw
2022-03-22 19:59:52 +01:00
committed by GitHub
22 changed files with 395 additions and 160 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-tasks': minor
---
Adds the ability to manually trigger tasks which are registered
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-tech-insights-node': patch
---
Adds an optional timeout to fact retriever registrations to stop a task if it runs too long.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-tech-insights-backend-module-jsonfc': patch
---
Removes node-cron from tech-insights to utilize backend-tasks
+18
View File
@@ -0,0 +1,18 @@
---
'@backstage/plugin-tech-insights-backend': minor
---
This backend now uses the `@backstage/backend-tasks` package facilities for scheduling fact retrievers.
**BREAKING**: The `buildTechInsightsContext` function now takes an additional field in its options argument: `scheduler`. This is an instance of `PluginTaskScheduler`, which can be found in your backend initialization code's `env`.
```diff
const builder = buildTechInsightsContext({
logger: env.logger,
config: env.config,
database: env.database,
discovery: env.discovery,
+ scheduler: env.scheduler,
factRetrievers: [ /* ... */ ],
});
```