From 855e5d1485a0e606c5ab3d31cdc2d7204f918e5e Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 12 Dec 2024 11:36:02 +0100 Subject: [PATCH 01/18] docs(ai): add ai.embeddings.bedrock.maxRetries to README of @roadiehq/rag-ai-backend --- .changeset/khaki-mice-wash.md | 5 +++++ plugins/backend/rag-ai-backend/README.md | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 .changeset/khaki-mice-wash.md diff --git a/.changeset/khaki-mice-wash.md b/.changeset/khaki-mice-wash.md new file mode 100644 index 000000000..2f6940cdd --- /dev/null +++ b/.changeset/khaki-mice-wash.md @@ -0,0 +1,5 @@ +--- +'@roadiehq/rag-ai-backend': patch +--- + +Added `ai.embeddings.bedrock.maxRetries` to README diff --git a/plugins/backend/rag-ai-backend/README.md b/plugins/backend/rag-ai-backend/README.md index a08ae011c..942c1ab22 100644 --- a/plugins/backend/rag-ai-backend/README.md +++ b/plugins/backend/rag-ai-backend/README.md @@ -65,6 +65,9 @@ ai: # (Required) Name of the Bedrock model to use to create Embeddings. modelName: 'amazon.titan-embed-text-v1' + # (Optional) Maximum number of retries for the AWS SDK client + maxRetries: 3 + ## AWS Bedrock uses integration-aws-node package to configure credentials. See the package README for more info. # OpenAI Embeddings configuration From 2bf0fa2869170197941b3d54b97555519d855166 Mon Sep 17 00:00:00 2001 From: Vanessa Plugues Date: Wed, 18 Dec 2024 16:32:34 -0500 Subject: [PATCH 02/18] fix(backstage-plugin-argo-cd-backend): adding finalizer to allow deleting of application --- .changeset/hip-files-sleep.md | 5 +++ .../src/service/argocd.service.ts | 2 ++ .../src/service/argocd.test.ts | 33 +++++++++++++++++++ .../src/service/types.ts | 1 + 4 files changed, 41 insertions(+) create mode 100644 .changeset/hip-files-sleep.md diff --git a/.changeset/hip-files-sleep.md b/.changeset/hip-files-sleep.md new file mode 100644 index 000000000..8a7234c3e --- /dev/null +++ b/.changeset/hip-files-sleep.md @@ -0,0 +1,5 @@ +--- +'@roadiehq/backstage-plugin-argo-cd-backend': patch +--- + +Adding the `resources-finalizer.argocd.argoproj.io` finalizer when creating a project. This allows the ability to delete the project first without getting stuck when deleting the application afterwards. This fix will allow the application to delete and not get stuck deleting. 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 a708fb6ea..c46e030cf 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 @@ -306,6 +306,7 @@ export class ArgoService implements ArgoServiceApi { metadata: { name: projectName, resourceVersion, + finalizers: ['resources-finalizer.argocd.argoproj.io'], }, spec: { destinations: [ @@ -350,6 +351,7 @@ export class ArgoService implements ArgoServiceApi { }, body: JSON.stringify(data), }; + const resp = await fetch(`${baseUrl}/api/v1/projects`, options); const responseData = await resp.json(); if (resp.status === 403) { 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 7228835cd..e399c5963 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 @@ -342,6 +342,39 @@ describe('ArgoCD service', () => { }, }); }); + + it('creates project with resources-finalizer.argocd.argoproj.io finalizer', async () => { + fetchMock.mockResponseOnce( + JSON.stringify({ + argocdCreateProjectResp, + }), + ); + const service = new ArgoService( + 'testusername', + 'testpassword', + getConfig({ + token: 'token', + }), + loggerMock, + ); + + await service.createArgoProject({ + baseUrl: 'baseUrl', + argoToken: 'token', + projectName: 'projectName', + namespace: 'namespace', + sourceRepo: 'sourceRepo', + }); + + expect(fetchMock).toHaveBeenCalledWith( + expect.any(String), + expect.objectContaining({ + body: expect.stringContaining( + '{"metadata":{"name":"projectName","finalizers":["resources-finalizer.argocd.argoproj.io"]}', + ), + }), + ); + }); }); describe('createArgoApplication', () => { 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 7df1835b4..a002cc3fe 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 @@ -287,6 +287,7 @@ export type Metadata = { deletionTimestamp?: string; deletionGracePeriodSeconds?: number; resourceVersion?: string; + finalizers?: string[]; }; export type ResourceItem = { From cda19ed7d4181a1e30fe6c5aa965cc979cfb2e85 Mon Sep 17 00:00:00 2001 From: Jussi Hallila Date: Thu, 19 Dec 2024 10:13:18 +0100 Subject: [PATCH 03/18] Allow custom label mapping for new AWS providers --- .../src/providers/AWSElastiCacheEntityProvider.ts | 7 ++++++- .../src/providers/AWSOpenSearchEntityProvider.ts | 7 ++++++- .../src/providers/AWSSQSEntityProvider.ts | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/plugins/backend/catalog-backend-module-aws/src/providers/AWSElastiCacheEntityProvider.ts b/plugins/backend/catalog-backend-module-aws/src/providers/AWSElastiCacheEntityProvider.ts index b05e02924..019c5bee9 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSElastiCacheEntityProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSElastiCacheEntityProvider.ts @@ -19,7 +19,11 @@ import * as winston from 'winston'; import { LoggerService } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { AWSEntityProvider } from './AWSEntityProvider'; -import { ownerFromTags, relationshipsFromTags } from '../utils/tags'; +import { + LabelValueMapper, + ownerFromTags, + relationshipsFromTags, +} from '../utils/tags'; import { CatalogApi } from '@backstage/catalog-client'; import { AccountConfig, DynamicAccountConfig } from '../types'; import { duration } from '../utils/timer'; @@ -39,6 +43,7 @@ export class AWSElastiCacheEntityProvider extends AWSEntityProvider { providerId?: string; ownerTag?: string; useTemporaryCredentials?: boolean; + labelValueMapper?: LabelValueMapper; }, ) { const accountId = config.getString('accountId'); diff --git a/plugins/backend/catalog-backend-module-aws/src/providers/AWSOpenSearchEntityProvider.ts b/plugins/backend/catalog-backend-module-aws/src/providers/AWSOpenSearchEntityProvider.ts index 9984ebba3..53e950946 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSOpenSearchEntityProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSOpenSearchEntityProvider.ts @@ -20,7 +20,11 @@ import * as winston from 'winston'; import { LoggerService } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { AWSEntityProvider } from './AWSEntityProvider'; -import { ownerFromTags, relationshipsFromTags } from '../utils/tags'; +import { + LabelValueMapper, + ownerFromTags, + relationshipsFromTags, +} from '../utils/tags'; import { CatalogApi } from '@backstage/catalog-client'; import { AccountConfig, DynamicAccountConfig } from '../types'; import { duration } from '../utils/timer'; @@ -40,6 +44,7 @@ export class AWSOpenSearchEntityProvider extends AWSEntityProvider { providerId?: string; ownerTag?: string; useTemporaryCredentials?: boolean; + labelValueMapper?: LabelValueMapper; }, ) { const accountId = config.getString('accountId'); diff --git a/plugins/backend/catalog-backend-module-aws/src/providers/AWSSQSEntityProvider.ts b/plugins/backend/catalog-backend-module-aws/src/providers/AWSSQSEntityProvider.ts index 7f1e82547..43df155bb 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSSQSEntityProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSSQSEntityProvider.ts @@ -19,7 +19,11 @@ import * as winston from 'winston'; import { LoggerService } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { AWSEntityProvider } from './AWSEntityProvider'; -import { ownerFromTags, relationshipsFromTags } from '../utils/tags'; +import { + LabelValueMapper, + ownerFromTags, + relationshipsFromTags, +} from '../utils/tags'; import { CatalogApi } from '@backstage/catalog-client'; import { AccountConfig, DynamicAccountConfig } from '../types'; import { duration } from '../utils/timer'; @@ -61,6 +65,7 @@ export class AWSSQSEntityProvider extends AWSEntityProvider { providerId?: string; ownerTag?: string; useTemporaryCredentials?: boolean; + labelValueMapper?: LabelValueMapper; }, ) { super(account, options); From 30883b0d092eb2103d04a484baa9f6a9a34d58af Mon Sep 17 00:00:00 2001 From: Jussi Hallila Date: Thu, 19 Dec 2024 10:15:14 +0100 Subject: [PATCH 04/18] Add changeset --- .changeset/cold-pans-fail.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/cold-pans-fail.md diff --git a/.changeset/cold-pans-fail.md b/.changeset/cold-pans-fail.md new file mode 100644 index 000000000..1f5c5adc9 --- /dev/null +++ b/.changeset/cold-pans-fail.md @@ -0,0 +1,5 @@ +--- +'@roadiehq/catalog-backend-module-aws': patch +--- + +Allow custom label mapping for new AWS providers From 3236beb8dd91c9e65791228c22e4c2be74f1a971 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 19 Dec 2024 09:35:11 +0000 Subject: [PATCH 05/18] Version Packages --- .changeset/cold-pans-fail.md | 5 ----- .changeset/hip-files-sleep.md | 5 ----- packages/backend/CHANGELOG.md | 9 +++++++++ packages/backend/package.json | 6 +++--- .../backstage-plugin-argo-cd-backend/CHANGELOG.md | 6 ++++++ .../backstage-plugin-argo-cd-backend/package.json | 2 +- plugins/backend/catalog-backend-module-aws/CHANGELOG.md | 6 ++++++ plugins/backend/catalog-backend-module-aws/package.json | 2 +- 8 files changed, 26 insertions(+), 15 deletions(-) delete mode 100644 .changeset/cold-pans-fail.md delete mode 100644 .changeset/hip-files-sleep.md diff --git a/.changeset/cold-pans-fail.md b/.changeset/cold-pans-fail.md deleted file mode 100644 index 1f5c5adc9..000000000 --- a/.changeset/cold-pans-fail.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@roadiehq/catalog-backend-module-aws': patch ---- - -Allow custom label mapping for new AWS providers diff --git a/.changeset/hip-files-sleep.md b/.changeset/hip-files-sleep.md deleted file mode 100644 index 8a7234c3e..000000000 --- a/.changeset/hip-files-sleep.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@roadiehq/backstage-plugin-argo-cd-backend': patch ---- - -Adding the `resources-finalizer.argocd.argoproj.io` finalizer when creating a project. This allows the ability to delete the project first without getting stuck when deleting the application afterwards. This fix will allow the application to delete and not get stuck deleting. diff --git a/packages/backend/CHANGELOG.md b/packages/backend/CHANGELOG.md index d757a6057..55a15a315 100644 --- a/packages/backend/CHANGELOG.md +++ b/packages/backend/CHANGELOG.md @@ -1,5 +1,14 @@ # backend +## 2.3.2 + +### Patch Changes + +- Updated dependencies [30883b0] +- Updated dependencies [2bf0fa2] + - @roadiehq/catalog-backend-module-aws@5.4.1 + - @roadiehq/backstage-plugin-argo-cd-backend@3.3.1 + ## 2.3.1 ### Patch Changes diff --git a/packages/backend/package.json b/packages/backend/package.json index 03bc86caf..0d0028cbf 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -1,6 +1,6 @@ { "name": "backend", - "version": "2.3.1", + "version": "2.3.2", "main": "dist/index.cjs.js", "types": "src/index.ts", "private": true, @@ -41,11 +41,11 @@ "@langchain/core": "^0.2.27", "@langchain/openai": "^0.2.7", "@octokit/rest": "^19.0.3", - "@roadiehq/backstage-plugin-argo-cd-backend": "3.3.0", + "@roadiehq/backstage-plugin-argo-cd-backend": "3.3.1", "@roadiehq/plugin-wiz-backend": "^1.0.7", "@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-aws": "^5.4.1", "@roadiehq/catalog-backend-module-okta": "^1.0.3", "@roadiehq/rag-ai-backend": "^1.3.0", "@roadiehq/rag-ai-backend-embeddings-aws": "^1.0.0", diff --git a/plugins/backend/backstage-plugin-argo-cd-backend/CHANGELOG.md b/plugins/backend/backstage-plugin-argo-cd-backend/CHANGELOG.md index ea9770557..9a8f8d179 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.1 + +### Patch Changes + +- 2bf0fa2: Adding the `resources-finalizer.argocd.argoproj.io` finalizer when creating a project. This allows the ability to delete the project first without getting stuck when deleting the application afterwards. This fix will allow the application to delete and not get stuck deleting. + ## 3.3.0 ### Minor Changes diff --git a/plugins/backend/backstage-plugin-argo-cd-backend/package.json b/plugins/backend/backstage-plugin-argo-cd-backend/package.json index 7dd692032..47a40c2b7 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.3.0", + "version": "3.3.1", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/plugins/backend/catalog-backend-module-aws/CHANGELOG.md b/plugins/backend/catalog-backend-module-aws/CHANGELOG.md index b782ad396..a402ba3c0 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.4.1 + +### Patch Changes + +- 30883b0: Allow custom label mapping for new AWS providers + ## 5.4.0 ### Minor Changes diff --git a/plugins/backend/catalog-backend-module-aws/package.json b/plugins/backend/catalog-backend-module-aws/package.json index a884f01ee..3bd73339c 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.4.0", + "version": "5.4.1", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", From 7a10368d9dcaa498c85e34b7bac77262ed075f0f Mon Sep 17 00:00:00 2001 From: Jussi Hallila Date: Thu, 19 Dec 2024 10:56:13 +0100 Subject: [PATCH 06/18] Add more label mapping options --- .changeset/plenty-donkeys-check.md | 5 +++++ .../src/providers/AWSSQSEntityProvider.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/plenty-donkeys-check.md diff --git a/.changeset/plenty-donkeys-check.md b/.changeset/plenty-donkeys-check.md new file mode 100644 index 000000000..e93f3ea6d --- /dev/null +++ b/.changeset/plenty-donkeys-check.md @@ -0,0 +1,5 @@ +--- +'@roadiehq/catalog-backend-module-aws': patch +--- + +Add more providers to allow custom label mapping diff --git a/plugins/backend/catalog-backend-module-aws/src/providers/AWSSQSEntityProvider.ts b/plugins/backend/catalog-backend-module-aws/src/providers/AWSSQSEntityProvider.ts index 43df155bb..4f67f5fc4 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSSQSEntityProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSSQSEntityProvider.ts @@ -43,6 +43,7 @@ export class AWSSQSEntityProvider extends AWSEntityProvider { providerId?: string; ownerTag?: string; useTemporaryCredentials?: boolean; + labelValueMapper?: LabelValueMapper; }, ) { const accountId = config.getString('accountId'); From 371755efbf0f077e3bc3fdd96cb970936d8ebb73 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 19 Dec 2024 10:11:29 +0000 Subject: [PATCH 07/18] Version Packages --- .changeset/plenty-donkeys-check.md | 5 ----- plugins/backend/catalog-backend-module-aws/CHANGELOG.md | 6 ++++++ plugins/backend/catalog-backend-module-aws/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/plenty-donkeys-check.md diff --git a/.changeset/plenty-donkeys-check.md b/.changeset/plenty-donkeys-check.md deleted file mode 100644 index e93f3ea6d..000000000 --- a/.changeset/plenty-donkeys-check.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@roadiehq/catalog-backend-module-aws': patch ---- - -Add more providers to allow custom label mapping diff --git a/plugins/backend/catalog-backend-module-aws/CHANGELOG.md b/plugins/backend/catalog-backend-module-aws/CHANGELOG.md index a402ba3c0..fbb8944e2 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.4.2 + +### Patch Changes + +- 7a10368: Add more providers to allow custom label mapping + ## 5.4.1 ### Patch Changes diff --git a/plugins/backend/catalog-backend-module-aws/package.json b/plugins/backend/catalog-backend-module-aws/package.json index 3bd73339c..bac6f63b2 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.4.1", + "version": "5.4.2", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", From 8fdf8c1fc0cc02beff2565139e35de5ba8b94b4b Mon Sep 17 00:00:00 2001 From: Iain Billett Date: Thu, 19 Dec 2024 10:37:59 +0000 Subject: [PATCH 08/18] Use region from config in AWSDynamoDbTableProvider (#1763) --- .changeset/sweet-pumpkins-raise.md | 5 +++++ .../src/providers/AWSDynamoDbTableProvider.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/sweet-pumpkins-raise.md diff --git a/.changeset/sweet-pumpkins-raise.md b/.changeset/sweet-pumpkins-raise.md new file mode 100644 index 000000000..989df7268 --- /dev/null +++ b/.changeset/sweet-pumpkins-raise.md @@ -0,0 +1,5 @@ +--- +'@roadiehq/catalog-backend-module-aws': patch +--- + +Use region from config in dynamo table provider 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 64a755dd5..0f8a56fa7 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSDynamoDbTableProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSDynamoDbTableProvider.ts @@ -63,11 +63,12 @@ export class AWSDynamoDbTableProvider extends AWSEntityProvider { } private async getDdb(dynamicAccountConfig?: DynamicAccountConfig) { + const { region } = this.getParsedConfig(dynamicAccountConfig); const credentials = this.useTemporaryCredentials ? this.getCredentials(dynamicAccountConfig) : await this.getCredentialsProvider(); return this.useTemporaryCredentials - ? new DynamoDB({ credentials }) + ? new DynamoDB({ credentials, region }) : new DynamoDB(credentials); } From 545871098f4cb232f25ad5ccf0870f153b566081 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 19 Dec 2024 10:55:50 +0000 Subject: [PATCH 09/18] Version Packages --- .changeset/khaki-mice-wash.md | 5 ----- .changeset/sweet-pumpkins-raise.md | 5 ----- plugins/backend/catalog-backend-module-aws/CHANGELOG.md | 6 ++++++ plugins/backend/catalog-backend-module-aws/package.json | 2 +- plugins/backend/rag-ai-backend/CHANGELOG.md | 6 ++++++ plugins/backend/rag-ai-backend/package.json | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) delete mode 100644 .changeset/khaki-mice-wash.md delete mode 100644 .changeset/sweet-pumpkins-raise.md diff --git a/.changeset/khaki-mice-wash.md b/.changeset/khaki-mice-wash.md deleted file mode 100644 index 2f6940cdd..000000000 --- a/.changeset/khaki-mice-wash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@roadiehq/rag-ai-backend': patch ---- - -Added `ai.embeddings.bedrock.maxRetries` to README diff --git a/.changeset/sweet-pumpkins-raise.md b/.changeset/sweet-pumpkins-raise.md deleted file mode 100644 index 989df7268..000000000 --- a/.changeset/sweet-pumpkins-raise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@roadiehq/catalog-backend-module-aws': patch ---- - -Use region from config in dynamo table provider diff --git a/plugins/backend/catalog-backend-module-aws/CHANGELOG.md b/plugins/backend/catalog-backend-module-aws/CHANGELOG.md index fbb8944e2..fcc32d41d 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.4.3 + +### Patch Changes + +- 8fdf8c1: Use region from config in dynamo table provider + ## 5.4.2 ### Patch Changes diff --git a/plugins/backend/catalog-backend-module-aws/package.json b/plugins/backend/catalog-backend-module-aws/package.json index bac6f63b2..5df2a50b1 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.4.2", + "version": "5.4.3", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/plugins/backend/rag-ai-backend/CHANGELOG.md b/plugins/backend/rag-ai-backend/CHANGELOG.md index 85ea7a153..3f2e60c7c 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.1 + +### Patch Changes + +- 855e5d1: Added `ai.embeddings.bedrock.maxRetries` to README + ## 1.3.0 ### Minor Changes diff --git a/plugins/backend/rag-ai-backend/package.json b/plugins/backend/rag-ai-backend/package.json index f67f84dd1..9901eb305 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.3.0", + "version": "1.3.1", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", From ed8a7d66610744fd97b5a82ac8de90024db6c229 Mon Sep 17 00:00:00 2001 From: Gabriel DUGNY Date: Thu, 12 Dec 2024 22:12:29 +0100 Subject: [PATCH 10/18] chore: move moment usage to luxon Also remove moment from some plugins that did not use it. --- .changeset/honest-icons-talk.md | 10 ++++++++ .changeset/lazy-mugs-fry.md | 6 +++++ .../backstage-plugin-argo-cd/package.json | 4 ++-- .../src/components/ArgoCDDetailsCard.tsx | 12 +++++----- .../src/components/ArgoCDHistoryTable.tsx | 23 +++++++++---------- .../backstage-plugin-aws-lambda/package.json | 2 +- .../AWSLambdaOverview/AWSLambdaOverview.tsx | 4 ++-- .../package.json | 2 +- .../src/components/PullRequestList.tsx | 4 ++-- .../backstage-plugin-buildkite/package.json | 2 +- .../components/ActionOutput.tsx | 11 ++++----- .../BuildKiteBuildsTable.tsx | 4 ++-- .../backstage-plugin-datadog/package.json | 5 ++-- .../backstage-plugin-jira/package.json | 2 +- .../src/hooks/useActivityStream.ts | 4 ++-- .../package.json | 1 - .../SecurityInsightsTable.tsx | 4 ++-- .../backstage-plugin-travis-ci/package.json | 7 +++--- yarn.lock | 21 ++++++----------- 19 files changed, 66 insertions(+), 62 deletions(-) create mode 100644 .changeset/honest-icons-talk.md create mode 100644 .changeset/lazy-mugs-fry.md diff --git a/.changeset/honest-icons-talk.md b/.changeset/honest-icons-talk.md new file mode 100644 index 000000000..84aca6826 --- /dev/null +++ b/.changeset/honest-icons-talk.md @@ -0,0 +1,10 @@ +--- +'@roadiehq/backstage-plugin-bitbucket-pullrequest': patch +'@roadiehq/backstage-plugin-security-insights': patch +'@roadiehq/backstage-plugin-aws-lambda': patch +'@roadiehq/backstage-plugin-buildkite': patch +'@roadiehq/backstage-plugin-argo-cd': patch +'@roadiehq/backstage-plugin-jira': patch +--- + +chore: use luxon library insteaad of moment diff --git a/.changeset/lazy-mugs-fry.md b/.changeset/lazy-mugs-fry.md new file mode 100644 index 000000000..a24ab1c55 --- /dev/null +++ b/.changeset/lazy-mugs-fry.md @@ -0,0 +1,6 @@ +--- +'@roadiehq/backstage-plugin-travis-ci': patch +'@roadiehq/backstage-plugin-datadog': patch +--- + +chore: remove unused dependency moment diff --git a/plugins/frontend/backstage-plugin-argo-cd/package.json b/plugins/frontend/backstage-plugin-argo-cd/package.json index 3d363bd6c..a5ab62254 100644 --- a/plugins/frontend/backstage-plugin-argo-cd/package.json +++ b/plugins/frontend/backstage-plugin-argo-cd/package.json @@ -76,7 +76,7 @@ "io-ts": "^2.2.16", "io-ts-promise": "^2.0.2", "io-ts-reporters": "^1.2.2", - "moment": "^2.29.1", + "luxon": "^3.5.0", "react-use": "^17.2.4" }, "peerDependencies": { @@ -89,12 +89,12 @@ "@backstage/cli": "^0.29.2", "@backstage/core-app-api": "^1.15.2", "@backstage/dev-utils": "^1.1.4", + "@backstage/frontend-test-utils": "^0.2.3", "@backstage/test-utils": "^1.7.2", "@rollup/plugin-commonjs": "^24.0.1", "@rollup/plugin-node-resolve": "^15.0.1", "@testing-library/jest-dom": "^6.0.0", "@testing-library/react": "^14.0.0", - "@backstage/frontend-test-utils": "^0.2.3", "esbuild": "^0.11.13", "jest-environment-jsdom": "^29.2.1", "msw": "^1.0.1", diff --git a/plugins/frontend/backstage-plugin-argo-cd/src/components/ArgoCDDetailsCard.tsx b/plugins/frontend/backstage-plugin-argo-cd/src/components/ArgoCDDetailsCard.tsx index 7be33f2fa..6493faba8 100644 --- a/plugins/frontend/backstage-plugin-argo-cd/src/components/ArgoCDDetailsCard.tsx +++ b/plugins/frontend/backstage-plugin-argo-cd/src/components/ArgoCDDetailsCard.tsx @@ -24,7 +24,7 @@ import { Button, } from '@material-ui/core'; import { Entity } from '@backstage/catalog-model'; -import moment from 'moment'; +import { DateTime } from 'luxon'; import { ARGOCD_ANNOTATION_APP_NAME, useArgoCDAppData, @@ -90,7 +90,7 @@ const MessageComponent = ({ }; const getElapsedTime = (start: string) => { - return moment(start).fromNow(); + return DateTime.fromISO(start).toRelative(); }; const getLastSyncState = (operationState: any) => { @@ -230,12 +230,12 @@ const OverviewComponent = ({ : '', customSort: (a: any, b: any) => { return ( - moment( + DateTime.fromISO( a.status.operationState?.finishedAt || '3000-01-01T00:00:00.000Z', - ).valueOf() - - moment( + ).toMillis() - + DateTime.fromISO( b.status.operationState?.finishedAt || '3000-01-01T00:00:00.000Z', - ).valueOf() + ).toMillis() ); }, }, diff --git a/plugins/frontend/backstage-plugin-argo-cd/src/components/ArgoCDHistoryTable.tsx b/plugins/frontend/backstage-plugin-argo-cd/src/components/ArgoCDHistoryTable.tsx index 92053a091..853c56d06 100644 --- a/plugins/frontend/backstage-plugin-argo-cd/src/components/ArgoCDHistoryTable.tsx +++ b/plugins/frontend/backstage-plugin-argo-cd/src/components/ArgoCDHistoryTable.tsx @@ -19,7 +19,7 @@ import { configApiRef, useApi } from '@backstage/core-plugin-api'; import { Link, List, ListItem } from '@material-ui/core'; import React from 'react'; import SyncIcon from '@material-ui/icons/Sync'; -import moment from 'moment'; +import { DateTime } from 'luxon'; import { ArgoCDAppDeployRevisionDetails, ArgoCDAppHistoryDetails, @@ -90,24 +90,23 @@ export const ArgoCDHistoryTable = ({ {row.deployedAt - ? `Deployed at ${moment(row.deployedAt) - .local() - .format('DD MMM YYYY, H:mm:ss')}` + ? `Deployed at ${DateTime.fromISO(row.deployedAt) + .toLocal() + .toFormat('dd MMM yyyy, HH:mm:ss')}` : null} - {row.deployedAt - ? `Run ${moment(row.deployStartedAt).local().fromNow()}` + {row.deployStartedAt + ? `Run ${DateTime.fromISO(row.deployStartedAt) + .toLocal() + .toRelative()}` : null} {row.deployedAt && row.deployStartedAt - ? `Took - ${moment - .duration( - moment(row.deployStartedAt).diff(moment(row.deployedAt)), - ) - .humanize()}` + ? `Took ${DateTime.fromISO(row.deployStartedAt) + .diff(DateTime.fromISO(row.deployedAt)) + .toFormat('hh:mm:ss')}` : null} diff --git a/plugins/frontend/backstage-plugin-aws-lambda/package.json b/plugins/frontend/backstage-plugin-aws-lambda/package.json index bba691f1f..7b78ba4e9 100644 --- a/plugins/frontend/backstage-plugin-aws-lambda/package.json +++ b/plugins/frontend/backstage-plugin-aws-lambda/package.json @@ -53,7 +53,7 @@ "aws-sdk": "^2.876.0", "cross-fetch": "^3.1.4", "history": "^5.0.0", - "moment": "^2.29.1", + "luxon": "^3.5.0", "react-use": "^17.2.4" }, "peerDependencies": { diff --git a/plugins/frontend/backstage-plugin-aws-lambda/src/components/AWSLambdaOverview/AWSLambdaOverview.tsx b/plugins/frontend/backstage-plugin-aws-lambda/src/components/AWSLambdaOverview/AWSLambdaOverview.tsx index 23127486f..b8a675a45 100644 --- a/plugins/frontend/backstage-plugin-aws-lambda/src/components/AWSLambdaOverview/AWSLambdaOverview.tsx +++ b/plugins/frontend/backstage-plugin-aws-lambda/src/components/AWSLambdaOverview/AWSLambdaOverview.tsx @@ -29,7 +29,7 @@ import { Tooltip, } from '@material-ui/core'; import { Entity } from '@backstage/catalog-model'; -import moment from 'moment'; +import { DateTime } from 'luxon'; import { useLambda } from '../../hooks/useLambda'; import { LambdaData } from '../../types'; import { @@ -72,7 +72,7 @@ const useStyles = makeStyles(theme => ({ })); const getElapsedTime = (start: string) => { - return moment(start).fromNow(); + return DateTime.fromISO(start).toRelative(); }; const AboutField = ({ diff --git a/plugins/frontend/backstage-plugin-bitbucket-pullrequest/package.json b/plugins/frontend/backstage-plugin-bitbucket-pullrequest/package.json index 71c4a1c89..dbb55a861 100644 --- a/plugins/frontend/backstage-plugin-bitbucket-pullrequest/package.json +++ b/plugins/frontend/backstage-plugin-bitbucket-pullrequest/package.json @@ -47,7 +47,7 @@ "react-use": "^17.2.4", "@backstage/plugin-catalog-react": "^1.14.2", "@backstage/catalog-model": "^1.7.1", - "moment": "^2.29.1", + "luxon": "^3.0.0", "msw": "^1.0.1", "cross-fetch": "4.0.0" }, diff --git a/plugins/frontend/backstage-plugin-bitbucket-pullrequest/src/components/PullRequestList.tsx b/plugins/frontend/backstage-plugin-bitbucket-pullrequest/src/components/PullRequestList.tsx index 221ca9a25..c39bd3ab4 100644 --- a/plugins/frontend/backstage-plugin-bitbucket-pullrequest/src/components/PullRequestList.tsx +++ b/plugins/frontend/backstage-plugin-bitbucket-pullrequest/src/components/PullRequestList.tsx @@ -22,7 +22,7 @@ import { MarkdownContent, Link, } from '@backstage/core-components'; -import moment from 'moment'; +import { DateTime } from 'luxon'; import { useApi } from '@backstage/core-plugin-api'; import { Box } from '@material-ui/core'; import { isBITBUCKETSlugSet } from '../utils/isBITBUCKETSlugSet'; @@ -54,7 +54,7 @@ const PullRequestList: React.FC = () => { }, [stateFilter, projectName, repoName, bitbucketApi]); const GetElapsedTime = ({ start }: { start: string }) => - moment(start).fromNow(); + DateTime.fromISO(start).toRelative(); const RenderStateIcon = ({ status }: { status: string }) => { switch (status) { case 'OPEN': diff --git a/plugins/frontend/backstage-plugin-buildkite/package.json b/plugins/frontend/backstage-plugin-buildkite/package.json index a99ccb6ad..6d1c99e36 100644 --- a/plugins/frontend/backstage-plugin-buildkite/package.json +++ b/plugins/frontend/backstage-plugin-buildkite/package.json @@ -52,7 +52,7 @@ "@material-ui/icons": "^4.11.2", "@material-ui/lab": "4.0.0-alpha.57", "history": "^5.0.0", - "moment": "^2.29.1", + "luxon": "^3.0.0", "react-use": "^17.2.4" }, "peerDependencies": { diff --git a/plugins/frontend/backstage-plugin-buildkite/src/components/BuildKiteBuildView/components/ActionOutput.tsx b/plugins/frontend/backstage-plugin-buildkite/src/components/BuildKiteBuildView/components/ActionOutput.tsx index 00e885da9..d1707f52b 100644 --- a/plugins/frontend/backstage-plugin-buildkite/src/components/BuildKiteBuildView/components/ActionOutput.tsx +++ b/plugins/frontend/backstage-plugin-buildkite/src/components/BuildKiteBuildView/components/ActionOutput.tsx @@ -23,11 +23,12 @@ import { Typography, Box, } from '@material-ui/core'; + +import { DateTime, Duration } from 'luxon'; import { LogViewer } from '@backstage/core-components'; import { makeStyles } from '@material-ui/core/styles'; import Alert from '@material-ui/lab/Alert'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; -import moment from 'moment'; import { useLog } from '../../useLog'; import { generateRequestUrl } from '../../utils'; @@ -63,11 +64,9 @@ export const ActionOutput: FC<{ // eslint-disable-next-line no-nested-ternary const timeElapsed = job.finished_at - ? moment - .duration( - moment(job.finished_at || moment()).diff(moment(job.started_at)), - ) - .humanize() + ? Duration.fromMillis( + DateTime.fromISO(job.finished_at).diff(DateTime.fromISO(job.started_at)).toMillis() + ).toHuman() : job.started_at ? 'In Progress' : 'Pending'; diff --git a/plugins/frontend/backstage-plugin-buildkite/src/components/BuildKiteBuildsTable/BuildKiteBuildsTable.tsx b/plugins/frontend/backstage-plugin-buildkite/src/components/BuildKiteBuildsTable/BuildKiteBuildsTable.tsx index ec67e76af..940e0263e 100644 --- a/plugins/frontend/backstage-plugin-buildkite/src/components/BuildKiteBuildsTable/BuildKiteBuildsTable.tsx +++ b/plugins/frontend/backstage-plugin-buildkite/src/components/BuildKiteBuildsTable/BuildKiteBuildsTable.tsx @@ -22,7 +22,7 @@ import RetryIcon from '@material-ui/icons/Replay'; import SyncIcon from '@material-ui/icons/Sync'; import GitHubIcon from '@material-ui/icons/GitHub'; import { Entity } from '@backstage/catalog-model'; -import moment from 'moment'; +import { DateTime } from 'luxon'; import { buildKiteBuildRouteRef } from '../../plugin'; import { useBuilds } from '../useBuilds'; import { useProjectEntity } from '../useProjectEntity'; @@ -30,7 +30,7 @@ import { BuildkiteStatus } from './components/BuildKiteRunStatus'; import { BuildkiteBuildInfo, TableProps } from '../types'; const getElapsedTime = (start: string) => { - return moment(start).fromNow(); + return DateTime.fromISO(start).toRelative(); }; const generatedColumns = [ diff --git a/plugins/frontend/backstage-plugin-datadog/package.json b/plugins/frontend/backstage-plugin-datadog/package.json index 5493fe7f0..a198c6d88 100644 --- a/plugins/frontend/backstage-plugin-datadog/package.json +++ b/plugins/frontend/backstage-plugin-datadog/package.json @@ -66,7 +66,6 @@ "@material-ui/lab": "4.0.0-alpha.57", "cross-fetch": "^3.1.4", "history": "^5.0.0", - "moment": "^2.29.1", "re-resizable": "^6.9.0", "react-use": "^17.2.4" }, @@ -82,14 +81,14 @@ "@backstage/dev-utils": "^1.1.4", "@backstage/frontend-test-utils": "^0.2.3", "@backstage/test-utils": "^1.7.2", + "@rollup/plugin-commonjs": "^24.0.1", + "@rollup/plugin-node-resolve": "^15.0.1", "@testing-library/jest-dom": "^6.0.0", "@testing-library/react": "^14.0.0", "esbuild": "^0.11.13", "jest-environment-jsdom": "^29.2.1", "msw": "^1.0.1", "rollup-plugin-dts": "^5.2.0", - "@rollup/plugin-commonjs": "^24.0.1", - "@rollup/plugin-node-resolve": "^15.0.1", "rollup-plugin-esbuild": "^5.0.0" }, "files": [ diff --git a/plugins/frontend/backstage-plugin-jira/package.json b/plugins/frontend/backstage-plugin-jira/package.json index 7a47821f4..2c85048eb 100644 --- a/plugins/frontend/backstage-plugin-jira/package.json +++ b/plugins/frontend/backstage-plugin-jira/package.json @@ -58,7 +58,7 @@ "history": "^5.0.0", "html-react-parser": "^0.14.1", "lodash": "^4.17.21", - "moment": "^2.29.1", + "luxon": "^3.0.0", "react-dnd": "^16.0.1", "react-dnd-html5-backend": "^16.0.1", "react-use": "^17.2.4", diff --git a/plugins/frontend/backstage-plugin-jira/src/hooks/useActivityStream.ts b/plugins/frontend/backstage-plugin-jira/src/hooks/useActivityStream.ts index 8baec1afc..74974e919 100644 --- a/plugins/frontend/backstage-plugin-jira/src/hooks/useActivityStream.ts +++ b/plugins/frontend/backstage-plugin-jira/src/hooks/useActivityStream.ts @@ -16,7 +16,7 @@ import { useEffect, useCallback } from 'react'; import convert from 'xml-js'; -import moment from 'moment'; +import { DateTime } from 'luxon'; import { v4 as uuidv4 } from 'uuid'; import { useApi } from '@backstage/core-plugin-api'; import { useAsyncFn } from 'react-use'; @@ -32,7 +32,7 @@ const getPropertyValue = ( entry: ActivityStreamEntry, property: ActivityStreamKeys, ): string => entry[property]?._text; -const getElapsedTime = (start: string) => moment(start).fromNow(); +const getElapsedTime = (start: string) => DateTime.fromISO(start).toRelative();; const decodeHtml = (html: string) => { const txt = document.createElement('textarea'); txt.innerHTML = html; diff --git a/plugins/frontend/backstage-plugin-security-insights/package.json b/plugins/frontend/backstage-plugin-security-insights/package.json index 013ff98f7..efd44d138 100644 --- a/plugins/frontend/backstage-plugin-security-insights/package.json +++ b/plugins/frontend/backstage-plugin-security-insights/package.json @@ -58,7 +58,6 @@ "cross-fetch": "^3.1.4", "history": "^5.0.0", "luxon": "^3.0.0", - "moment": "^2.27.0", "react-minimal-pie-chart": "^8.2.0", "react-use": "^17.2.4" }, diff --git a/plugins/frontend/backstage-plugin-security-insights/src/components/SecurityInsightsTable/SecurityInsightsTable.tsx b/plugins/frontend/backstage-plugin-security-insights/src/components/SecurityInsightsTable/SecurityInsightsTable.tsx index 38105d701..3d84b46e3 100644 --- a/plugins/frontend/backstage-plugin-security-insights/src/components/SecurityInsightsTable/SecurityInsightsTable.tsx +++ b/plugins/frontend/backstage-plugin-security-insights/src/components/SecurityInsightsTable/SecurityInsightsTable.tsx @@ -22,7 +22,7 @@ import { Progress, Table, TableColumn } from '@backstage/core-components'; import Alert from '@material-ui/lab/Alert'; import { Octokit } from '@octokit/rest'; import { useAsync } from 'react-use'; -import moment from 'moment'; +import { DateTime } from 'luxon'; import { useProjectName } from '../useProjectName'; import { useProjectEntity } from '../useProjectEntity'; import { UpdateSeverityStatusModal } from '../UpdateSeverityStatusModal'; @@ -33,7 +33,7 @@ import { SecurityInsight, SecurityInsightFilterState } from '../../types'; import { useEntity } from '@backstage/plugin-catalog-react'; const getElapsedTime = (start: string) => { - return moment(start).fromNow(); + return DateTime.fromISO(start).toRelative(); }; export const SecurityInsightsTable = () => { diff --git a/plugins/frontend/backstage-plugin-travis-ci/package.json b/plugins/frontend/backstage-plugin-travis-ci/package.json index 4df0aeaa3..910794b54 100644 --- a/plugins/frontend/backstage-plugin-travis-ci/package.json +++ b/plugins/frontend/backstage-plugin-travis-ci/package.json @@ -56,7 +56,6 @@ "cross-fetch": "^3.1.3", "date-fns": "^2.18.0", "history": "^5.0.0", - "moment": "^2.29.1", "react-use": "^17.2.4" }, "peerDependencies": { @@ -66,18 +65,18 @@ "react-router-dom": "6.0.0-beta.0 || ^6.3.0" }, "devDependencies": { - "@backstage/core-app-api": "^1.15.2", "@backstage/cli": "^0.29.2", + "@backstage/core-app-api": "^1.15.2", "@backstage/dev-utils": "^1.1.4", "@backstage/test-utils": "^1.7.2", + "@rollup/plugin-commonjs": "^24.0.1", + "@rollup/plugin-node-resolve": "^15.0.1", "@testing-library/jest-dom": "^6.0.0", "@testing-library/react": "^14.0.0", "@testing-library/user-event": "^14.0.0", "jest-environment-jsdom": "^29.2.1", "msw": "^1.0.1", "rollup-plugin-dts": "^5.2.0", - "@rollup/plugin-commonjs": "^24.0.1", - "@rollup/plugin-node-resolve": "^15.0.1", "rollup-plugin-esbuild": "^5.0.0" }, "files": [ diff --git a/yarn.lock b/yarn.lock index 3cb66e0d2..c0486d826 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16255,11 +16255,9 @@ integrity sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ== "@types/react-dom@*", "@types/react-dom@<18.0.0", "@types/react-dom@^18", "@types/react-dom@^18.0.0": - version "18.3.1" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.3.1.tgz#1e4654c08a9cdcfb6594c780ac59b55aad42fe07" - integrity sha512-qW1Mfv8taImTthu4KoXgDfLuk4bydU6Q/TkADnDWWHwi4NX4BR+LWfTp2sVmTqRrsHvyDDTelgelxJ+SsejKKQ== - dependencies: - "@types/react" "*" + version "18.3.5" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.3.5.tgz#45f9f87398c5dcea085b715c58ddcf1faf65f716" + integrity sha512-P4t6saawp+b/dFrUr2cvkVsfvPguwsxtH6dNIYRllMsefqFzkZk5UIjzyDOv5g1dXIPdG4Sp1yCR4Z6RCUsG/Q== "@types/react-redux@^7.1.20": version "7.1.33" @@ -16293,9 +16291,9 @@ "@types/react" "*" "@types/react@*", "@types/react@^16.13.1 || ^17.0.0", "@types/react@^16.13.1 || ^17.0.0 || ^18.0.0", "@types/react@^18": - version "18.3.12" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.12.tgz#99419f182ccd69151813b7ee24b792fe08774f60" - integrity sha512-D2wOSq/d6Agt28q7rSI3jhU7G6aiuzljDGZ2hTZHIkrTLUI+AF3WMeKkEZ9nN2fkBAlcktT6vcZjDFiIhMYEQw== + version "18.3.16" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.16.tgz#5326789125fac98b718d586ad157442ceb44ff28" + integrity sha512-oh8AMIC4Y2ciKufU8hnKgs+ufgbA/dhPTACaZPM86AbwX9QwnFtSoPWEeRUj8fge+v6kFt78BXcDhAU1SrrAsw== dependencies: "@types/prop-types" "*" csstype "^3.0.2" @@ -27480,7 +27478,7 @@ luxon@^3.0.0, luxon@^3.0.1, luxon@^3.4.3, luxon@~3.4.0: resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.4.4.tgz#cf20dc27dc532ba41a169c43fdcc0063601577af" integrity sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA== -luxon@^3.2.1: +luxon@^3.2.1, luxon@^3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.5.0.tgz#6b6f65c5cd1d61d1fd19dbf07ee87a50bf4b8e20" integrity sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ== @@ -28657,11 +28655,6 @@ modify-values@^1.0.0: resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== -moment@^2.27.0, moment@^2.29.1: - version "2.30.1" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae" - integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how== - moo@^0.5.0: version "0.5.2" resolved "https://registry.yarnpkg.com/moo/-/moo-0.5.2.tgz#f9fe82473bc7c184b0d32e2215d3f6e67278733c" From bf443b952a691924a309a84dcfa569c00c8fd83b Mon Sep 17 00:00:00 2001 From: Gabriel DUGNY Date: Fri, 13 Dec 2024 10:06:43 +0100 Subject: [PATCH 11/18] chorre: prettier --- .../components/BuildKiteBuildView/components/ActionOutput.tsx | 4 +++- .../components/BuildKiteBuildsTable/BuildKiteBuildsTable.tsx | 2 +- .../backstage-plugin-jira/src/hooks/useActivityStream.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/frontend/backstage-plugin-buildkite/src/components/BuildKiteBuildView/components/ActionOutput.tsx b/plugins/frontend/backstage-plugin-buildkite/src/components/BuildKiteBuildView/components/ActionOutput.tsx index d1707f52b..5f02a0b92 100644 --- a/plugins/frontend/backstage-plugin-buildkite/src/components/BuildKiteBuildView/components/ActionOutput.tsx +++ b/plugins/frontend/backstage-plugin-buildkite/src/components/BuildKiteBuildView/components/ActionOutput.tsx @@ -65,7 +65,9 @@ export const ActionOutput: FC<{ // eslint-disable-next-line no-nested-ternary const timeElapsed = job.finished_at ? Duration.fromMillis( - DateTime.fromISO(job.finished_at).diff(DateTime.fromISO(job.started_at)).toMillis() + DateTime.fromISO(job.finished_at) + .diff(DateTime.fromISO(job.started_at)) + .toMillis(), ).toHuman() : job.started_at ? 'In Progress' diff --git a/plugins/frontend/backstage-plugin-buildkite/src/components/BuildKiteBuildsTable/BuildKiteBuildsTable.tsx b/plugins/frontend/backstage-plugin-buildkite/src/components/BuildKiteBuildsTable/BuildKiteBuildsTable.tsx index 940e0263e..a042043cd 100644 --- a/plugins/frontend/backstage-plugin-buildkite/src/components/BuildKiteBuildsTable/BuildKiteBuildsTable.tsx +++ b/plugins/frontend/backstage-plugin-buildkite/src/components/BuildKiteBuildsTable/BuildKiteBuildsTable.tsx @@ -30,7 +30,7 @@ import { BuildkiteStatus } from './components/BuildKiteRunStatus'; import { BuildkiteBuildInfo, TableProps } from '../types'; const getElapsedTime = (start: string) => { - return DateTime.fromISO(start).toRelative(); + return DateTime.fromISO(start).toRelative(); }; const generatedColumns = [ diff --git a/plugins/frontend/backstage-plugin-jira/src/hooks/useActivityStream.ts b/plugins/frontend/backstage-plugin-jira/src/hooks/useActivityStream.ts index 74974e919..e21f1f8c2 100644 --- a/plugins/frontend/backstage-plugin-jira/src/hooks/useActivityStream.ts +++ b/plugins/frontend/backstage-plugin-jira/src/hooks/useActivityStream.ts @@ -32,7 +32,7 @@ const getPropertyValue = ( entry: ActivityStreamEntry, property: ActivityStreamKeys, ): string => entry[property]?._text; -const getElapsedTime = (start: string) => DateTime.fromISO(start).toRelative();; +const getElapsedTime = (start: string) => DateTime.fromISO(start).toRelative(); const decodeHtml = (html: string) => { const txt = document.createElement('textarea'); txt.innerHTML = html; From d9d38565e0790e1d910234ff0e233a25f6149a05 Mon Sep 17 00:00:00 2001 From: Gabriel DUGNY Date: Fri, 20 Dec 2024 10:51:20 +0100 Subject: [PATCH 12/18] chore: lint --- .../src/components/AWSLambdaOverview/AWSLambdaOverview.tsx | 2 +- .../backstage-plugin-jira/src/hooks/useActivityStream.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/frontend/backstage-plugin-aws-lambda/src/components/AWSLambdaOverview/AWSLambdaOverview.tsx b/plugins/frontend/backstage-plugin-aws-lambda/src/components/AWSLambdaOverview/AWSLambdaOverview.tsx index b8a675a45..595aed2e2 100644 --- a/plugins/frontend/backstage-plugin-aws-lambda/src/components/AWSLambdaOverview/AWSLambdaOverview.tsx +++ b/plugins/frontend/backstage-plugin-aws-lambda/src/components/AWSLambdaOverview/AWSLambdaOverview.tsx @@ -166,7 +166,7 @@ const OverviewComponent = ({ lambda }: { lambda: LambdaData }) => { diff --git a/plugins/frontend/backstage-plugin-jira/src/hooks/useActivityStream.ts b/plugins/frontend/backstage-plugin-jira/src/hooks/useActivityStream.ts index e21f1f8c2..571d26918 100644 --- a/plugins/frontend/backstage-plugin-jira/src/hooks/useActivityStream.ts +++ b/plugins/frontend/backstage-plugin-jira/src/hooks/useActivityStream.ts @@ -81,7 +81,7 @@ export const useActivityStream = ( return { id: id, time: { - elapsed: getElapsedTime(time), + elapsed: getElapsedTime(time)!, value: new Date(time).toLocaleTimeString('en-US', { weekday: 'long', year: 'numeric', From 2498f774a2377738d503a6c568e28763849e57ea Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Dec 2024 08:32:55 +0000 Subject: [PATCH 13/18] Version Packages --- .changeset/honest-icons-talk.md | 10 ---------- .changeset/lazy-mugs-fry.md | 6 ------ plugins/frontend/backstage-plugin-argo-cd/CHANGELOG.md | 6 ++++++ plugins/frontend/backstage-plugin-argo-cd/package.json | 2 +- .../frontend/backstage-plugin-aws-lambda/CHANGELOG.md | 6 ++++++ .../frontend/backstage-plugin-aws-lambda/package.json | 2 +- .../CHANGELOG.md | 6 ++++++ .../package.json | 2 +- .../frontend/backstage-plugin-buildkite/CHANGELOG.md | 6 ++++++ .../frontend/backstage-plugin-buildkite/package.json | 2 +- plugins/frontend/backstage-plugin-datadog/CHANGELOG.md | 6 ++++++ plugins/frontend/backstage-plugin-datadog/package.json | 2 +- plugins/frontend/backstage-plugin-jira/CHANGELOG.md | 6 ++++++ plugins/frontend/backstage-plugin-jira/package.json | 2 +- .../backstage-plugin-security-insights/CHANGELOG.md | 6 ++++++ .../backstage-plugin-security-insights/package.json | 2 +- .../frontend/backstage-plugin-travis-ci/CHANGELOG.md | 6 ++++++ .../frontend/backstage-plugin-travis-ci/package.json | 2 +- 18 files changed, 56 insertions(+), 24 deletions(-) delete mode 100644 .changeset/honest-icons-talk.md delete mode 100644 .changeset/lazy-mugs-fry.md diff --git a/.changeset/honest-icons-talk.md b/.changeset/honest-icons-talk.md deleted file mode 100644 index 84aca6826..000000000 --- a/.changeset/honest-icons-talk.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -'@roadiehq/backstage-plugin-bitbucket-pullrequest': patch -'@roadiehq/backstage-plugin-security-insights': patch -'@roadiehq/backstage-plugin-aws-lambda': patch -'@roadiehq/backstage-plugin-buildkite': patch -'@roadiehq/backstage-plugin-argo-cd': patch -'@roadiehq/backstage-plugin-jira': patch ---- - -chore: use luxon library insteaad of moment diff --git a/.changeset/lazy-mugs-fry.md b/.changeset/lazy-mugs-fry.md deleted file mode 100644 index a24ab1c55..000000000 --- a/.changeset/lazy-mugs-fry.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@roadiehq/backstage-plugin-travis-ci': patch -'@roadiehq/backstage-plugin-datadog': patch ---- - -chore: remove unused dependency moment diff --git a/plugins/frontend/backstage-plugin-argo-cd/CHANGELOG.md b/plugins/frontend/backstage-plugin-argo-cd/CHANGELOG.md index 0c54a25b7..5777e7bf3 100644 --- a/plugins/frontend/backstage-plugin-argo-cd/CHANGELOG.md +++ b/plugins/frontend/backstage-plugin-argo-cd/CHANGELOG.md @@ -1,5 +1,11 @@ # @roadiehq/backstage-plugin-argo-cd +## 2.8.6 + +### Patch Changes + +- ed8a7d6: chore: use luxon library insteaad of moment + ## 2.8.5 ### Patch Changes diff --git a/plugins/frontend/backstage-plugin-argo-cd/package.json b/plugins/frontend/backstage-plugin-argo-cd/package.json index a5ab62254..f114a68bf 100644 --- a/plugins/frontend/backstage-plugin-argo-cd/package.json +++ b/plugins/frontend/backstage-plugin-argo-cd/package.json @@ -1,6 +1,6 @@ { "name": "@roadiehq/backstage-plugin-argo-cd", - "version": "2.8.5", + "version": "2.8.6", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/plugins/frontend/backstage-plugin-aws-lambda/CHANGELOG.md b/plugins/frontend/backstage-plugin-aws-lambda/CHANGELOG.md index f64d230de..483142381 100644 --- a/plugins/frontend/backstage-plugin-aws-lambda/CHANGELOG.md +++ b/plugins/frontend/backstage-plugin-aws-lambda/CHANGELOG.md @@ -1,5 +1,11 @@ # @roadiehq/backstage-plugin-aws-lambda +## 2.2.13 + +### Patch Changes + +- ed8a7d6: chore: use luxon library insteaad of moment + ## 2.2.12 ### Patch Changes diff --git a/plugins/frontend/backstage-plugin-aws-lambda/package.json b/plugins/frontend/backstage-plugin-aws-lambda/package.json index 7b78ba4e9..2bedb33ef 100644 --- a/plugins/frontend/backstage-plugin-aws-lambda/package.json +++ b/plugins/frontend/backstage-plugin-aws-lambda/package.json @@ -1,6 +1,6 @@ { "name": "@roadiehq/backstage-plugin-aws-lambda", - "version": "2.2.12", + "version": "2.2.13", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/plugins/frontend/backstage-plugin-bitbucket-pullrequest/CHANGELOG.md b/plugins/frontend/backstage-plugin-bitbucket-pullrequest/CHANGELOG.md index eee34150d..d12b9cec7 100644 --- a/plugins/frontend/backstage-plugin-bitbucket-pullrequest/CHANGELOG.md +++ b/plugins/frontend/backstage-plugin-bitbucket-pullrequest/CHANGELOG.md @@ -1,5 +1,11 @@ # @roadiehq/backstage-plugin-bitbucket-pullrequest +## 2.0.6 + +### Patch Changes + +- ed8a7d6: chore: use luxon library insteaad of moment + ## 2.0.5 ### Patch Changes diff --git a/plugins/frontend/backstage-plugin-bitbucket-pullrequest/package.json b/plugins/frontend/backstage-plugin-bitbucket-pullrequest/package.json index dbb55a861..433c838dc 100644 --- a/plugins/frontend/backstage-plugin-bitbucket-pullrequest/package.json +++ b/plugins/frontend/backstage-plugin-bitbucket-pullrequest/package.json @@ -1,6 +1,6 @@ { "name": "@roadiehq/backstage-plugin-bitbucket-pullrequest", - "version": "2.0.5", + "version": "2.0.6", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/plugins/frontend/backstage-plugin-buildkite/CHANGELOG.md b/plugins/frontend/backstage-plugin-buildkite/CHANGELOG.md index 88637711d..2e87e52ac 100644 --- a/plugins/frontend/backstage-plugin-buildkite/CHANGELOG.md +++ b/plugins/frontend/backstage-plugin-buildkite/CHANGELOG.md @@ -1,5 +1,11 @@ # @roadiehq/backstage-plugin-buildkite +## 2.3.5 + +### Patch Changes + +- ed8a7d6: chore: use luxon library insteaad of moment + ## 2.3.4 ### Patch Changes diff --git a/plugins/frontend/backstage-plugin-buildkite/package.json b/plugins/frontend/backstage-plugin-buildkite/package.json index 6d1c99e36..2afbff9c5 100644 --- a/plugins/frontend/backstage-plugin-buildkite/package.json +++ b/plugins/frontend/backstage-plugin-buildkite/package.json @@ -1,6 +1,6 @@ { "name": "@roadiehq/backstage-plugin-buildkite", - "version": "2.3.4", + "version": "2.3.5", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/plugins/frontend/backstage-plugin-datadog/CHANGELOG.md b/plugins/frontend/backstage-plugin-datadog/CHANGELOG.md index 5f0808a15..c28b7373c 100644 --- a/plugins/frontend/backstage-plugin-datadog/CHANGELOG.md +++ b/plugins/frontend/backstage-plugin-datadog/CHANGELOG.md @@ -1,5 +1,11 @@ # @roadiehq/backstage-plugin-datadog +## 2.4.2 + +### Patch Changes + +- ed8a7d6: chore: remove unused dependency moment + ## 2.4.1 ### Patch Changes diff --git a/plugins/frontend/backstage-plugin-datadog/package.json b/plugins/frontend/backstage-plugin-datadog/package.json index a198c6d88..90290d36e 100644 --- a/plugins/frontend/backstage-plugin-datadog/package.json +++ b/plugins/frontend/backstage-plugin-datadog/package.json @@ -1,6 +1,6 @@ { "name": "@roadiehq/backstage-plugin-datadog", - "version": "2.4.1", + "version": "2.4.2", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/plugins/frontend/backstage-plugin-jira/CHANGELOG.md b/plugins/frontend/backstage-plugin-jira/CHANGELOG.md index 03ae9cec0..12de1b710 100644 --- a/plugins/frontend/backstage-plugin-jira/CHANGELOG.md +++ b/plugins/frontend/backstage-plugin-jira/CHANGELOG.md @@ -1,5 +1,11 @@ # @roadiehq/backstage-plugin-jira +## 2.8.2 + +### Patch Changes + +- ed8a7d6: chore: use luxon library insteaad of moment + ## 2.8.1 ### Patch Changes diff --git a/plugins/frontend/backstage-plugin-jira/package.json b/plugins/frontend/backstage-plugin-jira/package.json index 2c85048eb..9028324bf 100644 --- a/plugins/frontend/backstage-plugin-jira/package.json +++ b/plugins/frontend/backstage-plugin-jira/package.json @@ -1,6 +1,6 @@ { "name": "@roadiehq/backstage-plugin-jira", - "version": "2.8.1", + "version": "2.8.2", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/plugins/frontend/backstage-plugin-security-insights/CHANGELOG.md b/plugins/frontend/backstage-plugin-security-insights/CHANGELOG.md index c902293b3..ea8d4710a 100644 --- a/plugins/frontend/backstage-plugin-security-insights/CHANGELOG.md +++ b/plugins/frontend/backstage-plugin-security-insights/CHANGELOG.md @@ -1,5 +1,11 @@ # @roadiehq/backstage-plugin-security-insights +## 2.4.2 + +### Patch Changes + +- ed8a7d6: chore: use luxon library insteaad of moment + ## 2.4.1 ### Patch Changes diff --git a/plugins/frontend/backstage-plugin-security-insights/package.json b/plugins/frontend/backstage-plugin-security-insights/package.json index efd44d138..27f700c0c 100644 --- a/plugins/frontend/backstage-plugin-security-insights/package.json +++ b/plugins/frontend/backstage-plugin-security-insights/package.json @@ -1,6 +1,6 @@ { "name": "@roadiehq/backstage-plugin-security-insights", - "version": "2.4.1", + "version": "2.4.2", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/plugins/frontend/backstage-plugin-travis-ci/CHANGELOG.md b/plugins/frontend/backstage-plugin-travis-ci/CHANGELOG.md index 58a4f0a47..71b457231 100644 --- a/plugins/frontend/backstage-plugin-travis-ci/CHANGELOG.md +++ b/plugins/frontend/backstage-plugin-travis-ci/CHANGELOG.md @@ -1,5 +1,11 @@ # @roadiehq/backstage-plugin-travis-ci +## 2.1.27 + +### Patch Changes + +- ed8a7d6: chore: remove unused dependency moment + ## 2.1.26 ### Patch Changes diff --git a/plugins/frontend/backstage-plugin-travis-ci/package.json b/plugins/frontend/backstage-plugin-travis-ci/package.json index 910794b54..12df63ac0 100644 --- a/plugins/frontend/backstage-plugin-travis-ci/package.json +++ b/plugins/frontend/backstage-plugin-travis-ci/package.json @@ -1,6 +1,6 @@ { "name": "@roadiehq/backstage-plugin-travis-ci", - "version": "2.1.26", + "version": "2.1.27", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", From e91c9e46a15532e1c76893e952f7d711d2c56758 Mon Sep 17 00:00:00 2001 From: Sam Blausten Date: Wed, 25 Dec 2024 15:25:57 +0100 Subject: [PATCH 14/18] Add tests and debug logging for ownerTag mapping (#1772) --- .changeset/angry-moles-flash.md | 5 +++ .../AWSLambdaFunctionProvider.test.ts | 40 ++++++++++++++++++- .../providers/AWSLambdaFunctionProvider.ts | 12 +++++- .../src/providers/AWSRDSProvider.ts | 1 + 4 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 .changeset/angry-moles-flash.md diff --git a/.changeset/angry-moles-flash.md b/.changeset/angry-moles-flash.md new file mode 100644 index 000000000..a2bded41d --- /dev/null +++ b/.changeset/angry-moles-flash.md @@ -0,0 +1,5 @@ +--- +'@roadiehq/catalog-backend-module-aws': patch +--- + +Add test, debug logging and RDS support for ownerTag mapping diff --git a/plugins/backend/catalog-backend-module-aws/src/providers/AWSLambdaFunctionProvider.test.ts b/plugins/backend/catalog-backend-module-aws/src/providers/AWSLambdaFunctionProvider.test.ts index 88023ff07..bbfa8ebaf 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSLambdaFunctionProvider.test.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSLambdaFunctionProvider.test.ts @@ -14,7 +14,11 @@ * limitations under the License. */ -import { Lambda, ListFunctionsCommand } from '@aws-sdk/client-lambda'; +import { + Lambda, + ListFunctionsCommand, + ListTagsCommand, +} from '@aws-sdk/client-lambda'; import { STS, GetCallerIdentityCommand } from '@aws-sdk/client-sts'; import { mockClient } from 'aws-sdk-client-mock'; @@ -31,6 +35,7 @@ const logger = createLogger({ }); describe('AWSLambdaFunctionProvider', () => { + const ownerTag = 'Owner-test'; const config = new ConfigReader({ accountId: '123456789012', roleName: 'arn:aws:iam::123456789012:role/role1', @@ -64,6 +69,7 @@ describe('AWSLambdaFunctionProvider', () => { }); describe('where there are is a function', () => { + const owner = 'engineering'; beforeEach(() => { lambda.on(ListFunctionsCommand).resolves({ Functions: [ @@ -86,6 +92,12 @@ describe('AWSLambdaFunctionProvider', () => { }, ], }); + lambda.on(ListTagsCommand).resolves({ + Tags: { + [ownerTag]: owner, + owner: 'wrong', + }, + }); }); it('creates aws functions', async () => { @@ -130,6 +142,32 @@ describe('AWSLambdaFunctionProvider', () => { }); }); + it('maps owner from custom tag mapping', async () => { + const entityProviderConnection: EntityProviderConnection = { + applyMutation: jest.fn(), + refresh: jest.fn(), + }; + const provider = AWSLambdaFunctionProvider.fromConfig(config, { + logger, + ownerTag, + }); + provider.connect(entityProviderConnection); + await provider.run(); + expect(entityProviderConnection.applyMutation).toHaveBeenCalledWith({ + type: 'full', + entities: [ + expect.objectContaining({ + entity: expect.objectContaining({ + kind: 'Resource', + spec: expect.objectContaining({ + owner: owner, + }), + }), + }), + ], + }); + }); + it('is able to use dynamic config', async () => { const entityProviderConnection: EntityProviderConnection = { applyMutation: jest.fn(), 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 74594bda3..19b5d0df8 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSLambdaFunctionProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSLambdaFunctionProvider.ts @@ -128,6 +128,14 @@ export class AWSLambdaFunctionProvider extends AWSEntityProvider { if (lambdaFunction.Role) { annotations[ANNOTATION_AWS_IAM_ROLE_ARN] = lambdaFunction.Role; } + const owner = ownerFromTags(tags, this.getOwnerTag(), groups); + const relationships = relationshipsFromTags(tags); + this.logger.debug( + `Setting Lambda owner from tags as ${owner} and relationships of ${JSON.stringify( + relationships, + )}`, + ); + lambdaComponents.push({ kind: 'Resource', apiVersion: 'backstage.io/v1beta1', @@ -144,8 +152,8 @@ export class AWSLambdaFunctionProvider extends AWSEntityProvider { labels: this.labelsFromTags(tags), }, spec: { - owner: ownerFromTags(tags, this.getOwnerTag(), groups), - ...relationshipsFromTags(tags), + owner: owner, + ...relationships, type: 'lambda-function', }, }); 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 34c19d0ca..3ddbac677 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSRDSProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSRDSProvider.ts @@ -43,6 +43,7 @@ export class AWSRDSProvider extends AWSEntityProvider { providerId?: string; useTemporaryCredentials?: boolean; labelValueMapper?: LabelValueMapper; + ownerTag?: string; }, ) { const accountId = config.getString('accountId'); From fd71b838ca2090094832dfeb3da71f5807c80017 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 25 Dec 2024 15:45:03 +0100 Subject: [PATCH 15/18] Version Packages (#1773) Co-authored-by: github-actions[bot] --- .changeset/angry-moles-flash.md | 5 ----- plugins/backend/catalog-backend-module-aws/CHANGELOG.md | 6 ++++++ plugins/backend/catalog-backend-module-aws/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/angry-moles-flash.md diff --git a/.changeset/angry-moles-flash.md b/.changeset/angry-moles-flash.md deleted file mode 100644 index a2bded41d..000000000 --- a/.changeset/angry-moles-flash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@roadiehq/catalog-backend-module-aws': patch ---- - -Add test, debug logging and RDS support for ownerTag mapping diff --git a/plugins/backend/catalog-backend-module-aws/CHANGELOG.md b/plugins/backend/catalog-backend-module-aws/CHANGELOG.md index fcc32d41d..471a0329c 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.4.4 + +### Patch Changes + +- e91c9e4: Add test, debug logging and RDS support for ownerTag mapping + ## 5.4.3 ### Patch Changes diff --git a/plugins/backend/catalog-backend-module-aws/package.json b/plugins/backend/catalog-backend-module-aws/package.json index 5df2a50b1..c2335a4ca 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.4.3", + "version": "5.4.4", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", From 969c92402b2dece98ca53990b1c44bf1f6bb9453 Mon Sep 17 00:00:00 2001 From: Sam Blausten Date: Thu, 26 Dec 2024 16:07:54 +0100 Subject: [PATCH 16/18] Add tag mapping for SNS provider (#1774) --- .../src/providers/AWSSNSTopicProvider.test.ts | 13 ++++++++++++- .../src/providers/AWSSNSTopicProvider.ts | 10 +++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/plugins/backend/catalog-backend-module-aws/src/providers/AWSSNSTopicProvider.test.ts b/plugins/backend/catalog-backend-module-aws/src/providers/AWSSNSTopicProvider.test.ts index 3420a746a..18a98e028 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSSNSTopicProvider.test.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSSNSTopicProvider.test.ts @@ -14,7 +14,12 @@ * limitations under the License. */ -import { SNS, ListTopicsCommand, Topic } from '@aws-sdk/client-sns'; +import { + SNS, + ListTopicsCommand, + Topic, + ListTagsForResourceCommand, +} from '@aws-sdk/client-sns'; import { STS, GetCallerIdentityCommand } from '@aws-sdk/client-sts'; import { mockClient } from 'aws-sdk-client-mock'; @@ -47,6 +52,9 @@ describe('AWSSNSTopicProvider', () => { sns.on(ListTopicsCommand).resolves({ Topics: [], }); + sns.on(ListTagsForResourceCommand).resolves({ + Tags: [], + }); }); it('creates no SNS topics', async () => { @@ -73,6 +81,9 @@ describe('AWSSNSTopicProvider', () => { } as Partial as any, ], }); + sns.on(ListTagsForResourceCommand).resolves({ + Tags: [], + }); }); it('creates SNS topic entities', async () => { 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 bc73c41a5..82d645ec3 100644 --- a/plugins/backend/catalog-backend-module-aws/src/providers/AWSSNSTopicProvider.ts +++ b/plugins/backend/catalog-backend-module-aws/src/providers/AWSSNSTopicProvider.ts @@ -97,6 +97,10 @@ export class AWSSNSTopicProvider extends AWSEntityProvider { for await (const topicPage of topicPages) { for (const topic of topicPage.Topics || []) { if (topic.TopicArn) { + const tagsResponse = await sns.listTagsForResource({ + ResourceArn: topic.TopicArn, + }); + const tags = tagsResponse.Tags ?? []; const topicName = topic.TopicArn.split(':').pop() || 'unknown-topic'; const consoleLink = new ARN(topic.TopicArn).consoleLink; const topicEntity: ResourceEntity = { @@ -110,12 +114,12 @@ export class AWSSNSTopicProvider extends AWSEntityProvider { }, name: topicName, title: topicName, - labels: {}, // Add any labels if necessary + labels: this.labelsFromTags(tags), }, spec: { type: 'aws-sns-topic', - owner: ownerFromTags([], this.getOwnerTag(), groups), - ...relationshipsFromTags([]), + owner: ownerFromTags(tags, this.getOwnerTag(), groups), + ...relationshipsFromTags(tags), }, }; From 1a180010251c1f2e45497eb181f4d967328ed5ba Mon Sep 17 00:00:00 2001 From: Sam Blausten Date: Thu, 26 Dec 2024 19:10:04 +0100 Subject: [PATCH 17/18] Missing changelog (#1775) --- .changeset/fluffy-donuts-decide.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fluffy-donuts-decide.md diff --git a/.changeset/fluffy-donuts-decide.md b/.changeset/fluffy-donuts-decide.md new file mode 100644 index 000000000..f197ac7a4 --- /dev/null +++ b/.changeset/fluffy-donuts-decide.md @@ -0,0 +1,5 @@ +--- +'@roadiehq/catalog-backend-module-aws': minor +--- + +Add tag mapping for SNS Resource Provider From 4702dda6e1b62d765e8c8c83a5e9961d3e95e01a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 26 Dec 2024 19:21:33 +0100 Subject: [PATCH 18/18] Merge pull request #1775 from changeset-release/main Co-authored-by: github-actions[bot] --- .changeset/fluffy-donuts-decide.md | 5 ----- plugins/backend/catalog-backend-module-aws/CHANGELOG.md | 6 ++++++ plugins/backend/catalog-backend-module-aws/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/fluffy-donuts-decide.md diff --git a/.changeset/fluffy-donuts-decide.md b/.changeset/fluffy-donuts-decide.md deleted file mode 100644 index f197ac7a4..000000000 --- a/.changeset/fluffy-donuts-decide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@roadiehq/catalog-backend-module-aws': minor ---- - -Add tag mapping for SNS Resource Provider diff --git a/plugins/backend/catalog-backend-module-aws/CHANGELOG.md b/plugins/backend/catalog-backend-module-aws/CHANGELOG.md index 471a0329c..6c34a33c1 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.5.0 + +### Minor Changes + +- 1a18001: Add tag mapping for SNS Resource Provider + ## 5.4.4 ### Patch Changes diff --git a/plugins/backend/catalog-backend-module-aws/package.json b/plugins/backend/catalog-backend-module-aws/package.json index c2335a4ca..7167b6f1f 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.4.4", + "version": "5.5.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0",