feat/catalog-backend-module-gitlab: create url location only if file exists (fixes #4)

Signed-off-by: Ruslan.Nasyrov <goququ@ya.ru>
This commit is contained in:
Ruslan.Nasyrov
2022-05-19 11:11:02 +05:00
parent 6f8dfe1071
commit 30824042f1
+3 -4
View File
@@ -47,9 +47,8 @@ of your backend.
): Promise<Router> {
const builder = await CatalogBuilder.create(env);
+ builder.addProcessor(
+ GitLabDiscoveryProcessor.fromConfig(env.config, {
+ logger: env.logger,
+ skipReposWithoutExactFileMatch: false,
+ })
+ GitLabDiscoveryProcessor.fromConfig(env.config, { logger: env.logger })
+ );
```
If you don't want create location object if file with component definition do not exists in project, you can set the `skipReposWithoutExactFileMatch` option. That can reduce count of request to gitlab with 404 status code.