From 6bc20913f115337e41147f80dfc6d757acdfe814 Mon Sep 17 00:00:00 2001 From: Arya Girish K Date: Thu, 25 Sep 2025 15:31:16 +0530 Subject: [PATCH 1/4] feat: Add UI regex validation --- ibm_catalog.json | 27 ++++++++++++++++++++++++--- solutions/apps/variables.tf | 3 +-- solutions/project/variables.tf | 2 +- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/ibm_catalog.json b/ibm_catalog.json index 1ee1d28..c67b626 100644 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -145,7 +145,14 @@ }, { "key": "prefix", - "required": true + "required": true, + "value_constraints": [ + { + "type": "regex", + "description": "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). It should not exceed 16 characters", + "value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$" + } + ] }, { "key": "existing_resource_group_name", @@ -241,7 +248,14 @@ "key": "image_port" }, { - "key": "managed_domain_mappings" + "key": "managed_domain_mappings", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'managed_domain_mappings' is not valid.", + "value": "^__NULL__$|^local_public$|^local_private$|^local$" + } + ] }, { "key": "run_arguments" @@ -377,7 +391,14 @@ }, { "key": "prefix", - "required": true + "required": true, + "value_constraints": [ + { + "type": "regex", + "description": "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). It should not exceed 16 characters", + "value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$" + } + ] }, { "key": "existing_resource_group_name", diff --git a/solutions/apps/variables.tf b/solutions/apps/variables.tf index d2dc3c7..37a4e16 100644 --- a/solutions/apps/variables.tf +++ b/solutions/apps/variables.tf @@ -28,8 +28,7 @@ variable "region" { variable "prefix" { type = string nullable = true - description = "The prefix to be added to all resources created by this solution. To skip using a prefix, set this value to null or an empty string. The prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It should not exceed 16 characters, must not end with a hyphen('-'), and can not contain consecutive hyphens ('--'). Example: prod-0205-cos. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)." - + description = "The prefix to add to all resources that this solution creates (e.g `prod`, `test`, `dev`). To skip using a prefix, set this value to null or an empty string. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)." validation { # - null and empty string is allowed # - Must not contain consecutive hyphens (--): length(regexall("--", var.prefix)) == 0 diff --git a/solutions/project/variables.tf b/solutions/project/variables.tf index 464a861..6a690e1 100644 --- a/solutions/project/variables.tf +++ b/solutions/project/variables.tf @@ -22,7 +22,7 @@ variable "provider_visibility" { variable "prefix" { type = string nullable = true - description = "The prefix to be added to all resources created by this solution. To skip using a prefix, set this value to null or an empty string. The prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It should not exceed 16 characters, must not end with a hyphen('-'), and can not contain consecutive hyphens ('--'). Example: prod-0205-cos. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)." + description = "The prefix to add to all resources that this solution creates (e.g `prod`, `test`, `dev`). To skip using a prefix, set this value to null or an empty string. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)." validation { # - null and empty string is allowed From 362f270140897fef611aeec6ebcd2c905143f088 Mon Sep 17 00:00:00 2001 From: Arya Girish K Date: Thu, 25 Sep 2025 16:06:34 +0530 Subject: [PATCH 2/4] feat: Add UI regex validation --- ibm_catalog.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibm_catalog.json b/ibm_catalog.json index c67b626..c4038b0 100644 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -252,7 +252,7 @@ "value_constraints": [ { "type": "regex", - "description": "The value provided for 'managed_domain_mappings' is not valid.", + "description": "The value provided for 'managed_domain_mappings' is not valid. Valid values are 'local_public', 'local_private', or 'local'.", "value": "^__NULL__$|^local_public$|^local_private$|^local$" } ] From a667436a413b34640063009df88de2e2d4abd8da Mon Sep 17 00:00:00 2001 From: Arya Girish K Date: Fri, 26 Sep 2025 14:02:59 +0530 Subject: [PATCH 3/4] fix: Resolved typo errors --- README.md | 2 +- examples/apps/outputs.tf | 2 +- ibm_catalog.json | 4 ++-- outputs.tf | 2 +- solutions/apps/outputs.tf | 2 +- solutions/project/outputs.tf | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e829871..ef43ddb 100644 --- a/README.md +++ b/README.md @@ -176,7 +176,7 @@ No resources. | [binding](#output\_binding) | Configuration of the created code engine binding. | | [build](#output\_build) | Configuration of the created code engine build. | | [config\_map](#output\_config\_map) | Configuration of the created code engine config map. | -| [domain\_mapping](#output\_domain\_mapping) | Configuration of the created code engine domain maping. | +| [domain\_mapping](#output\_domain\_mapping) | Configuration of the created code engine domain mapping. | | [job](#output\_job) | Configuration of the created code engine job. | | [project\_id](#output\_project\_id) | ID of the created code engine project. | | [secret](#output\_secret) | Configuration of the created code engine secret. | diff --git a/examples/apps/outputs.tf b/examples/apps/outputs.tf index a0a75dc..7325472 100644 --- a/examples/apps/outputs.tf +++ b/examples/apps/outputs.tf @@ -23,6 +23,6 @@ output "secret" { } output "domain_mapping" { - description = "Configuration of the created code engine domain maping." + description = "Configuration of the created code engine domain mapping." value = module.code_engine.domain_mapping } diff --git a/ibm_catalog.json b/ibm_catalog.json index c4038b0..0659480 100644 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -149,7 +149,7 @@ "value_constraints": [ { "type": "regex", - "description": "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). It should not exceed 16 characters", + "description": "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). It should not exceed 16 characters.", "value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$" } ] @@ -395,7 +395,7 @@ "value_constraints": [ { "type": "regex", - "description": "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). It should not exceed 16 characters", + "description": "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). It should not exceed 16 characters.", "value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$" } ] diff --git a/outputs.tf b/outputs.tf index 886c0a3..0f3f8e8 100644 --- a/outputs.tf +++ b/outputs.tf @@ -38,6 +38,6 @@ output "binding" { } output "domain_mapping" { - description = "Configuration of the created code engine domain maping." + description = "Configuration of the created code engine domain mapping." value = module.domain_mapping } diff --git a/solutions/apps/outputs.tf b/solutions/apps/outputs.tf index 6bb7025..2ccaa97 100644 --- a/solutions/apps/outputs.tf +++ b/solutions/apps/outputs.tf @@ -23,7 +23,7 @@ output "secret" { } output "domain_mapping" { - description = "Configuration of the created code engine domain maping." + description = "Configuration of the created code engine domain mapping." value = module.code_engine.domain_mapping } diff --git a/solutions/project/outputs.tf b/solutions/project/outputs.tf index 467f577..b8e652d 100644 --- a/solutions/project/outputs.tf +++ b/solutions/project/outputs.tf @@ -23,7 +23,7 @@ output "secret" { } output "domain_mapping" { - description = "Configuration of the created code engine domain maping." + description = "Configuration of the created code engine domain mapping." value = module.domain_mapping } From d48220fd91e2453397c6b249f40804fd9f3e8776 Mon Sep 17 00:00:00 2001 From: Arya Girish K Date: Fri, 26 Sep 2025 16:34:10 +0530 Subject: [PATCH 4/4] feat: Resolve precommit error --- solutions/apps/variables.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/solutions/apps/variables.tf b/solutions/apps/variables.tf index 37a4e16..8782f7d 100644 --- a/solutions/apps/variables.tf +++ b/solutions/apps/variables.tf @@ -29,6 +29,7 @@ variable "prefix" { type = string nullable = true description = "The prefix to add to all resources that this solution creates (e.g `prod`, `test`, `dev`). To skip using a prefix, set this value to null or an empty string. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)." + validation { # - null and empty string is allowed # - Must not contain consecutive hyphens (--): length(regexall("--", var.prefix)) == 0