Skip to content

Commit 2a38c32

Browse files
committed
fix: restrict entities to component
Signed-off-by: Diana Janickova <djanicko@redhat.com>
1 parent 6699550 commit 2a38c32

4 files changed

Lines changed: 8 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-scorecard-backend-module-filecheck': patch
3+
---
4+
5+
Restrict filecheck metric collection to Component catalog entities by adding a kind: component catalog filter.

workspaces/scorecard/plugins/scorecard-backend-module-filecheck/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ If no files are configured, no metrics are registered and the module has no effe
7575

7676
### Entity Requirements
7777

78-
Entities must have the `backstage.io/source-location` annotation set (typically added automatically by the catalog ingestion process):
78+
Only **Component** entities are checked. They must have the `backstage.io/source-location` annotation set (typically added automatically by the catalog ingestion process):
7979

8080
```yaml
8181
# catalog-info.yaml

workspaces/scorecard/plugins/scorecard-backend-module-filecheck/src/metricProviders/FilecheckMetricProvider.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ describe('FilecheckMetricProvider', () => {
274274

275275
it('should return correct catalog filter', () => {
276276
expect(provider?.getCatalogFilter()).toEqual({
277+
kind: 'component',
277278
'metadata.annotations.backstage.io/source-location': expect.any(Symbol),
278279
});
279280
});

workspaces/scorecard/plugins/scorecard-backend-module-filecheck/src/metricProviders/FilecheckMetricProvider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export class FilecheckMetricProvider implements MetricProvider<'boolean'> {
7272

7373
getCatalogFilter(): Record<string, string | symbol | (string | symbol)[]> {
7474
return {
75+
kind: 'component',
7576
'metadata.annotations.backstage.io/source-location':
7677
CATALOG_FILTER_EXISTS,
7778
};

0 commit comments

Comments
 (0)