Merge pull request #4890 from andrewthauer/feat/codeowner-kinds

feat(catalog-backend): support more codeownerprocessor kinds
This commit is contained in:
Andrew Thauer
2021-03-10 10:04:30 -05:00
committed by GitHub
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`, `Resource`, and `Domain` 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', 'Domain', '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)
) {