diff --git a/.changeset/curvy-books-help.md b/.changeset/curvy-books-help.md new file mode 100644 index 0000000000..de450b12f0 --- /dev/null +++ b/.changeset/curvy-books-help.md @@ -0,0 +1,6 @@ +--- +'@backstage/backend-common': patch +'@backstage/plugin-catalog-backend': patch +--- + +Add AWS S3 Discovery Processor. Add readTree() to AwsS3UrlReader. Add ReadableArrayResponse type that implements ReadTreeResponse to use in AwsS3UrlReader's readTree() diff --git a/docs/integrations/aws-s3/discovery.md b/docs/integrations/aws-s3/discovery.md index 6e1827f395..d50aceacb8 100644 --- a/docs/integrations/aws-s3/discovery.md +++ b/docs/integrations/aws-s3/discovery.md @@ -21,8 +21,8 @@ configuration: ```yaml catalog: locations: - - type: awsS3-discovery + - type: s3-discovery target: https://sample-bucket.s3.us-east-2.amazonaws.com/ ``` -Note the `awsS3-discovery` type, as this is not a regular `url` processor. +Note the `s3-discovery` type, as this is not a regular `url` processor. diff --git a/plugins/catalog-backend/package.json b/plugins/catalog-backend/package.json index 478038eebd..934457982d 100644 --- a/plugins/catalog-backend/package.json +++ b/plugins/catalog-backend/package.json @@ -40,7 +40,6 @@ "@octokit/graphql": "^4.5.8", "@types/express": "^4.17.6", "aws-sdk": "^2.840.0", - "aws-sdk-mock": "^5.2.1", "codeowners-utils": "^1.0.2", "core-js": "^3.6.5", "cross-fetch": "^3.0.6", @@ -73,6 +72,7 @@ "@types/supertest": "^2.0.8", "@types/uuid": "^8.0.0", "@types/yup": "^0.29.8", + "aws-sdk-mock": "^5.2.1", "msw": "^0.29.0", "sqlite3": "^5.0.1", "supertest": "^6.1.3", diff --git a/plugins/catalog-backend/src/ingestion/processors/AwsS3DiscoveryProcessor.test.ts b/plugins/catalog-backend/src/ingestion/processors/AwsS3DiscoveryProcessor.test.ts index 3f542c8459..435ad368c7 100644 --- a/plugins/catalog-backend/src/ingestion/processors/AwsS3DiscoveryProcessor.test.ts +++ b/plugins/catalog-backend/src/ingestion/processors/AwsS3DiscoveryProcessor.test.ts @@ -60,7 +60,7 @@ const reader = UrlReaders.default({ describe('readLocation', () => { const processor = new AwsS3DiscoveryProcessor(reader); const spec = { - type: 'awsS3-discovery', + type: 's3-discovery', target: 'https://testbucket.s3.us-east-2.amazonaws.com', }; @@ -71,7 +71,7 @@ describe('readLocation', () => { expect(generated.type).toBe('entity'); expect(generated.location).toEqual({ target: 'awsS3-mock-object.txt', - type: 'awsS3-discovery', + type: 's3-discovery', }); expect(generated.entity).toEqual({ site_name: 'Test' }); }); diff --git a/plugins/catalog-backend/src/ingestion/processors/AwsS3DiscoveryProcessor.ts b/plugins/catalog-backend/src/ingestion/processors/AwsS3DiscoveryProcessor.ts index 3024591339..c394e9b047 100644 --- a/plugins/catalog-backend/src/ingestion/processors/AwsS3DiscoveryProcessor.ts +++ b/plugins/catalog-backend/src/ingestion/processors/AwsS3DiscoveryProcessor.ts @@ -33,7 +33,7 @@ export class AwsS3DiscoveryProcessor implements CatalogProcessor { emit: CatalogProcessorEmit, parser: CatalogProcessorParser, ): Promise { - if (location.type !== 'awsS3-discovery') { + if (location.type !== 's3-discovery') { return false; }