update shouldProcessProject to first check by namespacedPath (as previous), then check by id if failed

Signed-off-by: Claire Peng <clairep@spotify.com>
This commit is contained in:
Claire Peng
2025-09-22 13:42:16 +01:00
parent d84bf17948
commit bcac475df2
@@ -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;
}
}