From f47e11427e6decc38d8d8e5367c48fe383ce2595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 24 Mar 2021 16:08:07 +0100 Subject: [PATCH] Log how many repositories were actually matching in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/small-oranges-enjoy.md | 5 +++++ .../src/ingestion/processors/GithubDiscoveryProcessor.ts | 8 +++----- 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 .changeset/small-oranges-enjoy.md diff --git a/.changeset/small-oranges-enjoy.md b/.changeset/small-oranges-enjoy.md new file mode 100644 index 0000000000..641fe61237 --- /dev/null +++ b/.changeset/small-oranges-enjoy.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': patch +--- + +Log how many repositories were actually matching in `GithubDiscoveryProcessor` diff --git a/plugins/catalog-backend/src/ingestion/processors/GithubDiscoveryProcessor.ts b/plugins/catalog-backend/src/ingestion/processors/GithubDiscoveryProcessor.ts index 34f7fa2782..f1818a3ab8 100644 --- a/plugins/catalog-backend/src/ingestion/processors/GithubDiscoveryProcessor.ts +++ b/plugins/catalog-backend/src/ingestion/processors/GithubDiscoveryProcessor.ts @@ -78,16 +78,14 @@ export class GithubDiscoveryProcessor implements CatalogProcessor { this.logger.info(`Reading GitHub repositories from ${location.target}`); const { repositories } = await getOrganizationRepositories(client, org); + const matching = repositories.filter(r => repoSearchPath.test(r.name)); const duration = ((Date.now() - startTimestamp) / 1000).toFixed(1); this.logger.debug( - `Read ${repositories.length} GitHub repositories in ${duration} seconds`, + `Read ${repositories.length} GitHub repositories (${matching.length} matching the pattern) in ${duration} seconds`, ); - for (const repository of repositories) { - if (!repoSearchPath.test(repository.name)) { - continue; - } + for (const repository of matching) { emit( results.location( {