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( {