From b5812e52bfb4f3bcc8336f6be9a0e15bf41d40bf Mon Sep 17 00:00:00 2001 From: Tim Nguyen Date: Thu, 22 Apr 2021 12:35:27 -0400 Subject: [PATCH] fix: Update workspace name reg exp and workspace config tags reg exp (#452) --- .../__tests__/env-type-config-service.test.js | 6 ++++++ .../lib/environment-type/__tests__/env-type-service.test.js | 4 ++-- .../lib/environment-type/schema/create-env-type.js | 2 +- .../schema/create-or-update-env-type-config.js | 2 +- .../lib/environment-type/schema/update-env-type.js | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/__tests__/env-type-config-service.test.js b/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/__tests__/env-type-config-service.test.js index ad8e654ca1..cefe377359 100644 --- a/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/__tests__/env-type-config-service.test.js +++ b/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/__tests__/env-type-config-service.test.js @@ -301,6 +301,12 @@ describe('EnvTypeService', () => { value: '${vpcId}', }, ], + tags: [ + { + key: 'customTag', + value: '${indexId}', + }, + ], }; const envType = { id: newConfig.id, diff --git a/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/__tests__/env-type-service.test.js b/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/__tests__/env-type-service.test.js index 2b66384f76..91403f95f3 100644 --- a/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/__tests__/env-type-service.test.js +++ b/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/__tests__/env-type-service.test.js @@ -297,7 +297,7 @@ describe('EnvTypeService', () => { const envType = { id: 'theverybest', rev: 1, - name: 'stuff', + name: 'stuff with spaces', desc: 'stuff', status: 'approved', }; @@ -413,7 +413,7 @@ describe('EnvTypeService', () => { // BUILD const envType = { id: 'iwilltravelacrosstheland', - name: 'searchingfarandwide', + name: 'searchingfarandwide with spaces', product: { productId: 'each-------tounderstand', }, diff --git a/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/schema/create-env-type.js b/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/schema/create-env-type.js index b23e350d6e..e09104abb0 100644 --- a/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/schema/create-env-type.js +++ b/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/schema/create-env-type.js @@ -33,7 +33,7 @@ const schema = { // To accommodate default value ${product.name}-${provisioningArtifact.name} we need 16383 maxLength: 16383, minLength: 2, - pattern: '^[a-zA-Z0-9_\\-]*$', + pattern: '^[a-zA-Z0-9_\\-\\s]*$', }, // Description for this workspace-type // Defaults to provisioningArtifact.description diff --git a/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/schema/create-or-update-env-type-config.js b/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/schema/create-or-update-env-type-config.js index e3169c6593..922fd4236d 100644 --- a/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/schema/create-or-update-env-type-config.js +++ b/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/schema/create-or-update-env-type-config.js @@ -101,7 +101,7 @@ const schema = { value: { type: 'string', // Tag value maxLength: 8191, - pattern: '^([^<>{}]*)$', + pattern: '^([$\\{]*[^<>{}]*[\\}]*)$', }, }, }, diff --git a/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/schema/update-env-type.js b/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/schema/update-env-type.js index 1262e341bd..469a03321f 100644 --- a/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/schema/update-env-type.js +++ b/addons/addon-environment-sc-api/packages/environment-type-mgmt-services/lib/environment-type/schema/update-env-type.js @@ -36,7 +36,7 @@ const schema = { // To accommodate default value ${product.name}-${provisioningArtifact.name} we need 16383 maxLength: 16383, minLength: 2, - pattern: '^[a-zA-Z0-9_\\-]*$', + pattern: '^[a-zA-Z0-9_\\-\\s]*$', }, // Description for this workspace-type // Defaults to provisioningArtifact.description