diff --git a/packages/backend/CHANGELOG.md b/packages/backend/CHANGELOG.md index f0ab1deed..8aeeffbd3 100644 --- a/packages/backend/CHANGELOG.md +++ b/packages/backend/CHANGELOG.md @@ -1,5 +1,22 @@ # backend +## 2.3.0 + +### Minor Changes + +- 8915f83: We are making the logger compatible with Backstage's LoggerService and winston's Logger so that Roadie can be used with newer and older versions of Backstage. + +### Patch Changes + +- Updated dependencies [8915f83] + - @roadiehq/scaffolder-backend-module-http-request@5.2.0 + - @roadiehq/backstage-plugin-argo-cd-backend@3.3.0 + - @roadiehq/rag-ai-backend-embeddings-openai@0.4.0 + - @roadiehq/catalog-backend-module-aws@5.3.0 + - @roadiehq/backstage-plugin-aws-auth@0.5.0 + - @roadiehq/backstage-plugin-aws-backend@1.3.0 + - @roadiehq/rag-ai-backend@1.3.0 + ## 2.2.0 ### Minor Changes diff --git a/packages/backend/package.json b/packages/backend/package.json index cf1bd19d7..d432d8c6a 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -1,6 +1,6 @@ { "name": "backend", - "version": "2.2.0", + "version": "2.3.0", "main": "dist/index.cjs.js", "types": "src/index.ts", "private": true, @@ -41,20 +41,20 @@ "@langchain/core": "^0.2.27", "@langchain/openai": "^0.2.7", "@octokit/rest": "^19.0.3", - "@roadiehq/backstage-plugin-argo-cd-backend": "3.2.3", + "@roadiehq/backstage-plugin-argo-cd-backend": "3.3.0", "@roadiehq/plugin-wiz-backend": "^1.0.0", - "@roadiehq/backstage-plugin-aws-auth": "^0.4.26", - "@roadiehq/backstage-plugin-aws-backend": "^1.2.0", - "@roadiehq/catalog-backend-module-aws": "^5.2.0", + "@roadiehq/backstage-plugin-aws-auth": "^0.5.0", + "@roadiehq/backstage-plugin-aws-backend": "^1.3.0", + "@roadiehq/catalog-backend-module-aws": "^5.3.0", "@roadiehq/catalog-backend-module-okta": "^1.0.3", - "@roadiehq/rag-ai-backend": "^1.2.0", + "@roadiehq/rag-ai-backend": "^1.3.0", "@roadiehq/rag-ai-backend-embeddings-aws": "^1.0.0", - "@roadiehq/rag-ai-backend-embeddings-openai": "^0.3.0", + "@roadiehq/rag-ai-backend-embeddings-openai": "^0.4.0", "@roadiehq/rag-ai-backend-retrieval-augmenter": "^1.0.4", "@roadiehq/rag-ai-storage-pgvector": "^1.0.2", "@roadiehq/catalog-backend-module-gravatar": "^1.0.5", "@roadiehq/scaffolder-backend-module-aws": "^2.4.26", - "@roadiehq/scaffolder-backend-module-http-request": "^5.0.0", + "@roadiehq/scaffolder-backend-module-http-request": "^5.2.0", "@roadiehq/scaffolder-backend-module-utils": "^3.0.0", "app": "^1.1.8", "better-sqlite3": "^9.0.0", diff --git a/packages/backend/src/plugins/proxy.ts b/packages/backend/src/plugins/proxy.ts index af76531ef..6b536922d 100644 --- a/packages/backend/src/plugins/proxy.ts +++ b/packages/backend/src/plugins/proxy.ts @@ -16,11 +16,15 @@ import { createRouter } from '@backstage/plugin-proxy-backend'; import { Router } from 'express'; import { PluginEnvironment } from '../types'; +import { loggerToWinstonLogger } from '@backstage/backend-common'; +import { Logger } from 'winston'; export default async function createPlugin({ logger, config, discovery, }: PluginEnvironment): Promise { - return await createRouter({ logger, config, discovery }); + const winstonLogger = + logger instanceof Logger ? logger : loggerToWinstonLogger(logger); + return await createRouter({ logger: winstonLogger, config, discovery }); } diff --git a/packages/backend/src/plugins/scaffolder.ts b/packages/backend/src/plugins/scaffolder.ts index 9429a6f86..a294deede 100644 --- a/packages/backend/src/plugins/scaffolder.ts +++ b/packages/backend/src/plugins/scaffolder.ts @@ -16,6 +16,7 @@ import { ContainerRunner, DockerContainerRunner, + loggerToWinstonLogger, } from '@backstage/backend-common'; import { CatalogClient } from '@backstage/catalog-client'; import { TemplateAction } from '@backstage/plugin-scaffolder-node'; @@ -49,6 +50,7 @@ import { ScmIntegrations } from '@backstage/integration'; import { Config } from '@backstage/config'; import { DiscoveryApi } from '@backstage/plugin-permission-common'; import { UrlReaderService } from '@backstage/backend-plugin-api'; +import { Logger } from 'winston'; export const createActions = (options: { reader: UrlReaderService; @@ -98,8 +100,11 @@ export default async function createPlugin({ const catalogClient = new CatalogClient({ discoveryApi: discovery }); + const winstonLogger = + logger instanceof Logger ? logger : loggerToWinstonLogger(logger); + return await createRouter({ - logger, + logger: winstonLogger, config, database, catalogClient, diff --git a/packages/backend/src/plugins/techdocs.ts b/packages/backend/src/plugins/techdocs.ts index 7168e72dd..49e2736e9 100644 --- a/packages/backend/src/plugins/techdocs.ts +++ b/packages/backend/src/plugins/techdocs.ts @@ -20,6 +20,8 @@ import { Preparers, Publisher, } from '@backstage/plugin-techdocs-backend'; +import { Logger } from 'winston'; +import { loggerToWinstonLogger } from '@backstage/backend-common'; import Docker from 'dockerode'; import { Router } from 'express'; import { PluginEnvironment } from '../types'; @@ -58,11 +60,14 @@ export default async function createPlugin({ // checks if the publisher is working and logs the result await publisher.getReadiness(); + const winstonLogger = + logger instanceof Logger ? logger : loggerToWinstonLogger(logger); + return await createRouter({ preparers, generators, publisher, - logger, + logger: winstonLogger, config, discovery, cache, diff --git a/packages/backend/src/types.ts b/packages/backend/src/types.ts index 162740e0e..148f93912 100644 --- a/packages/backend/src/types.ts +++ b/packages/backend/src/types.ts @@ -14,6 +14,7 @@ * limitations under the License. */ import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { PluginCacheManager, @@ -26,7 +27,7 @@ import { PluginTaskScheduler } from '@backstage/backend-tasks'; import { UrlReaderService } from '@backstage/backend-plugin-api'; export type PluginEnvironment = { - logger: Logger; + logger: Logger | LoggerService; cache: PluginCacheManager; database: PluginDatabaseManager; config: Config; diff --git a/plugins/backend/backstage-aws-backend/CHANGELOG.md b/plugins/backend/backstage-aws-backend/CHANGELOG.md index 826c1d449..b78ae566d 100644 --- a/plugins/backend/backstage-aws-backend/CHANGELOG.md +++ b/plugins/backend/backstage-aws-backend/CHANGELOG.md @@ -1,5 +1,11 @@ # @roadiehq/backstage-plugin-aws-backend +## 1.3.0 + +### Minor Changes + +- 8915f83: We are making the logger compatible with Backstage's LoggerService and winston's Logger so that Roadie can be used with newer and older versions of Backstage. + ## 1.2.0 ### Minor Changes diff --git a/plugins/backend/backstage-aws-backend/package.json b/plugins/backend/backstage-aws-backend/package.json index e95ef5a05..b5be41652 100644 --- a/plugins/backend/backstage-aws-backend/package.json +++ b/plugins/backend/backstage-aws-backend/package.json @@ -1,6 +1,6 @@ { "name": "@roadiehq/backstage-plugin-aws-backend", - "version": "1.2.0", + "version": "1.3.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -38,6 +38,7 @@ }, "dependencies": { "@backstage/backend-common": "^0.25.0", + "@backstage/backend-plugin-api": "^1.0.1", "@backstage/catalog-client": "^1.8.0", "@backstage/config": "^1.3.0", "@types/express": "^4.17.6", diff --git a/plugins/backend/backstage-aws-backend/src/service/router.ts b/plugins/backend/backstage-aws-backend/src/service/router.ts index 166d3e418..c4be24871 100644 --- a/plugins/backend/backstage-aws-backend/src/service/router.ts +++ b/plugins/backend/backstage-aws-backend/src/service/router.ts @@ -19,12 +19,13 @@ import { Config } from '@backstage/config'; import express, { Request } from 'express'; import Router from 'express-promise-router'; import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { CloudControl } from '@aws-sdk/client-cloudcontrol'; import { fromTemporaryCredentials } from '@aws-sdk/credential-providers'; import { Account } from '../types'; export interface RouterOptions { - logger: Logger; + logger: Logger | LoggerService; config: Config; } diff --git a/plugins/backend/backstage-aws-backend/src/service/standaloneServer.ts b/plugins/backend/backstage-aws-backend/src/service/standaloneServer.ts index 93dba7cef..30082d292 100644 --- a/plugins/backend/backstage-aws-backend/src/service/standaloneServer.ts +++ b/plugins/backend/backstage-aws-backend/src/service/standaloneServer.ts @@ -20,12 +20,13 @@ import { } from '@backstage/backend-common'; import { Server } from 'http'; import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { createRouter } from './router'; export interface ServerOptions { port: number; enableCors: boolean; - logger: Logger; + logger: Logger | LoggerService; } export async function startStandaloneServer( diff --git a/plugins/backend/backstage-plugin-argo-cd-backend/CHANGELOG.md b/plugins/backend/backstage-plugin-argo-cd-backend/CHANGELOG.md index 4bd4701f3..ea9770557 100644 --- a/plugins/backend/backstage-plugin-argo-cd-backend/CHANGELOG.md +++ b/plugins/backend/backstage-plugin-argo-cd-backend/CHANGELOG.md @@ -1,5 +1,11 @@ # @roadiehq/backstage-plugin-argo-cd-backend +## 3.3.0 + +### Minor Changes + +- 8915f83: We are making the logger compatible with Backstage's LoggerService and winston's Logger so that Roadie can be used with newer and older versions of Backstage. + ## 3.2.3 ### Patch Changes diff --git a/plugins/backend/backstage-plugin-argo-cd-backend/package.json b/plugins/backend/backstage-plugin-argo-cd-backend/package.json index 3a72e861c..7dd692032 100644 --- a/plugins/backend/backstage-plugin-argo-cd-backend/package.json +++ b/plugins/backend/backstage-plugin-argo-cd-backend/package.json @@ -1,6 +1,6 @@ { "name": "@roadiehq/backstage-plugin-argo-cd-backend", - "version": "3.2.3", + "version": "3.3.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/plugins/backend/backstage-plugin-argo-cd-backend/src/service/argocd.service.ts b/plugins/backend/backstage-plugin-argo-cd-backend/src/service/argocd.service.ts index 9d5bc7942..a708fb6ea 100644 --- a/plugins/backend/backstage-plugin-argo-cd-backend/src/service/argocd.service.ts +++ b/plugins/backend/backstage-plugin-argo-cd-backend/src/service/argocd.service.ts @@ -1,6 +1,7 @@ import { Config } from '@backstage/config'; import fetch from 'cross-fetch'; import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { timer } from './timer.services'; import { @@ -45,7 +46,7 @@ export class ArgoService implements ArgoServiceApi { private readonly username: string, private readonly password: string, private readonly config: Config, - private readonly logger: Logger, + private readonly logger: Logger | LoggerService, ) { this.instanceConfigs = this.config .getConfigArray('argocd.appLocatorMethods') diff --git a/plugins/backend/backstage-plugin-argo-cd-backend/src/service/argocd.test.ts b/plugins/backend/backstage-plugin-argo-cd-backend/src/service/argocd.test.ts index 5a89e57c4..7228835cd 100644 --- a/plugins/backend/backstage-plugin-argo-cd-backend/src/service/argocd.test.ts +++ b/plugins/backend/backstage-plugin-argo-cd-backend/src/service/argocd.test.ts @@ -7,7 +7,7 @@ import { } from './argocdTestResponses'; import fetchMock from 'jest-fetch-mock'; import { timer } from './timer.services'; -import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { ResourceItem, UpdateArgoProjectAndAppProps } from './types'; import { mocked } from 'jest-mock'; @@ -18,7 +18,7 @@ jest.mock('./timer.services', () => ({ const loggerMock = { error: jest.fn(), info: jest.fn(), -} as unknown as Logger; +} as unknown as LoggerService; const getConfig = (options: { token?: string; diff --git a/plugins/backend/backstage-plugin-argo-cd-backend/src/service/router.ts b/plugins/backend/backstage-plugin-argo-cd-backend/src/service/router.ts index 797d867a6..e546a4c7f 100644 --- a/plugins/backend/backstage-plugin-argo-cd-backend/src/service/router.ts +++ b/plugins/backend/backstage-plugin-argo-cd-backend/src/service/router.ts @@ -3,11 +3,12 @@ import { Config } from '@backstage/config'; import express from 'express'; import Router from 'express-promise-router'; import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { ArgoService } from './argocd.service'; import { getArgoConfigByInstanceName } from '../utils/getArgoConfig'; export interface RouterOptions { - logger: Logger; + logger: Logger | LoggerService; config: Config; } export type Response = { diff --git a/plugins/backend/backstage-plugin-argo-cd-backend/src/service/standaloneServer.ts b/plugins/backend/backstage-plugin-argo-cd-backend/src/service/standaloneServer.ts index 1005cbc50..f4b0d9c1a 100644 --- a/plugins/backend/backstage-plugin-argo-cd-backend/src/service/standaloneServer.ts +++ b/plugins/backend/backstage-plugin-argo-cd-backend/src/service/standaloneServer.ts @@ -4,12 +4,13 @@ import { } from '@backstage/backend-common'; import { Server } from 'http'; import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { createRouter } from './router'; export interface ServerOptions { port: number; enableCors: boolean; - logger: Logger; + logger: Logger | LoggerService; } export async function startStandaloneServer( diff --git a/plugins/backend/backstage-plugin-argo-cd-backend/src/service/types.ts b/plugins/backend/backstage-plugin-argo-cd-backend/src/service/types.ts index b1542d749..7df1835b4 100644 --- a/plugins/backend/backstage-plugin-argo-cd-backend/src/service/types.ts +++ b/plugins/backend/backstage-plugin-argo-cd-backend/src/service/types.ts @@ -1,5 +1,6 @@ import { Config } from '@backstage/config'; import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; export type getRevisionDataResp = { author: string; @@ -61,7 +62,7 @@ export interface CreateArgoResourcesProps { sourceRepo: string; sourcePath: string; labelValue: string; - logger: Logger; + logger: Logger | LoggerService; } export interface UpdateArgoProjectAndAppProps { diff --git a/plugins/backend/backstage-plugin-aws-auth/CHANGELOG.md b/plugins/backend/backstage-plugin-aws-auth/CHANGELOG.md index f3c7000b3..7495a968a 100644 --- a/plugins/backend/backstage-plugin-aws-auth/CHANGELOG.md +++ b/plugins/backend/backstage-plugin-aws-auth/CHANGELOG.md @@ -1,5 +1,11 @@ # @roadiehq/backstage-plugin-aws-auth +## 0.5.0 + +### Minor Changes + +- 8915f83: We are making the logger compatible with Backstage's LoggerService and winston's Logger so that Roadie can be used with newer and older versions of Backstage. + ## 0.4.26 ### Patch Changes diff --git a/plugins/backend/backstage-plugin-aws-auth/package.json b/plugins/backend/backstage-plugin-aws-auth/package.json index bcf6cf341..cdff5b857 100644 --- a/plugins/backend/backstage-plugin-aws-auth/package.json +++ b/plugins/backend/backstage-plugin-aws-auth/package.json @@ -1,6 +1,6 @@ { "name": "@roadiehq/backstage-plugin-aws-auth", - "version": "0.4.26", + "version": "0.5.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -39,6 +39,7 @@ }, "dependencies": { "@backstage/backend-common": "^0.25.0", + "@backstage/backend-plugin-api": "^1.0.1", "@types/express": "^4.17.11", "aws-sdk": "^2.902.0", "cors": "^2.8.5", diff --git a/plugins/backend/backstage-plugin-aws-auth/src/service/aws-api.ts b/plugins/backend/backstage-plugin-aws-auth/src/service/aws-api.ts index 664f750c9..f1141e88c 100644 --- a/plugins/backend/backstage-plugin-aws-auth/src/service/aws-api.ts +++ b/plugins/backend/backstage-plugin-aws-auth/src/service/aws-api.ts @@ -16,6 +16,7 @@ import express from 'express'; import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { generateTemporaryCredentials } from './generateTemporaryCredentials'; export type LambdaData = { @@ -35,7 +36,7 @@ export function getAwsApiGenerateTempCredentialsForwarder({ }: { AWS_ACCESS_KEY_ID?: string; AWS_ACCESS_KEY_SECRET?: string; - logger: Logger; + logger: Logger | LoggerService; }) { return async function forwardRequest( _: express.Request, diff --git a/plugins/backend/backstage-plugin-aws-auth/src/service/router.ts b/plugins/backend/backstage-plugin-aws-auth/src/service/router.ts index d69bc73ae..a944e15a2 100644 --- a/plugins/backend/backstage-plugin-aws-auth/src/service/router.ts +++ b/plugins/backend/backstage-plugin-aws-auth/src/service/router.ts @@ -15,11 +15,14 @@ */ import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import Router from 'express-promise-router'; import express from 'express'; import { getAwsApiGenerateTempCredentialsForwarder } from './aws-api'; -export async function createRouter(logger: Logger): Promise { +export async function createRouter( + logger: Logger | LoggerService, +): Promise { const router = Router(); router.use(express.json()); diff --git a/plugins/backend/backstage-plugin-aws-auth/src/service/standaloneApplication.ts b/plugins/backend/backstage-plugin-aws-auth/src/service/standaloneApplication.ts index 173e0b6fb..6a716b232 100644 --- a/plugins/backend/backstage-plugin-aws-auth/src/service/standaloneApplication.ts +++ b/plugins/backend/backstage-plugin-aws-auth/src/service/standaloneApplication.ts @@ -23,10 +23,11 @@ import cors from 'cors'; import express from 'express'; import helmet from 'helmet'; import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { createRouter } from './router'; export async function createStandaloneApplication( - logger: Logger, + logger: Logger | LoggerService, ): Promise { const app = express(); diff --git a/plugins/backend/backstage-plugin-aws-auth/src/service/standaloneServer.ts b/plugins/backend/backstage-plugin-aws-auth/src/service/standaloneServer.ts index 3019657a8..6b29966ca 100644 --- a/plugins/backend/backstage-plugin-aws-auth/src/service/standaloneServer.ts +++ b/plugins/backend/backstage-plugin-aws-auth/src/service/standaloneServer.ts @@ -15,10 +15,11 @@ */ import { Server } from 'http'; import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { createStandaloneApplication } from './standaloneApplication'; export async function startStandaloneServer( - parentLogger: Logger, + parentLogger: Logger | LoggerService, ): Promise { const logger = parentLogger.child({ service: 'scaffolder-backend' }); logger.debug('Creating application...'); diff --git a/plugins/backend/catalog-backend-module-aws/CHANGELOG.md b/plugins/backend/catalog-backend-module-aws/CHANGELOG.md index b4b8621da..beddd2ec4 100644 --- a/plugins/backend/catalog-backend-module-aws/CHANGELOG.md +++ b/plugins/backend/catalog-backend-module-aws/CHANGELOG.md @@ -1,5 +1,11 @@ # @backstage/plugin-catalog-backend-module-aws +## 5.3.0 + +### Minor Changes + +- 8915f83: We are making the logger compatible with Backstage's LoggerService and winston's Logger so that Roadie can be used with newer and older versions of Backstage. + ## 5.2.0 ### Minor Changes diff --git a/plugins/backend/catalog-backend-module-aws/package.json b/plugins/backend/catalog-backend-module-aws/package.json index f889d2add..2c2f12887 100644 --- a/plugins/backend/catalog-backend-module-aws/package.json +++ b/plugins/backend/catalog-backend-module-aws/package.json @@ -1,7 +1,7 @@ { "name": "@roadiehq/catalog-backend-module-aws", "description": "A set of Backstage catalog providers for AWS", - "version": "5.2.0", + "version": "5.3.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -54,6 +54,7 @@ "@aws-sdk/lib-dynamodb": "^3.696.0", "@backstage/integration-aws-node": "^0.1.13", "@backstage/backend-common": "^0.25.0", + "@backstage/backend-plugin-api": "^1.0.1", "@backstage/catalog-client": "^1.8.0", "@backstage/plugin-kubernetes-common": "^0.9.0", "@backstage/catalog-model": "^1.7.1", diff --git a/plugins/backend/catalog-backend-module-aws/src/processors/AWSCatalogProcessor.ts b/plugins/backend/catalog-backend-module-aws/src/processors/AWSCatalogProcessor.ts index b96985d7a..57c2ff5e3 100644 --- a/plugins/backend/catalog-backend-module-aws/src/processors/AWSCatalogProcessor.ts +++ b/plugins/backend/catalog-backend-module-aws/src/processors/AWSCatalogProcessor.ts @@ -17,17 +17,18 @@ import { CatalogProcessor } from '@backstage/plugin-catalog-backend'; import { CatalogApi } from '@backstage/catalog-client'; import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; export abstract class AWSCatalogProcessor implements CatalogProcessor { protected readonly catalogApi: CatalogApi; - protected readonly logger: Logger; + protected readonly logger: Logger | LoggerService; public abstract getProcessorName(): string; constructor({ catalogApi, logger, }: { catalogApi: CatalogApi; - logger: Logger; + logger: Logger | LoggerService; }) { this.catalogApi = catalogApi; this.logger = logger; diff --git a/plugins/backend/catalog-backend-module-aws/src/processors/AWSIAMRoleProcessor.ts b/plugins/backend/catalog-backend-module-aws/src/processors/AWSIAMRoleProcessor.ts index 79bec58f0..7fa01dcc4 100644 --- a/plugins/backend/catalog-backend-module-aws/src/processors/AWSIAMRoleProcessor.ts +++ b/plugins/backend/catalog-backend-module-aws/src/processors/AWSIAMRoleProcessor.ts @@ -30,6 +30,7 @@ import { import { ANNOTATION_AWS_IAM_ROLE_ARN } from '../annotations'; import { Config } from '@backstage/config'; import * as winston from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { PluginEndpointDiscovery } from '@backstage/backend-common'; import { CatalogClient, CatalogApi } from '@backstage/catalog-client'; import { arnToName } from '../utils/arnToName'; @@ -37,7 +38,10 @@ import { arnToName } from '../utils/arnToName'; export class AWSIAMRoleProcessor extends AWSCatalogProcessor { static fromConfig( _config: Config, - options: { logger: winston.Logger; discovery: PluginEndpointDiscovery }, + options: { + logger: winston.Logger | LoggerService; + discovery: PluginEndpointDiscovery; + }, ) { const catalogApi: CatalogApi = new CatalogClient({ discoveryApi: options.discovery, diff --git a/plugins/backend/catalog-backend-module-aws/src/providers/AWSDynamoDbTableDataProvider.ts b/plugins/backend/catalog-backend-module-aws/src/providers/AWSDynamoDbTableDataProvider.ts index 4e423400e..09eb45ff2 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSDynamoDbTableDataProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSDynamoDbTableDataProvider.ts @@ -31,6 +31,7 @@ import { DynamoDBDocument } from '@aws-sdk/lib-dynamodb'; import { merge } from 'lodash'; import { mapColumnsToEntityValues } from '../utils/columnMapper'; import * as winston from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { ANNOTATION_ACCOUNT_ID, ANNOTATION_AWS_DDB_TABLE_ARN, @@ -51,11 +52,14 @@ export class AWSDynamoDbTableDataProvider implements EntityProvider { private readonly accountId: string; private readonly roleArn: string; private readonly tableDataConfig: DdbTableDataConfigOptions; - private readonly logger: winston.Logger; + private readonly logger: winston.Logger | LoggerService; private connection?: EntityProviderConnection; - static fromConfig(config: Config, options: { logger: winston.Logger }) { + static fromConfig( + config: Config, + options: { logger: winston.Logger | LoggerService }, + ) { return new AWSDynamoDbTableDataProvider( config.getString('accountId'), config.getString('roleName'), @@ -68,7 +72,7 @@ export class AWSDynamoDbTableDataProvider implements EntityProvider { accountId: string, roleArn: string, options: DdbTableDataConfigOptions, - logger: winston.Logger, + logger: winston.Logger | LoggerService, ) { this.accountId = accountId; this.roleArn = roleArn; @@ -168,7 +172,7 @@ export class AWSDynamoDbTableDataProvider implements EntityProvider { })), }); } catch (e) { - this.logger.error(e); + this.logger.error((e as Error).message, e as Error); } } } diff --git a/plugins/backend/catalog-backend-module-aws/src/providers/AWSDynamoDbTableProvider.ts b/plugins/backend/catalog-backend-module-aws/src/providers/AWSDynamoDbTableProvider.ts index 20e7f1d94..64a755dd5 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSDynamoDbTableProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSDynamoDbTableProvider.ts @@ -17,6 +17,7 @@ import { DynamoDB, paginateListTables } from '@aws-sdk/client-dynamodb'; import { Config } from '@backstage/config'; import * as winston from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { AWSEntityProvider } from './AWSEntityProvider'; import { ResourceEntity } from '@backstage/catalog-model'; import { ANNOTATION_AWS_DDB_TABLE_ARN } from '../annotations'; @@ -37,7 +38,7 @@ export class AWSDynamoDbTableProvider extends AWSEntityProvider { static fromConfig( config: Config, options: { - logger: winston.Logger; + logger: winston.Logger | LoggerService; catalogApi?: CatalogApi; providerId?: string; ownerTag?: string; diff --git a/plugins/backend/catalog-backend-module-aws/src/providers/AWSEC2Provider.ts b/plugins/backend/catalog-backend-module-aws/src/providers/AWSEC2Provider.ts index a2fd4617b..27cd4c863 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSEC2Provider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSEC2Provider.ts @@ -17,6 +17,7 @@ import { ANNOTATION_VIEW_URL, ResourceEntity } from '@backstage/catalog-model'; import { EC2 } from '@aws-sdk/client-ec2'; import * as winston from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { AWSEntityProvider } from './AWSEntityProvider'; import { ANNOTATION_AWS_EC2_INSTANCE_ID } from '../annotations'; @@ -37,7 +38,7 @@ export class AWSEC2Provider extends AWSEntityProvider { static fromConfig( config: Config, options: { - logger: winston.Logger; + logger: winston.Logger | LoggerService; catalogApi?: CatalogApi; providerId?: string; ownerTag?: string; diff --git a/plugins/backend/catalog-backend-module-aws/src/providers/AWSEKSClusterProvider.ts b/plugins/backend/catalog-backend-module-aws/src/providers/AWSEKSClusterProvider.ts index 8f97342ee..f58a01de7 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSEKSClusterProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSEKSClusterProvider.ts @@ -17,6 +17,7 @@ import { ResourceEntity } from '@backstage/catalog-model'; import { EKS, paginateListClusters } from '@aws-sdk/client-eks'; import * as winston from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { AWSEntityProvider } from './AWSEntityProvider'; import { @@ -49,7 +50,7 @@ export class AWSEKSClusterProvider extends AWSEntityProvider { static fromConfig( config: Config, options: { - logger: winston.Logger; + logger: winston.Logger | LoggerService; catalogApi?: CatalogApi; providerId?: string; ownerTag?: string; @@ -73,7 +74,7 @@ export class AWSEKSClusterProvider extends AWSEntityProvider { constructor( account: AccountConfig, options: { - logger: winston.Logger; + logger: winston.Logger | LoggerService; catalogApi?: CatalogApi; providerId?: string; ownerTag?: string; diff --git a/plugins/backend/catalog-backend-module-aws/src/providers/AWSEntityProvider.ts b/plugins/backend/catalog-backend-module-aws/src/providers/AWSEntityProvider.ts index 19f23e797..6ea650b62 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSEntityProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSEntityProvider.ts @@ -19,6 +19,7 @@ import { EntityProviderConnection, } from '@backstage/plugin-catalog-node'; import * as winston from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { AccountConfig, DynamicAccountConfig } from '../types'; import { STS } from '@aws-sdk/client-sts'; import { @@ -36,7 +37,7 @@ import { LabelValueMapper, labelsFromTags, Tag } from '../utils/tags'; export abstract class AWSEntityProvider implements EntityProvider { protected readonly useTemporaryCredentials: boolean; protected readonly providerId?: string; - protected readonly logger: winston.Logger; + protected readonly logger: winston.Logger | LoggerService; protected connection?: EntityProviderConnection; private readonly ownerTag: string | undefined; protected readonly catalogApi?: CatalogApi; @@ -52,7 +53,7 @@ export abstract class AWSEntityProvider implements EntityProvider { protected constructor( account: AccountConfig, options: { - logger: winston.Logger; + logger: winston.Logger | LoggerService; catalogApi?: CatalogApi; providerId?: string; ownerTag?: string; diff --git a/plugins/backend/catalog-backend-module-aws/src/providers/AWSIAMRoleProvider.ts b/plugins/backend/catalog-backend-module-aws/src/providers/AWSIAMRoleProvider.ts index 79a4b11d8..7d0b6e806 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSIAMRoleProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSIAMRoleProvider.ts @@ -17,6 +17,7 @@ import { ANNOTATION_VIEW_URL, ResourceEntity } from '@backstage/catalog-model'; import { IAM, paginateListRoles } from '@aws-sdk/client-iam'; import * as winston from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { AWSEntityProvider } from './AWSEntityProvider'; import { ANNOTATION_AWS_IAM_ROLE_ARN } from '../annotations'; @@ -38,7 +39,7 @@ export class AWSIAMRoleProvider extends AWSEntityProvider { static fromConfig( config: Config, options: { - logger: winston.Logger; + logger: winston.Logger | LoggerService; catalogApi?: CatalogApi; providerId?: string; ownerTag?: string; diff --git a/plugins/backend/catalog-backend-module-aws/src/providers/AWSIAMUserProvider.ts b/plugins/backend/catalog-backend-module-aws/src/providers/AWSIAMUserProvider.ts index 93e9e506c..ca0f2f4f0 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSIAMUserProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSIAMUserProvider.ts @@ -17,6 +17,7 @@ import { ANNOTATION_VIEW_URL, UserEntity } from '@backstage/catalog-model'; import { IAM, paginateListUsers } from '@aws-sdk/client-iam'; import * as winston from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { AWSEntityProvider } from './AWSEntityProvider'; import { ANNOTATION_AWS_IAM_USER_ARN } from '../annotations'; @@ -34,7 +35,7 @@ export class AWSIAMUserProvider extends AWSEntityProvider { static fromConfig( config: Config, options: { - logger: winston.Logger; + logger: winston.Logger | LoggerService; catalogApi?: CatalogApi; providerId?: string; ownerTag?: string; diff --git a/plugins/backend/catalog-backend-module-aws/src/providers/AWSLambdaFunctionProvider.ts b/plugins/backend/catalog-backend-module-aws/src/providers/AWSLambdaFunctionProvider.ts index 1d3055c41..74594bda3 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSLambdaFunctionProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSLambdaFunctionProvider.ts @@ -17,6 +17,7 @@ import { ANNOTATION_VIEW_URL, ResourceEntity } from '@backstage/catalog-model'; import { Lambda, paginateListFunctions } from '@aws-sdk/client-lambda'; import * as winston from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { AWSEntityProvider } from './AWSEntityProvider'; import { @@ -41,7 +42,7 @@ export class AWSLambdaFunctionProvider extends AWSEntityProvider { static fromConfig( config: Config, options: { - logger: winston.Logger; + logger: winston.Logger | LoggerService; catalogApi?: CatalogApi; providerId?: string; ownerTag?: string; @@ -113,7 +114,10 @@ export class AWSLambdaFunctionProvider extends AWSEntityProvider { }); tags = tagsResponse?.Tags ?? {}; } catch (e) { - this.logger.warn('Unable to get tags for Lambda functions', e); + this.logger.warn( + 'Unable to get tags for Lambda functions', + e as Error, + ); } const annotations: { [name: string]: string } = { diff --git a/plugins/backend/catalog-backend-module-aws/src/providers/AWSOrganizationAccountsProvider.ts b/plugins/backend/catalog-backend-module-aws/src/providers/AWSOrganizationAccountsProvider.ts index 0a38aef4b..4107f81e8 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSOrganizationAccountsProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSOrganizationAccountsProvider.ts @@ -22,6 +22,7 @@ import { paginateListTagsForResource, } from '@aws-sdk/client-organizations'; import * as winston from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { AWSEntityProvider } from './AWSEntityProvider'; import { @@ -46,7 +47,7 @@ export class AWSOrganizationAccountsProvider extends AWSEntityProvider { static fromConfig( config: Config, options: { - logger: winston.Logger; + logger: winston.Logger | LoggerService; catalogApi?: CatalogApi; providerId?: string; ownerTag?: string; diff --git a/plugins/backend/catalog-backend-module-aws/src/providers/AWSRDSProvider.ts b/plugins/backend/catalog-backend-module-aws/src/providers/AWSRDSProvider.ts index f013ab00e..34c19d0ca 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSRDSProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSRDSProvider.ts @@ -29,6 +29,7 @@ import { import { CatalogApi } from '@backstage/catalog-client'; import { DynamicAccountConfig } from '../types'; import { duration } from '../utils/timer'; +import { LoggerService } from '@backstage/backend-plugin-api'; /** * Provides entities from AWS Relational Database Service. @@ -37,7 +38,7 @@ export class AWSRDSProvider extends AWSEntityProvider { static fromConfig( config: Config, options: { - logger: winston.Logger; + logger: winston.Logger | LoggerService; catalogApi?: CatalogApi; providerId?: string; useTemporaryCredentials?: boolean; diff --git a/plugins/backend/catalog-backend-module-aws/src/providers/AWSS3BucketProvider.ts b/plugins/backend/catalog-backend-module-aws/src/providers/AWSS3BucketProvider.ts index 14439a3c7..30bcd5881 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSS3BucketProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSS3BucketProvider.ts @@ -17,6 +17,7 @@ import { ANNOTATION_VIEW_URL, ResourceEntity } from '@backstage/catalog-model'; import { S3, Tag } from '@aws-sdk/client-s3'; import * as winston from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { AWSEntityProvider } from './AWSEntityProvider'; import { ANNOTATION_AWS_S3_BUCKET_ARN } from '../annotations'; @@ -38,7 +39,7 @@ export class AWSS3BucketProvider extends AWSEntityProvider { static fromConfig( config: Config, options: { - logger: winston.Logger; + logger: winston.Logger | LoggerService; catalogApi?: CatalogApi; providerId?: string; ownerTag?: string; diff --git a/plugins/backend/catalog-backend-module-aws/src/providers/AWSSNSTopicProvider.ts b/plugins/backend/catalog-backend-module-aws/src/providers/AWSSNSTopicProvider.ts index 2b3f6ea7b..bc73c41a5 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSSNSTopicProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSSNSTopicProvider.ts @@ -17,6 +17,7 @@ import { ANNOTATION_VIEW_URL, ResourceEntity } from '@backstage/catalog-model'; import { SNS, paginateListTopics } from '@aws-sdk/client-sns'; import * as winston from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { AWSEntityProvider } from './AWSEntityProvider'; import { ANNOTATION_AWS_SNS_TOPIC_ARN } from '../annotations'; @@ -37,7 +38,7 @@ export class AWSSNSTopicProvider extends AWSEntityProvider { static fromConfig( config: Config, options: { - logger: winston.Logger; + logger: winston.Logger | LoggerService; catalogApi?: CatalogApi; providerId?: string; ownerTag?: string; diff --git a/plugins/backend/rag-ai-backend-embeddings-openai/CHANGELOG.md b/plugins/backend/rag-ai-backend-embeddings-openai/CHANGELOG.md index 4fd8c4444..e6fc26258 100644 --- a/plugins/backend/rag-ai-backend-embeddings-openai/CHANGELOG.md +++ b/plugins/backend/rag-ai-backend-embeddings-openai/CHANGELOG.md @@ -1,5 +1,11 @@ # @roadiehq/rag-ai-backend-embeddings-openai +## 0.4.0 + +### Minor Changes + +- 8915f83: We are making the logger compatible with Backstage's LoggerService and winston's Logger so that Roadie can be used with newer and older versions of Backstage. + ## 0.3.0 ### Minor Changes diff --git a/plugins/backend/rag-ai-backend-embeddings-openai/package.json b/plugins/backend/rag-ai-backend-embeddings-openai/package.json index b207004e3..30eedd754 100644 --- a/plugins/backend/rag-ai-backend-embeddings-openai/package.json +++ b/plugins/backend/rag-ai-backend-embeddings-openai/package.json @@ -1,7 +1,7 @@ { "name": "@roadiehq/rag-ai-backend-embeddings-openai", "description": "The OpenAI backend module for the @roadiehq/rag-ai plugin.", - "version": "0.3.0", + "version": "0.4.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -42,6 +42,7 @@ }, "dependencies": { "@backstage/backend-common": "^0.25.0", + "@backstage/backend-plugin-api": "^1.0.1", "@backstage/catalog-client": "^1.8.0", "@backstage/config": "^1.3.0", "@langchain/core": "^0.2.27", diff --git a/plugins/backend/rag-ai-backend-embeddings-openai/src/index.ts b/plugins/backend/rag-ai-backend-embeddings-openai/src/index.ts index 95a1ffe93..9435eb8d9 100644 --- a/plugins/backend/rag-ai-backend-embeddings-openai/src/index.ts +++ b/plugins/backend/rag-ai-backend-embeddings-openai/src/index.ts @@ -15,6 +15,7 @@ */ import { TokenManager } from '@backstage/backend-common'; import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { AugmentationIndexer, RoadieVectorStore } from '@roadiehq/rag-ai-node'; import { OpenAiConfig, RoadieOpenAiAugmenter } from './RoadieOpenAiAugmenter'; import { CatalogApi } from '@backstage/catalog-client'; @@ -23,7 +24,7 @@ import { Config } from '@backstage/config'; import { AugmentationOptions } from '@roadiehq/rag-ai-backend-retrieval-augmenter'; export interface RoadieBedrockEmbeddingsConfig { - logger: Logger; + logger: Logger | LoggerService; tokenManager: TokenManager; vectorStore: RoadieVectorStore; catalogApi: CatalogApi; diff --git a/plugins/backend/rag-ai-backend/CHANGELOG.md b/plugins/backend/rag-ai-backend/CHANGELOG.md index 779fabf5a..85ea7a153 100644 --- a/plugins/backend/rag-ai-backend/CHANGELOG.md +++ b/plugins/backend/rag-ai-backend/CHANGELOG.md @@ -1,5 +1,11 @@ # @roadiehq/rag-ai-backend +## 1.3.0 + +### Minor Changes + +- 8915f83: We are making the logger compatible with Backstage's LoggerService and winston's Logger so that Roadie can be used with newer and older versions of Backstage. + ## 1.2.0 ### Minor Changes diff --git a/plugins/backend/rag-ai-backend/package.json b/plugins/backend/rag-ai-backend/package.json index 8bf3d3727..f67f84dd1 100644 --- a/plugins/backend/rag-ai-backend/package.json +++ b/plugins/backend/rag-ai-backend/package.json @@ -1,6 +1,6 @@ { "name": "@roadiehq/rag-ai-backend", - "version": "1.2.0", + "version": "1.3.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/plugins/backend/rag-ai-backend/src/service/LlmService.ts b/plugins/backend/rag-ai-backend/src/service/LlmService.ts index 4acb4e3fd..78df86b13 100644 --- a/plugins/backend/rag-ai-backend/src/service/LlmService.ts +++ b/plugins/backend/rag-ai-backend/src/service/LlmService.ts @@ -17,10 +17,11 @@ import { BaseLLM } from '@langchain/core/language_models/llms'; import { BaseChatModel } from '@langchain/core/language_models/chat_models'; import { EmbeddingDoc } from '@roadiehq/rag-ai-node'; import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { createPromptTemplates } from './prompts'; export class LlmService { - private readonly logger: Logger; + private readonly logger: Logger | LoggerService; private readonly model: BaseLLM | BaseChatModel; private readonly prompts: { prefixPrompt: (embedding: string) => string; @@ -32,7 +33,7 @@ export class LlmService { model, configuredPrompts, }: { - logger: Logger; + logger: Logger | LoggerService; model: BaseLLM | BaseChatModel; configuredPrompts?: { prefix?: string; diff --git a/plugins/backend/rag-ai-backend/src/service/RagAiController.ts b/plugins/backend/rag-ai-backend/src/service/RagAiController.ts index 456e26f35..7ba7a64f2 100644 --- a/plugins/backend/rag-ai-backend/src/service/RagAiController.ts +++ b/plugins/backend/rag-ai-backend/src/service/RagAiController.ts @@ -15,6 +15,8 @@ */ import { Request, Response } from 'express'; import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; + import { LlmService } from './LlmService'; import { AugmentationIndexer, @@ -35,10 +37,10 @@ export class RagAiController { private readonly llmService: LlmService; private readonly augmentationIndexer: AugmentationIndexer; private readonly retrievalPipeline?: RetrievalPipeline; - private logger: Logger; + private logger: Logger | LoggerService; constructor( - logger: Logger, + logger: Logger | LoggerService, llmService: LlmService, augmentationIndexer: AugmentationIndexer, retrievalPipeline?: RetrievalPipeline, @@ -55,7 +57,7 @@ export class RagAiController { augmentationIndexer, retrievalPipeline, }: { - logger: Logger; + logger: Logger | LoggerService; llmService: LlmService; augmentationIndexer: AugmentationIndexer; retrievalPipeline?: RetrievalPipeline; diff --git a/plugins/backend/rag-ai-backend/src/service/router.ts b/plugins/backend/rag-ai-backend/src/service/router.ts index 0423a1219..f269728ce 100644 --- a/plugins/backend/rag-ai-backend/src/service/router.ts +++ b/plugins/backend/rag-ai-backend/src/service/router.ts @@ -17,6 +17,7 @@ import { errorHandler } from '@backstage/backend-common'; import express, { NextFunction, Request, Response } from 'express'; import Router from 'express-promise-router'; import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { AugmentationIndexer, RetrievalPipeline } from '@roadiehq/rag-ai-node'; import { BaseLLM } from '@langchain/core/language_models/llms'; import { BaseChatModel } from '@langchain/core/language_models/chat_models'; @@ -34,7 +35,7 @@ type AiBackendConfig = { }; export interface RouterOptions { - logger: Logger; + logger: Logger | LoggerService; augmentationIndexer: AugmentationIndexer; retrievalPipeline: RetrievalPipeline; model: BaseLLM | BaseChatModel; diff --git a/plugins/backend/rag-ai-backend/src/service/types.ts b/plugins/backend/rag-ai-backend/src/service/types.ts index eea64b9f2..368cc64e3 100644 --- a/plugins/backend/rag-ai-backend/src/service/types.ts +++ b/plugins/backend/rag-ai-backend/src/service/types.ts @@ -16,12 +16,13 @@ import { TokenManager } from '@backstage/backend-common'; import { AugmentationIndexer, RetrievalPipeline } from '@roadiehq/rag-ai-node'; import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { BaseLLM } from '@langchain/core/language_models/llms'; import { BaseChatModel } from '@langchain/core/language_models/chat_models'; import { Config } from '@backstage/config'; export interface RagAiConfig { - logger: Logger; + logger: Logger | LoggerService; tokenManager: TokenManager; augmentationIndexer: AugmentationIndexer; retrievalPipeline: RetrievalPipeline; diff --git a/plugins/scaffolder-actions/scaffolder-backend-argocd/CHANGELOG.md b/plugins/scaffolder-actions/scaffolder-backend-argocd/CHANGELOG.md index 6fcc8b11c..b6e600267 100644 --- a/plugins/scaffolder-actions/scaffolder-backend-argocd/CHANGELOG.md +++ b/plugins/scaffolder-actions/scaffolder-backend-argocd/CHANGELOG.md @@ -1,5 +1,16 @@ # @roadiehq/scaffolder-backend-argocd +## 1.4.0 + +### Minor Changes + +- 8915f83: We are making the logger compatible with Backstage's LoggerService and winston's Logger so that Roadie can be used with newer and older versions of Backstage. + +### Patch Changes + +- Updated dependencies [8915f83] + - @roadiehq/backstage-plugin-argo-cd-backend@3.3.0 + ## 1.3.0 ### Minor Changes diff --git a/plugins/scaffolder-actions/scaffolder-backend-argocd/package.json b/plugins/scaffolder-actions/scaffolder-backend-argocd/package.json index c41673c8d..a4c90d00e 100644 --- a/plugins/scaffolder-actions/scaffolder-backend-argocd/package.json +++ b/plugins/scaffolder-actions/scaffolder-backend-argocd/package.json @@ -1,6 +1,6 @@ { "name": "@roadiehq/scaffolder-backend-argocd", - "version": "1.3.0", + "version": "1.4.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -48,7 +48,7 @@ "@backstage/backend-plugin-api": "^1.0.2", "@backstage/config": "^1.3.0", "@backstage/plugin-scaffolder-node": "^0.6.0", - "@roadiehq/backstage-plugin-argo-cd-backend": "^3.2.2", + "@roadiehq/backstage-plugin-argo-cd-backend": "^3.3.0", "@backstage/backend-test-utils": "^1.1.0", "winston": "^3.2.1" }, diff --git a/plugins/scaffolder-actions/scaffolder-backend-argocd/src/actions/run/argocd.ts b/plugins/scaffolder-actions/scaffolder-backend-argocd/src/actions/run/argocd.ts index bf6ed7de8..a0c02f8fc 100644 --- a/plugins/scaffolder-actions/scaffolder-backend-argocd/src/actions/run/argocd.ts +++ b/plugins/scaffolder-actions/scaffolder-backend-argocd/src/actions/run/argocd.ts @@ -17,8 +17,12 @@ import { Config } from '@backstage/config'; import { createTemplateAction } from '@backstage/plugin-scaffolder-node'; import { ArgoService } from '@roadiehq/backstage-plugin-argo-cd-backend'; import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; -export const createArgoCdResources = (config: Config, logger: Logger) => { +export const createArgoCdResources = ( + config: Config, + logger: Logger | LoggerService, +) => { return createTemplateAction<{ argoInstance: string; namespace: string; diff --git a/plugins/scaffolder-actions/scaffolder-backend-module-http-request/CHANGELOG.md b/plugins/scaffolder-actions/scaffolder-backend-module-http-request/CHANGELOG.md index 923491a9a..31adea4d8 100644 --- a/plugins/scaffolder-actions/scaffolder-backend-module-http-request/CHANGELOG.md +++ b/plugins/scaffolder-actions/scaffolder-backend-module-http-request/CHANGELOG.md @@ -1,5 +1,11 @@ # @roadiehq/scaffolder-backend-module-http-request +## 5.2.0 + +### Minor Changes + +- 8915f83: We are making the logger compatible with Backstage's LoggerService and winston's Logger so that Roadie can be used with newer and older versions of Backstage. + ## 5.1.0 ### Minor Changes diff --git a/plugins/scaffolder-actions/scaffolder-backend-module-http-request/package.json b/plugins/scaffolder-actions/scaffolder-backend-module-http-request/package.json index 7548ad1b0..c80574efa 100644 --- a/plugins/scaffolder-actions/scaffolder-backend-module-http-request/package.json +++ b/plugins/scaffolder-actions/scaffolder-backend-module-http-request/package.json @@ -1,6 +1,6 @@ { "name": "@roadiehq/scaffolder-backend-module-http-request", - "version": "5.1.0", + "version": "5.2.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/plugins/scaffolder-actions/scaffolder-backend-module-http-request/src/actions/run/helpers.ts b/plugins/scaffolder-actions/scaffolder-backend-module-http-request/src/actions/run/helpers.ts index e62f14274..f881f32ef 100644 --- a/plugins/scaffolder-actions/scaffolder-backend-module-http-request/src/actions/run/helpers.ts +++ b/plugins/scaffolder-actions/scaffolder-backend-module-http-request/src/actions/run/helpers.ts @@ -16,6 +16,7 @@ import { DiscoveryApi } from '@backstage/core-plugin-api'; import { fetch } from 'cross-fetch'; import { Logger } from 'winston'; +import { LoggerService } from '@backstage/backend-plugin-api'; import { HttpOptions } from './types'; class HttpError extends Error {} @@ -40,7 +41,7 @@ export const generateBackstageUrl = async ( export const http = async ( options: HttpOptions, - logger: Logger, + logger: Logger | LoggerService, continueOnBadResponse: boolean = false, ): Promise => { let res: any; diff --git a/yarn.lock b/yarn.lock index 2d89a8a87..05ddf8ca0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4946,7 +4946,7 @@ knex "^3.0.0" luxon "^3.0.0" -"@backstage/backend-plugin-api@^1.0.2": +"@backstage/backend-plugin-api@^1.0.1", "@backstage/backend-plugin-api@^1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@backstage/backend-plugin-api/-/backend-plugin-api-1.0.2.tgz#d0a17dbf66e32d7d56756bc7fd6ecd0fb854f40f" integrity sha512-XcTOx4ARR3JmV1y28jsi0SevQXxDF5KvOTn5D50G9XRIUnnlDMHiJjBg22kxDOZrckTlC7WWGuVe5LHnSTkcrA== @@ -33110,7 +33110,16 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -33184,7 +33193,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -33198,6 +33207,13 @@ strip-ansi@5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -35527,7 +35543,7 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -35545,6 +35561,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.0.1, wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"