remove old alpha instance metadata service

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2025-11-24 17:16:56 +01:00
parent 2b3fb40d06
commit d9759a1ba6
11 changed files with 52 additions and 112 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/backend-defaults': patch
'@backstage/backend-plugin-api': patch
---
**BREAKING ALPHA**: The old `instanceMetadataService` has been removed from alpha. Please switch over to using the stable `coreServices.rootInstanceMetadata` and related types instead, available from `@backstage/backend-plugin-api`.
@@ -5,7 +5,6 @@
```ts
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 { ServiceFactory } from '@backstage/backend-plugin-api';
// @public (undocumented)
@@ -22,12 +21,5 @@ export const actionsServiceFactory: ServiceFactory<
'singleton'
>;
// @alpha @deprecated (undocumented)
export const instanceMetadataServiceFactory: ServiceFactory<
InstanceMetadataService,
'plugin',
'singleton'
>;
// (No @packageDocumentation comment for this package)
```
@@ -38,8 +38,8 @@ import { eventsServiceFactory } from '@backstage/plugin-events-node';
import {
actionsRegistryServiceFactory,
actionsServiceFactory,
instanceMetadataServiceFactory,
} from '@backstage/backend-defaults/alpha';
import { instanceMetadataServiceFactory } from './alpha/entrypoints/instanceMetadata/instanceMetadataServiceFactory';
export const defaultServiceFactories = [
auditorServiceFactory,
@@ -66,6 +66,8 @@ export const defaultServiceFactories = [
// alpha services
actionsRegistryServiceFactory,
actionsServiceFactory,
// Unexported alpha services kept around for compatibility reasons
instanceMetadataServiceFactory,
];
@@ -1,17 +0,0 @@
/*
* Copyright 2025 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { instanceMetadataServiceFactory } from './instanceMetadataServiceFactory';
@@ -18,9 +18,11 @@ import {
coreServices,
createBackendPlugin,
} from '@backstage/backend-plugin-api';
import { instanceMetadataServiceFactory } from './instanceMetadataServiceFactory';
import {
instanceMetadataServiceFactory,
instanceMetadataServiceRef,
} from './instanceMetadataServiceFactory';
import { startTestBackend } from '@backstage/backend-test-utils';
import { instanceMetadataServiceRef } from '@backstage/backend-plugin-api/alpha';
import Router from 'express-promise-router';
import request from 'supertest';
@@ -17,16 +17,46 @@
import {
coreServices,
createServiceFactory,
createServiceRef,
} from '@backstage/backend-plugin-api';
import {
BackendFeatureMeta,
InstanceMetadataService,
instanceMetadataServiceRef,
} from '@backstage/backend-plugin-api/alpha';
/*
* NOTE(freben): We have moved over to coreServices.rootInstanceMetadata. This
* old alpha implementation is kept around for a little longer for backward
* compatibility reasons.
*/
/**
* @alpha
* @deprecated use {@link @backstage/backend-plugin-api#coreServices.rootInstanceMetadata} instead
* @internal
*/
export type BackendFeatureMeta =
| {
type: 'plugin';
pluginId: string;
}
| {
type: 'module';
pluginId: string;
moduleId: string;
};
/**
* @internal
*/
export interface InstanceMetadataService {
getInstalledFeatures: () => BackendFeatureMeta[];
}
/**
* @internal
*/
export const instanceMetadataServiceRef =
createServiceRef<InstanceMetadataService>({
id: 'core.instanceMetadata',
});
/**
* @internal
*/
export const instanceMetadataServiceFactory = createServiceFactory({
service: instanceMetadataServiceRef,
+1 -1
View File
@@ -13,6 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { actionsRegistryServiceFactory } from './entrypoints/actionsRegistry';
export { actionsServiceFactory } from './entrypoints/actions';
export { instanceMetadataServiceFactory } from './entrypoints/instanceMetadata';
@@ -103,30 +103,5 @@ export const actionsServiceRef: ServiceRef<
'singleton'
>;
// @alpha (undocumented)
export type BackendFeatureMeta =
| {
type: 'plugin';
pluginId: string;
}
| {
type: 'module';
pluginId: string;
moduleId: string;
};
// @alpha (undocumented)
export interface InstanceMetadataService {
// (undocumented)
getInstalledFeatures: () => BackendFeatureMeta[];
}
// @alpha (undocumented)
export const instanceMetadataServiceRef: ServiceRef<
InstanceMetadataService,
'plugin',
'singleton'
>;
// (No @packageDocumentation comment for this package)
```
@@ -1,32 +0,0 @@
/*
* Copyright 2025 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/** @alpha */
export type BackendFeatureMeta =
| {
type: 'plugin';
pluginId: string;
}
| {
type: 'module';
pluginId: string;
moduleId: string;
};
/** @alpha */
export interface InstanceMetadataService {
getInstalledFeatures: () => BackendFeatureMeta[];
}
+1 -10
View File
@@ -14,11 +14,6 @@
* limitations under the License.
*/
export type {
BackendFeatureMeta,
InstanceMetadataService,
} from './InstanceMetadataService';
export type {
ActionsRegistryService,
ActionsRegistryActionOptions,
@@ -27,8 +22,4 @@ export type {
export type { ActionsService, ActionsServiceAction } from './ActionsService';
export {
actionsRegistryServiceRef,
actionsServiceRef,
instanceMetadataServiceRef,
} from './refs';
export { actionsRegistryServiceRef, actionsServiceRef } from './refs';
@@ -16,15 +16,6 @@
import { createServiceRef } from '@backstage/backend-plugin-api';
/**
* @alpha
*/
export const instanceMetadataServiceRef = createServiceRef<
import('./InstanceMetadataService').InstanceMetadataService
>({
id: 'core.instanceMetadata',
});
/**
* Service for calling distributed actions
*