From dbf5eae24dcb088147e429b4d99011a81ec59aab Mon Sep 17 00:00:00 2001 From: aramissennyeydd Date: Mon, 10 Nov 2025 13:32:05 -0500 Subject: [PATCH] remove idea of hosts Signed-off-by: aramissennyeydd --- .../RootSystemMetadataService.test.ts | 24 ----------------- .../lib/DefaultRootSystemMetadataService.ts | 27 +++++++------------ .../definitions/RootSystemMetadataService.ts | 1 - 3 files changed, 9 insertions(+), 43 deletions(-) diff --git a/packages/backend-defaults/src/entrypoints/rootSystemMetadata/RootSystemMetadataService.test.ts b/packages/backend-defaults/src/entrypoints/rootSystemMetadata/RootSystemMetadataService.test.ts index 036840d103..a440828362 100644 --- a/packages/backend-defaults/src/entrypoints/rootSystemMetadata/RootSystemMetadataService.test.ts +++ b/packages/backend-defaults/src/entrypoints/rootSystemMetadata/RootSystemMetadataService.test.ts @@ -70,12 +70,6 @@ describe('SystemMetadataService', () => { expect(instanceResponse.status).toBe(200); expect(instanceResponse.body).toMatchObject([ { - hosts: [ - { - external: `http://localhost:0`, - internal: `http://localhost:0`, - }, - ], pluginId: 'test-plugin', }, ]); @@ -108,12 +102,6 @@ describe('SystemMetadataService', () => { expect(initialResponse.status).toBe(200); expect(initialResponse.body).toMatchObject([ { - hosts: [ - { - external: `http://localhost:0`, - internal: `http://localhost:0`, - }, - ], pluginId: 'test-plugin', }, ]); @@ -144,21 +132,9 @@ describe('SystemMetadataService', () => { expect(responseAfterUpdate.status).toBe(200); expect(responseAfterUpdate.body).toMatchObject([ { - hosts: [ - { - external: 'http://test.internal', - internal: 'http://test.internal', - }, - ], pluginId: 'your-new-plugin', }, { - hosts: [ - { - external: `http://localhost:0`, - internal: `http://localhost:0`, - }, - ], pluginId: 'test-plugin', }, ]); diff --git a/packages/backend-defaults/src/entrypoints/rootSystemMetadata/lib/DefaultRootSystemMetadataService.ts b/packages/backend-defaults/src/entrypoints/rootSystemMetadata/lib/DefaultRootSystemMetadataService.ts index 4300cc94d3..be1ab6b818 100644 --- a/packages/backend-defaults/src/entrypoints/rootSystemMetadata/lib/DefaultRootSystemMetadataService.ts +++ b/packages/backend-defaults/src/entrypoints/rootSystemMetadata/lib/DefaultRootSystemMetadataService.ts @@ -31,7 +31,6 @@ export class DefaultRootSystemMetadataService { #hostDiscovery: HostDiscovery; #instanceMetadata: RootInstanceMetadataService; - #config: RootConfigService; constructor(options: { logger: LoggerService; config: RootConfigService; @@ -46,7 +45,6 @@ export class DefaultRootSystemMetadataService }); }); this.#instanceMetadata = options.instanceMetadata; - this.#config = options.config; } public static create(pluginEnv: { @@ -61,22 +59,15 @@ export class DefaultRootSystemMetadataService RootSystemMetadataServicePluginInfo[] > { const resolutions = await this.#hostDiscovery.listResolutions(); - const instanceAddress = this.#hostDiscovery.getInstanceAddress( - this.#config, - ); - const currentInstance = await this.#instanceMetadata.getInstalledPlugins(); - for (const plugin of currentInstance) { - if (!resolutions.has(plugin.pluginId)) { - resolutions.set(plugin.pluginId, []); - } - resolutions.get(plugin.pluginId)?.push(instanceAddress); + const plugins = []; + for (const pluginId of resolutions.keys()) { + plugins.push({ pluginId }); } - return Array.from(resolutions.entries()).map(([pluginId, targets]) => ({ - pluginId, - hosts: Array.from(targets).filter( - (target): target is { external: string; internal: string } => - Object.keys(target).length > 0, - ), - })); + + for (const plugin of await this.#instanceMetadata.getInstalledPlugins()) { + plugins.push({ pluginId: plugin.pluginId }); + } + + return plugins; } } diff --git a/packages/backend-plugin-api/src/services/definitions/RootSystemMetadataService.ts b/packages/backend-plugin-api/src/services/definitions/RootSystemMetadataService.ts index 4e174a2c59..67cc43f8af 100644 --- a/packages/backend-plugin-api/src/services/definitions/RootSystemMetadataService.ts +++ b/packages/backend-plugin-api/src/services/definitions/RootSystemMetadataService.ts @@ -17,7 +17,6 @@ /** @public */ export interface RootSystemMetadataServicePluginInfo { readonly pluginId: string; - readonly hosts: (string | { external: string; internal: string })[]; } /** @public */