feat/catalog-backend-module-gitlab: create url location only if file exists (fixes #2)
Signed-off-by: Ruslan.Nasyrov <goququ@ya.ru>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
'@backstage/plugin-catalog-backend-module-gitlab': patch
|
||||
---
|
||||
|
||||
do not create url location object if file with component definition do not exists in project, that decrease count of request to gitlab with 404 status code. Now we can create processor with new flag to enable this logic:
|
||||
do not create location object if file with component definition do not exists in project, that decrease count of request to gitlab with 404 status code. Now we can create processor with new flag to enable this logic:
|
||||
|
||||
```ts
|
||||
const processor = GitLabDiscoveryProcessor.fromConfig(config, {
|
||||
@@ -11,4 +11,4 @@ const processor = GitLabDiscoveryProcessor.fromConfig(config, {
|
||||
});
|
||||
```
|
||||
|
||||
**WARNING:** This new functionality does not support globs in the repo filepath
|
||||
**WARNING:** This new functionality does not support globs in the repo file path
|
||||
|
||||
@@ -47,6 +47,9 @@ of your backend.
|
||||
): Promise<Router> {
|
||||
const builder = await CatalogBuilder.create(env);
|
||||
+ builder.addProcessor(
|
||||
+ GitLabDiscoveryProcessor.fromConfig(env.config, { logger: env.logger })
|
||||
+ GitLabDiscoveryProcessor.fromConfig(env.config, {
|
||||
+ logger: env.logger,
|
||||
+ skipReposWithoutExactFileMatch: true,
|
||||
+ })
|
||||
+ );
|
||||
```
|
||||
|
||||
@@ -16,6 +16,7 @@ export class GitLabDiscoveryProcessor implements CatalogProcessor {
|
||||
config: Config,
|
||||
options: {
|
||||
logger: Logger;
|
||||
skipReposWithoutExactFileMatch?: boolean;
|
||||
},
|
||||
): GitLabDiscoveryProcessor;
|
||||
// (undocumented)
|
||||
|
||||
Reference in New Issue
Block a user