From 6f8dfe10713f089214651324f5460b9d2ca9f32a Mon Sep 17 00:00:00 2001 From: "Ruslan.Nasyrov" Date: Wed, 18 May 2022 15:04:19 +0500 Subject: [PATCH] feat/catalog-backend-module-gitlab: create url location only if file exists (fixes #3) Signed-off-by: Ruslan.Nasyrov --- docs/integrations/gitlab/discovery.md | 2 +- plugins/catalog-backend-module-gitlab/src/lib/client.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/integrations/gitlab/discovery.md b/docs/integrations/gitlab/discovery.md index 2ce4b59ca6..5a5fdb1d92 100644 --- a/docs/integrations/gitlab/discovery.md +++ b/docs/integrations/gitlab/discovery.md @@ -49,7 +49,7 @@ of your backend. + builder.addProcessor( + GitLabDiscoveryProcessor.fromConfig(env.config, { + logger: env.logger, -+ skipReposWithoutExactFileMatch: true, ++ skipReposWithoutExactFileMatch: false, + }) + ); ``` diff --git a/plugins/catalog-backend-module-gitlab/src/lib/client.ts b/plugins/catalog-backend-module-gitlab/src/lib/client.ts index 5c43db6e68..27214f3be8 100644 --- a/plugins/catalog-backend-module-gitlab/src/lib/client.ts +++ b/plugins/catalog-backend-module-gitlab/src/lib/client.ts @@ -80,6 +80,13 @@ export class GitLabClient { }); if (!response.ok) { + if (response.status >= 500) { + this.logger.debug( + `Unexpected response when fetching ${request.toString()}. Expected 200 but got ${ + response.status + } - ${response.statusText}`, + ); + } return false; }