feat(catalog-backend): support more codeownerprocessor kinds

Signed-off-by: Andrew Thauer <athauer@wealthsimple.com>
This commit is contained in:
Andrew Thauer
2021-03-09 09:12:03 -05:00
parent c1113129f0
commit 9ef5a126d5
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': patch
---
Allow CodeOwnersProcessor to set spec.owner for System and Resource entity kinds.
@@ -29,6 +29,8 @@ import { filter, get, head, pipe, reverse } from 'lodash/fp';
import { Logger } from 'winston';
import { CatalogProcessor } from './types';
const ALLOWED_KINDS = ['API', 'Component', 'Resource', 'System'];
const ALLOWED_LOCATION_TYPES = [
'url',
'azure/api',
@@ -59,7 +61,7 @@ export class CodeOwnersProcessor implements CatalogProcessor {
// Only continue if the owner is not set
if (
!entity ||
!['Component', 'API'].includes(entity.kind) ||
!ALLOWED_KINDS.includes(entity.kind) ||
!ALLOWED_LOCATION_TYPES.includes(location.type) ||
(entity.spec && entity.spec.owner)
) {