Fixed catalog backend tests and move backend-common to dependencies

Signed-off-by: David Lilienfeld <davidlilienfeld4@gmail.com>
This commit is contained in:
David Lilienfeld
2024-06-19 00:47:06 -04:00
parent 7b3ed9b928
commit 02e6dd48e9
6 changed files with 76 additions and 51 deletions
@@ -50,6 +50,7 @@
"test": "backstage-cli package test"
},
"dependencies": {
"@backstage/backend-common": "workspace:^",
"@backstage/backend-plugin-api": "workspace:^",
"@backstage/backend-tasks": "workspace:^",
"@backstage/catalog-client": "workspace:^",
@@ -66,7 +67,6 @@
"uuid": "^11.0.0"
},
"devDependencies": {
"@backstage/backend-common": "workspace:^",
"@backstage/backend-test-utils": "workspace:^",
"@backstage/cli": "workspace:^",
"@backstage/plugin-events-backend-test-utils": "workspace:^",
@@ -22,7 +22,6 @@ import { EntityProviderConnection } from '@backstage/plugin-catalog-node';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';
import { TestEventsService } from '@backstage/plugin-events-backend-test-utils';
import { eventsServiceRef } from '@backstage/plugin-events-node';
import { Duration } from 'luxon';
import { catalogModuleBitbucketServerEntityProvider } from './catalogModuleBitbucketServerEntityProvider';
import { BitbucketServerEntityProvider } from '../providers/BitbucketServerEntityProvider';
@@ -53,35 +52,35 @@ describe('catalogModuleBitbucketServerEntityProvider', () => {
},
});
const config = {
catalog: {
providers: {
bitbucketServer: {
host: 'bitbucket.mycompany.com',
schedule: {
frequency: 'P1M',
timeout: 'PT3M',
},
},
},
},
integrations: {
bitbucketServer: [
{
host: 'bitbucket.mycompany.com',
},
],
},
};
await startTestBackend({
extensionPoints: [
[catalogProcessingExtensionPoint, catalogExtensionPointImpl],
],
features: [
eventsServiceFactory(),
catalogModuleBitbucketServerEntityProvider,
mockServices.rootConfig.factory({ data: config }),
mockServices.logger.factory(),
mockServices.rootConfig.factory({
data: {
catalog: {
providers: {
bitbucketServer: {
host: 'bitbucket.mycompany.com',
schedule: {
frequency: 'P1M',
timeout: 'PT3M',
},
},
},
},
integrations: {
bitbucketServer: [
{
host: 'bitbucket.mycompany.com',
},
],
},
},
}),
scheduler.factory,
],
});
@@ -77,8 +77,8 @@ export class BitbucketServerEntityProvider implements EntityProvider {
logger: LoggerService;
events?: EventsService;
parser?: BitbucketServerLocationParser;
schedule?: TaskRunner;
scheduler?: PluginTaskScheduler;
schedule?: SchedulerServiceTaskRunner;
scheduler?: SchedulerService;
catalogApi?: CatalogApi;
tokenManager?: TokenManager;
},
@@ -3,10 +3,10 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { BackendFeature } from '@backstage/backend-plugin-api';
import { BackendFeatureCompat } from '@backstage/backend-plugin-api';
// @alpha
const eventsModuleBitbucketServerEventRouter: () => BackendFeature;
const eventsModuleBitbucketServerEventRouter: BackendFeatureCompat;
export default eventsModuleBitbucketServerEventRouter;
export { eventsModuleBitbucketServerEventRouter };
@@ -1,17 +1,28 @@
{
"name": "@backstage/plugin-events-backend-module-bitbucket-server",
"version": "0.1.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
"backstage": {
"role": "backend-plugin-module",
"pluginId": "events",
"pluginPackage": "@backstage/plugin-events-backend"
},
"publishConfig": {
"access": "public"
},
"homepage": "https://backstage.io",
"repository": {
"type": "git",
"url": "https://github.com/backstage/backstage",
"directory": "plugins/events-backend-module-bitbucket-server"
},
"license": "Apache-2.0",
"exports": {
".": "./src/index.ts",
"./alpha": "./src/alpha.ts",
"./package.json": "./package.json"
},
"main": "src/index.ts",
"types": "src/index.ts",
"typesVersions": {
"*": {
"alpha": [
@@ -22,22 +33,17 @@
]
}
},
"repository": {
"type": "git",
"url": "https://github.com/backstage/backstage",
"directory": "plugins/events-backend-module-bitbucket-server"
},
"backstage": {
"role": "backend-plugin-module"
},
"files": [
"dist"
],
"scripts": {
"start": "backstage-cli package start",
"build": "backstage-cli package build",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test",
"clean": "backstage-cli package clean",
"lint": "backstage-cli package lint",
"prepack": "backstage-cli package prepack",
"postpack": "backstage-cli package postpack"
"postpack": "backstage-cli package postpack",
"start": "backstage-cli package start",
"test": "backstage-cli package test"
},
"dependencies": {
"@backstage/backend-plugin-api": "workspace:^",
@@ -46,10 +52,6 @@
"devDependencies": {
"@backstage/backend-test-utils": "workspace:^",
"@backstage/cli": "workspace:^",
"@backstage/plugin-events-backend-test-utils": "workspace:^",
"supertest": "^6.1.3"
},
"files": [
"dist"
]
"@backstage/plugin-events-backend-test-utils": "workspace:^"
}
}
+25 -1
View File
@@ -3794,6 +3794,29 @@ __metadata:
languageName: unknown
linkType: soft
"@backstage/backend-tasks@workspace:^, @backstage/backend-tasks@workspace:packages/backend-tasks":
version: 0.0.0-use.local
resolution: "@backstage/backend-tasks@workspace:packages/backend-tasks"
dependencies:
"@backstage/backend-common": "workspace:^"
"@backstage/backend-plugin-api": "workspace:^"
"@backstage/backend-test-utils": "workspace:^"
"@backstage/cli": "workspace:^"
"@backstage/config": "workspace:^"
"@backstage/errors": "workspace:^"
"@backstage/types": "workspace:^"
"@opentelemetry/api": ^1.3.0
"@types/luxon": ^3.0.0
cron: ^3.0.0
knex: ^3.0.0
lodash: ^4.17.21
luxon: ^3.0.0
uuid: ^9.0.0
wait-for-expect: ^3.0.2
zod: ^3.22.4
languageName: unknown
linkType: soft
"@backstage/backend-test-utils@workspace:^, @backstage/backend-test-utils@workspace:packages/backend-test-utils":
version: 0.0.0-use.local
resolution: "@backstage/backend-test-utils@workspace:packages/backend-test-utils"
@@ -5737,7 +5760,9 @@ __metadata:
version: 0.0.0-use.local
resolution: "@backstage/plugin-catalog-backend-module-bitbucket-server@workspace:plugins/catalog-backend-module-bitbucket-server"
dependencies:
"@backstage/backend-common": "workspace:^"
"@backstage/backend-plugin-api": "workspace:^"
"@backstage/backend-tasks": "workspace:^"
"@backstage/backend-test-utils": "workspace:^"
"@backstage/catalog-client": "workspace:^"
"@backstage/catalog-model": "workspace:^"
@@ -6568,7 +6593,6 @@ __metadata:
"@backstage/cli": "workspace:^"
"@backstage/plugin-events-backend-test-utils": "workspace:^"
"@backstage/plugin-events-node": "workspace:^"
supertest: ^6.1.3
languageName: unknown
linkType: soft