Log how many repositories were actually matching in

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2021-03-24 16:08:07 +01:00
parent c04a3aa337
commit f47e11427e
2 changed files with 8 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': patch
---
Log how many repositories were actually matching in `GithubDiscoveryProcessor`
@@ -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(
{