move to alpha
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
"./permissions": "./src/entrypoints/permissions/index.ts",
|
||||
"./rootConfig": "./src/entrypoints/rootConfig/index.ts",
|
||||
"./rootHealth": "./src/entrypoints/rootHealth/index.ts",
|
||||
"./rootSystemMetadata": "./src/entrypoints/rootSystemMetadata/index.ts",
|
||||
"./rootHttpRouter": "./src/entrypoints/rootHttpRouter/index.ts",
|
||||
"./rootLifecycle": "./src/entrypoints/rootLifecycle/index.ts",
|
||||
"./rootLogger": "./src/entrypoints/rootLogger/index.ts",
|
||||
@@ -86,9 +85,6 @@
|
||||
"rootHealth": [
|
||||
"src/entrypoints/rootHealth/index.ts"
|
||||
],
|
||||
"rootSystemMetadata": [
|
||||
"src/entrypoints/rootSystemMetadata/index.ts"
|
||||
],
|
||||
"rootHttpRouter": [
|
||||
"src/entrypoints/rootHttpRouter/index.ts"
|
||||
],
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
import { ActionsRegistryService } from '@backstage/backend-plugin-api/alpha';
|
||||
import { ActionsService } from '@backstage/backend-plugin-api/alpha';
|
||||
import { InstanceMetadataService } from '@backstage/backend-plugin-api/alpha';
|
||||
import { RootSystemMetadataService } from '@backstage/backend-plugin-api/alpha';
|
||||
import { ServiceFactory } from '@backstage/backend-plugin-api';
|
||||
|
||||
// @public (undocumented)
|
||||
@@ -29,5 +30,12 @@ export const instanceMetadataServiceFactory: ServiceFactory<
|
||||
'singleton'
|
||||
>;
|
||||
|
||||
// @alpha
|
||||
export const rootSystemMetadataServiceFactory: ServiceFactory<
|
||||
RootSystemMetadataService,
|
||||
'root',
|
||||
'singleton'
|
||||
>;
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
```
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||||
|
||||
```ts
|
||||
import { Config } from '@backstage/config';
|
||||
import { DiscoveryService } from '@backstage/backend-plugin-api';
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import { RootConfigService } from '@backstage/backend-plugin-api';
|
||||
@@ -28,11 +27,6 @@ export class HostDiscovery implements DiscoveryService {
|
||||
// (undocumented)
|
||||
getExternalBaseUrl(pluginId: string): Promise<string>;
|
||||
// (undocumented)
|
||||
getInstanceAddress(config: Config): {
|
||||
internal: string;
|
||||
external: string;
|
||||
};
|
||||
// (undocumented)
|
||||
listResolutions(): Promise<
|
||||
Map<
|
||||
string,
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
## API Report File for "@backstage/backend-defaults"
|
||||
|
||||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||||
|
||||
```ts
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import { RootConfigService } from '@backstage/backend-plugin-api';
|
||||
import { RootInstanceMetadataService } from '@backstage/backend-plugin-api';
|
||||
import { RootSystemMetadataService } from '@backstage/backend-plugin-api';
|
||||
import { RootSystemMetadataServicePluginInfo } from '@backstage/backend-plugin-api';
|
||||
import { ServiceFactory } from '@backstage/backend-plugin-api';
|
||||
|
||||
// @alpha (undocumented)
|
||||
export class DefaultRootSystemMetadataService
|
||||
implements RootSystemMetadataService
|
||||
{
|
||||
constructor(options: {
|
||||
logger: LoggerService;
|
||||
config: RootConfigService;
|
||||
instanceMetadata: RootInstanceMetadataService;
|
||||
});
|
||||
// (undocumented)
|
||||
static create(pluginEnv: {
|
||||
logger: LoggerService;
|
||||
config: RootConfigService;
|
||||
instanceMetadata: RootInstanceMetadataService;
|
||||
}): DefaultRootSystemMetadataService;
|
||||
// (undocumented)
|
||||
getInstalledPlugins(): Promise<RootSystemMetadataServicePluginInfo[]>;
|
||||
}
|
||||
|
||||
// @alpha
|
||||
export const rootSystemMetadataServiceFactory: ServiceFactory<
|
||||
RootSystemMetadataService,
|
||||
'root',
|
||||
'singleton'
|
||||
>;
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
```
|
||||
@@ -39,8 +39,6 @@ import {
|
||||
actionsRegistryServiceFactory,
|
||||
actionsServiceFactory,
|
||||
} from '@backstage/backend-defaults/alpha';
|
||||
import { instanceMetadataServiceFactory } from './alpha/entrypoints/instanceMetadata/instanceMetadataServiceFactory';
|
||||
import { rootSystemMetadataServiceFactory } from './entrypoints/rootSystemMetadata';
|
||||
|
||||
export const defaultServiceFactories = [
|
||||
auditorServiceFactory,
|
||||
@@ -63,14 +61,10 @@ export const defaultServiceFactories = [
|
||||
userInfoServiceFactory,
|
||||
urlReaderServiceFactory,
|
||||
eventsServiceFactory,
|
||||
rootSystemMetadataServiceFactory,
|
||||
|
||||
// alpha services
|
||||
actionsRegistryServiceFactory,
|
||||
actionsServiceFactory,
|
||||
|
||||
// Unexported alpha services kept around for compatibility reasons
|
||||
instanceMetadataServiceFactory,
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
+2
-1
@@ -23,6 +23,7 @@ import {
|
||||
import Router from 'express-promise-router';
|
||||
import request from 'supertest';
|
||||
import { rootSystemMetadataServiceFactory } from './rootSystemMetadataServiceFactory';
|
||||
import { rootSystemMetadataServiceRef } from '@backstage/backend-plugin-api/alpha';
|
||||
|
||||
describe('SystemMetadataService', () => {
|
||||
describe('returns plugins from config', () => {
|
||||
@@ -31,7 +32,7 @@ describe('SystemMetadataService', () => {
|
||||
register(reg) {
|
||||
reg.registerInit({
|
||||
deps: {
|
||||
systemMetadata: coreServices.rootSystemMetadata,
|
||||
systemMetadata: rootSystemMetadataServiceRef,
|
||||
rootHttpRouter: coreServices.rootHttpRouter,
|
||||
},
|
||||
init: async ({ systemMetadata, rootHttpRouter }) => {
|
||||
+4
-2
@@ -18,10 +18,12 @@ import {
|
||||
LoggerService,
|
||||
RootConfigService,
|
||||
RootInstanceMetadataService,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { HostDiscovery } from '../../../../entrypoints/discovery';
|
||||
import {
|
||||
RootSystemMetadataService,
|
||||
RootSystemMetadataServicePluginInfo,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { HostDiscovery } from '../../discovery';
|
||||
} from '@backstage/backend-plugin-api/alpha';
|
||||
|
||||
/**
|
||||
* @alpha
|
||||
+2
-1
@@ -19,6 +19,7 @@ import {
|
||||
createServiceFactory,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { DefaultRootSystemMetadataService } from './lib/DefaultRootSystemMetadataService';
|
||||
import { rootSystemMetadataServiceRef } from '@backstage/backend-plugin-api/alpha';
|
||||
|
||||
/**
|
||||
* Metadata about an entire Backstage system, a collection of Backstage instances.
|
||||
@@ -26,7 +27,7 @@ import { DefaultRootSystemMetadataService } from './lib/DefaultRootSystemMetadat
|
||||
* @alpha
|
||||
*/
|
||||
export const rootSystemMetadataServiceFactory = createServiceFactory({
|
||||
service: coreServices.rootSystemMetadata,
|
||||
service: rootSystemMetadataServiceRef,
|
||||
deps: {
|
||||
logger: coreServices.rootLogger,
|
||||
config: coreServices.rootConfig,
|
||||
@@ -16,3 +16,4 @@
|
||||
|
||||
export { actionsRegistryServiceFactory } from './entrypoints/actionsRegistry';
|
||||
export { actionsServiceFactory } from './entrypoints/actions';
|
||||
export { rootSystemMetadataServiceFactory } from './entrypoints/rootSystemMetadata';
|
||||
|
||||
@@ -214,7 +214,7 @@ export class HostDiscovery implements DiscoveryService {
|
||||
return _targets;
|
||||
}
|
||||
|
||||
getInstanceAddress(config: Config) {
|
||||
#getInstanceAddress(config: Config) {
|
||||
const backendBaseUrl = trimEnd(config.getString('backend.baseUrl'), '/');
|
||||
|
||||
const {
|
||||
@@ -248,7 +248,7 @@ export class HostDiscovery implements DiscoveryService {
|
||||
}
|
||||
|
||||
#updateFallbackResolvers(config: Config) {
|
||||
const { internal, external } = this.getInstanceAddress(config);
|
||||
const { internal, external } = this.#getInstanceAddress(config);
|
||||
|
||||
this.#internalFallbackResolver = this.#makeResolver(
|
||||
`${internal}/api/{{pluginId}}`,
|
||||
|
||||
Reference in New Issue
Block a user