diff --git a/.changeset/bright-spiders-sniff.md b/.changeset/bright-spiders-sniff.md new file mode 100644 index 0000000000..42f47d5408 --- /dev/null +++ b/.changeset/bright-spiders-sniff.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': patch +--- + +Allow CodeOwnersProcessor to set spec.owner for System and Resource entity kinds. diff --git a/plugins/catalog-backend/src/ingestion/processors/CodeOwnersProcessor.ts b/plugins/catalog-backend/src/ingestion/processors/CodeOwnersProcessor.ts index 8a3951428e..2f432f4a0f 100644 --- a/plugins/catalog-backend/src/ingestion/processors/CodeOwnersProcessor.ts +++ b/plugins/catalog-backend/src/ingestion/processors/CodeOwnersProcessor.ts @@ -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) ) {