From bcac475df24d338433e3df8e86bcd58826d8995e Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Mon, 22 Sep 2025 13:42:16 +0100 Subject: [PATCH] update shouldProcessProject to first check by namespacedPath (as previous), then check by id if failed Signed-off-by: Claire Peng --- .../src/providers/GitlabDiscoveryEntityProvider.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.ts b/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.ts index 24bc5faccb..869374de07 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.ts @@ -589,12 +589,22 @@ export class GitlabDiscoveryEntityProvider implements EntityProvider { project.default_branch ?? this.config.fallbackBranch; - const hasFile = await client.hasFile( - project.id.toString() ?? project.path_with_namespace ?? '', + // Find file with namespaced path (most use-cases) + let hasFile = await client.hasFile( + project.path_with_namespace ?? '', project_branch, this.config.catalogFile, ); + // Find file with project id if namespace failed + if (!hasFile) { + hasFile = await client.hasFile( + project.id.toString(), + project_branch, + this.config.catalogFile, + ); + } + return hasFile; } }