diff --git a/.changeset/fuzzy-ladybugs-drive.md b/.changeset/fuzzy-ladybugs-drive.md index e999739b0f..3cdc521e19 100644 --- a/.changeset/fuzzy-ladybugs-drive.md +++ b/.changeset/fuzzy-ladybugs-drive.md @@ -2,7 +2,6 @@ '@backstage/catalog-model': patch '@backstage/plugin-scaffolder': patch '@backstage/plugin-catalog-backend': patch -'@backstage/plugin-scaffolder': patch '@backstage/plugin-scaffolder-backend': patch --- diff --git a/docs/features/software-catalog/descriptor-format.md b/docs/features/software-catalog/descriptor-format.md index da0f5e066a..77d2662ada 100644 --- a/docs/features/software-catalog/descriptor-format.md +++ b/docs/features/software-catalog/descriptor-format.md @@ -662,7 +662,7 @@ You can find out more about the `steps` key An [entity reference](#string-references) to the owner of the component, e.g. `artist-relations-team`. This field is required. -In Backstage, the owner of an Template is the singular entity (commonly a team) +In Backstage, the owner of a Template is the singular entity (commonly a team) that bears ultimate responsibility for the Template, and has the authority and capability to develop and maintain it. They will be the point of contact if something goes wrong, or if features are to be requested. The main purpose of diff --git a/packages/catalog-model/src/kinds/TemplateEntityV1alpha1.test.ts b/packages/catalog-model/src/kinds/TemplateEntityV1alpha1.test.ts index 857533a3ba..bfb27b4ed6 100644 --- a/packages/catalog-model/src/kinds/TemplateEntityV1alpha1.test.ts +++ b/packages/catalog-model/src/kinds/TemplateEntityV1alpha1.test.ts @@ -48,7 +48,7 @@ describe('templateEntityV1alpha1Validator', () => { }, }, }, - owner: 'example@email.com', + owner: 'team-a@example.com', }, }; }); @@ -95,4 +95,12 @@ describe('templateEntityV1alpha1Validator', () => { delete (entity as any).spec.owner; await expect(validator.check(entity)).resolves.toBe(true); }); + it('rejects empty owner', async () => { + (entity as any).spec.owner = ''; + await expect(validator.check(entity)).rejects.toThrow(/owner/); + }); + it('rejects wrong type owner', async () => { + (entity as any).spec.owner = 5; + await expect(validator.check(entity)).rejects.toThrow(/owner/); + }); }); diff --git a/packages/catalog-model/src/kinds/TemplateEntityV1beta2.test.ts b/packages/catalog-model/src/kinds/TemplateEntityV1beta2.test.ts index d3dd72f0a8..2a838134a9 100644 --- a/packages/catalog-model/src/kinds/TemplateEntityV1beta2.test.ts +++ b/packages/catalog-model/src/kinds/TemplateEntityV1beta2.test.ts @@ -59,7 +59,7 @@ describe('templateEntityV1beta2Validator', () => { output: { fetchUrl: '{{ steps.fetch.output.targetUrl }}', }, - owner: 'example@email.com', + owner: 'team-b@example.com', }, }; }); @@ -126,4 +126,12 @@ describe('templateEntityV1beta2Validator', () => { delete (entity as any).spec.owner; await expect(validator.check(entity)).resolves.toBe(true); }); + it('rejects empty owner', async () => { + (entity as any).spec.owner = ''; + await expect(validator.check(entity)).rejects.toThrow(/owner/); + }); + it('rejects wrong type owner', async () => { + (entity as any).spec.owner = 5; + await expect(validator.check(entity)).rejects.toThrow(/owner/); + }); }); diff --git a/packages/catalog-model/src/schema/kinds/Template.v1alpha1.schema.json b/packages/catalog-model/src/schema/kinds/Template.v1alpha1.schema.json index 2916675fe8..5a0c0efa73 100644 --- a/packages/catalog-model/src/schema/kinds/Template.v1alpha1.schema.json +++ b/packages/catalog-model/src/schema/kinds/Template.v1alpha1.schema.json @@ -88,7 +88,8 @@ }, "owner": { "type": "string", - "description": "The user (or group) owner of the template" + "description": "The user (or group) owner of the template", + "minLength": 1 } } } diff --git a/packages/catalog-model/src/schema/kinds/Template.v1beta2.schema.json b/packages/catalog-model/src/schema/kinds/Template.v1beta2.schema.json index 4749cec517..aeaf53666f 100644 --- a/packages/catalog-model/src/schema/kinds/Template.v1beta2.schema.json +++ b/packages/catalog-model/src/schema/kinds/Template.v1beta2.schema.json @@ -171,7 +171,8 @@ }, "owner": { "type": "string", - "description": "The user (or group) owner of the template" + "description": "The user (or group) owner of the template", + "minLength": 1 } } } diff --git a/plugins/scaffolder-backend/src/scaffolder/stages/helpers.test.ts b/plugins/scaffolder-backend/src/scaffolder/stages/helpers.test.ts index 6164412aa7..c314f7c727 100644 --- a/plugins/scaffolder-backend/src/scaffolder/stages/helpers.test.ts +++ b/plugins/scaffolder-backend/src/scaffolder/stages/helpers.test.ts @@ -55,7 +55,7 @@ describe('Helpers', () => { }, }, }, - owner: 'example@email.com', + owner: 'team-d@example.com', }, }; @@ -104,7 +104,7 @@ describe('Helpers', () => { }, }, }, - owner: 'example@email.com', + owner: 'team-b@example.com', }, }; @@ -153,7 +153,7 @@ describe('Helpers', () => { }, }, }, - owner: 'example@email.com', + owner: 'team-a@example.com', }, }; @@ -201,7 +201,7 @@ describe('Helpers', () => { }, }, }, - owner: 'example@email.com', + owner: 'team-b@example.com', }, }; @@ -247,7 +247,7 @@ describe('Helpers', () => { }, }, }, - owner: 'example@email.com', + owner: 'team-c@example.com', }, }; diff --git a/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx b/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx index 87fc5e4f79..6da0e3eaa2 100644 --- a/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx +++ b/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx @@ -58,11 +58,10 @@ const useStyles = makeStyles(theme => ({ label: { color: theme.palette.text.secondary, textTransform: 'uppercase', - fontSize: '10px', + fontSize: '0.65rem', fontWeight: 'bold', letterSpacing: 0.5, - overflow: 'hidden', - whiteSpace: 'nowrap', + lineHeight: 1, paddingBottom: '0.2rem', }, }));