From fa56f46158f78c665a7e0f69f7b2818632f560af Mon Sep 17 00:00:00 2001 From: Vividh Chandna Date: Thu, 29 Oct 2020 21:28:18 +0530 Subject: [PATCH] fix: Update tags validation message & documentation (#3145) * Update dns label validation message to match regex pattern * Update documentation for tags validation & examples * Add changeset --- .changeset/ninety-ads-dance.md | 5 +++++ docs/features/software-catalog/descriptor-format.md | 6 +++--- .../src/entity/policies/FieldFormatEntityPolicy.ts | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/ninety-ads-dance.md diff --git a/.changeset/ninety-ads-dance.md b/.changeset/ninety-ads-dance.md new file mode 100644 index 0000000000..a03298fd7f --- /dev/null +++ b/.changeset/ninety-ads-dance.md @@ -0,0 +1,5 @@ +--- +'@backstage/catalog-model': patch +--- + +Fix documentation and validation message for tags diff --git a/docs/features/software-catalog/descriptor-format.md b/docs/features/software-catalog/descriptor-format.md index 62ac9da8d8..a330ef196a 100644 --- a/docs/features/software-catalog/descriptor-format.md +++ b/docs/features/software-catalog/descriptor-format.md @@ -256,8 +256,8 @@ component, like `java` or `go`. This field is optional, and currently has no special semantics. -Each tag must be sequences of `[a-zA-Z0-9]` separated by `-`, at most 63 -characters in total. +Each tag must be sequences of `[a-z0-9]` separated by `-`, at most 63 characters +in total. ## Kind: Component @@ -418,7 +418,7 @@ of the `metadata.name` field. ### `metadata.tags` [optional] A list of strings that can be associated with the template, e.g. -`['Recommended', 'React']`. +`['recommended', 'react']`. This list will also be used in the frontend to display to the user so you can potentially search and group templates by these tags. diff --git a/packages/catalog-model/src/entity/policies/FieldFormatEntityPolicy.ts b/packages/catalog-model/src/entity/policies/FieldFormatEntityPolicy.ts index 7193c1a89b..acd4469fcb 100644 --- a/packages/catalog-model/src/entity/policies/FieldFormatEntityPolicy.ts +++ b/packages/catalog-model/src/entity/policies/FieldFormatEntityPolicy.ts @@ -74,7 +74,7 @@ export class FieldFormatEntityPolicy implements EntityPolicy { case 'isValidNamespace': case 'isValidDnsLabel': expectation = - 'a string that is sequences of [a-zA-Z0-9] separated by [-], at most 63 characters in total'; + 'a string that is sequences of [a-z0-9] separated by [-], at most 63 characters in total'; break; case 'isValidAnnotationValue': expectation = 'a string';