From 73a45650e2872fdad10ea9edc9f37baa1e847957 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Thu, 20 Jun 2024 12:11:08 +0200 Subject: [PATCH] api reports Signed-off-by: Vincenzo Scamporlino --- packages/backend-app-api/api-report.md | 4 ---- .../api-report-rootHttpRouter.md | 2 ++ .../rootHealth/rootHealthServiceFactory.ts | 2 +- .../rootHttpRouterServiceFactory.ts | 2 +- packages/backend-plugin-api/api-report.md | 2 +- .../src/services/definitions/coreServices.ts | 4 ++-- packages/backend-test-utils/api-report.md | 20 +++++++++---------- .../src/next/services/mockServices.ts | 2 +- 8 files changed, 18 insertions(+), 20 deletions(-) diff --git a/packages/backend-app-api/api-report.md b/packages/backend-app-api/api-report.md index a18f027273..7518f8e2cc 100644 --- a/packages/backend-app-api/api-report.md +++ b/packages/backend-app-api/api-report.md @@ -18,7 +18,6 @@ import { ErrorRequestHandler } from 'express'; import { Express as Express_2 } from 'express'; import { Format } from 'logform'; import { Handler } from 'express'; -import { HealthService } from '@backstage/backend-plugin-api'; import { HelmetOptions } from 'helmet'; import * as http from 'http'; import { HttpAuthService } from '@backstage/backend-plugin-api'; @@ -127,9 +126,6 @@ export const discoveryServiceFactory: () => ServiceFactory< // @public @deprecated (undocumented) export type ExtendedHttpServer = ExtendedHttpServer_2; -// @public (undocumented) -export const healthServiceFactory: () => ServiceFactory; - // @public @deprecated export class HostDiscovery implements DiscoveryService { static fromConfig( diff --git a/packages/backend-defaults/api-report-rootHttpRouter.md b/packages/backend-defaults/api-report-rootHttpRouter.md index b753406202..d9727fd36d 100644 --- a/packages/backend-defaults/api-report-rootHttpRouter.md +++ b/packages/backend-defaults/api-report-rootHttpRouter.md @@ -121,6 +121,8 @@ export interface RootHttpRouterConfigureContext { // (undocumented) config: RootConfigService; // (undocumented) + healthRouter: RequestHandler; + // (undocumented) lifecycle: LifecycleService; // (undocumented) logger: LoggerService; diff --git a/packages/backend-defaults/src/entrypoints/rootHealth/rootHealthServiceFactory.ts b/packages/backend-defaults/src/entrypoints/rootHealth/rootHealthServiceFactory.ts index 3a00db8285..c8b4ad5394 100644 --- a/packages/backend-defaults/src/entrypoints/rootHealth/rootHealthServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/rootHealth/rootHealthServiceFactory.ts @@ -54,7 +54,7 @@ export class DefaultRootHealthService implements RootHealthService { * @public */ export const rootHealthServiceFactory = createServiceFactory({ - service: coreServices.health, + service: coreServices.rootHealth, deps: { lifecycle: coreServices.rootLifecycle, }, diff --git a/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts index 5f22cf5ced..22f5c2f310 100644 --- a/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts @@ -77,7 +77,7 @@ export const rootHttpRouterServiceFactory = createServiceFactory( config: coreServices.rootConfig, rootLogger: coreServices.rootLogger, lifecycle: coreServices.rootLifecycle, - health: coreServices.health, + health: coreServices.rootHealth, }, async factory({ config, rootLogger, lifecycle, health }) { const { indexPath, configure = defaultConfigure } = options ?? {}; diff --git a/packages/backend-plugin-api/api-report.md b/packages/backend-plugin-api/api-report.md index f527e366c0..ef5aa22cf4 100644 --- a/packages/backend-plugin-api/api-report.md +++ b/packages/backend-plugin-api/api-report.md @@ -194,7 +194,7 @@ export namespace coreServices { const rootConfig: ServiceRef; const database: ServiceRef; const discovery: ServiceRef; - const health: ServiceRef; + const rootHealth: ServiceRef; const httpAuth: ServiceRef; const httpRouter: ServiceRef; const lifecycle: ServiceRef; diff --git a/packages/backend-plugin-api/src/services/definitions/coreServices.ts b/packages/backend-plugin-api/src/services/definitions/coreServices.ts index 36ec0151c5..33d1da2903 100644 --- a/packages/backend-plugin-api/src/services/definitions/coreServices.ts +++ b/packages/backend-plugin-api/src/services/definitions/coreServices.ts @@ -105,9 +105,9 @@ export namespace coreServices { /** * The service reference for the plugin scoped {@link RootHealthService}. */ - export const health = createServiceRef< + export const rootHealth = createServiceRef< import('./RootHealthService').RootHealthService - >({ id: 'core.health', scope: 'root' }); + >({ id: 'core.rootHealth', scope: 'root' }); /** * Authentication of HTTP requests. diff --git a/packages/backend-test-utils/api-report.md b/packages/backend-test-utils/api-report.md index 07b393b653..a2fb4b7674 100644 --- a/packages/backend-test-utils/api-report.md +++ b/packages/backend-test-utils/api-report.md @@ -21,7 +21,6 @@ import { DiscoveryService } from '@backstage/backend-plugin-api'; import { EventsService } from '@backstage/plugin-events-node'; import { ExtendedHttpServer } from '@backstage/backend-app-api'; import { ExtensionPoint } from '@backstage/backend-plugin-api'; -import { HealthService } from '@backstage/backend-plugin-api'; import { HttpAuthService } from '@backstage/backend-plugin-api'; import { HttpRouterFactoryOptions } from '@backstage/backend-defaults/httpRouter'; import { HttpRouterService } from '@backstage/backend-plugin-api'; @@ -33,6 +32,7 @@ import { LifecycleService } from '@backstage/backend-plugin-api'; import { LoggerService } from '@backstage/backend-plugin-api'; import { PermissionsService } from '@backstage/backend-plugin-api'; import { RootConfigService } from '@backstage/backend-plugin-api'; +import { RootHealthService } from '@backstage/backend-plugin-api'; import { RootHttpRouterFactoryOptions } from '@backstage/backend-defaults/rootHttpRouter'; import { RootHttpRouterService } from '@backstage/backend-plugin-api'; import { RootLifecycleService } from '@backstage/backend-plugin-api'; @@ -200,15 +200,6 @@ export namespace mockServices { partialImpl?: Partial | undefined, ) => ServiceMock; } - // (undocumented) - export namespace health { - const // (undocumented) - factory: () => ServiceFactory; - const // (undocumented) - mock: ( - partialImpl?: Partial | undefined, - ) => ServiceMock; - } export function httpAuth(options?: { pluginId?: string; defaultCredentials?: BackstageCredentials; @@ -290,6 +281,15 @@ export namespace mockServices { ) => ServiceFactory; } // (undocumented) + export namespace rootHealth { + const // (undocumented) + factory: () => ServiceFactory; + const // (undocumented) + mock: ( + partialImpl?: Partial | undefined, + ) => ServiceMock; + } + // (undocumented) export namespace rootHttpRouter { const // (undocumented) factory: ( diff --git a/packages/backend-test-utils/src/next/services/mockServices.ts b/packages/backend-test-utils/src/next/services/mockServices.ts index 5055a9eae8..d56179d958 100644 --- a/packages/backend-test-utils/src/next/services/mockServices.ts +++ b/packages/backend-test-utils/src/next/services/mockServices.ts @@ -347,7 +347,7 @@ export namespace mockServices { export namespace rootHealth { export const factory = rootHealthServiceFactory; - export const mock = simpleMock(coreServices.health, () => ({ + export const mock = simpleMock(coreServices.rootHealth, () => ({ getLiveness: jest.fn(), getReadiness: jest.fn(), }));