Skip to content

Conversation

@arya-girish-k
Copy link
Contributor

@arya-girish-k arya-girish-k commented Oct 23, 2025

Description

Add UI regex valiadation in ibm_catalog.json.

Release required?

  • No release
  • Patch release (x.x.X)
  • Minor release (x.X.x)
  • Major release (X.x.x)
Release notes content

This PR enables input validation in the UI for several string variables by leveraging the value_constraints array defined in the catalog. These constraints will be used by the UI to validate user input at runtime. The changed variables include:
prefix,existing_secrets_manager_instance_crn,existing_kms_instance_crn,existing_kms_key_crn,backup_crn,existing_backup_kms_key_crn,kibana_image_digest,existing_elasticsearch_instance_crn

Run the pipeline

If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.

Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:

/run pipeline

Checklist for reviewers

  • If relevant, a test for the change is included or updated with this PR.
  • If relevant, documentation for the change is included or updated with this PR.

For mergers

  • Use a conventional commit message to set the release level. Follow the guidelines.
  • Include information that users need to know about the PR in the commit message. The commit message becomes part of the GitHub release notes.
  • Use the Squash and merge option.

@arya-girish-k
Copy link
Contributor Author

/run pipeline

@arya-girish-k
Copy link
Contributor Author

/run pipeline

@arya-girish-k
Copy link
Contributor Author

/run pipeline

@arya-girish-k arya-girish-k marked this pull request as ready for review October 28, 2025 05:58
@arya-girish-k
Copy link
Contributor Author

arya-girish-k commented Oct 29, 2025

Tested the variables against different patterns, including null values, incorrect inputs, and correct inputs. Corresponding screenshots are attached below.

- Prefix

Pasted Graphic 129 Pasted Graphic hyphens (--')  It should not exceed 16 characters

- existing_secrets_manager_instance_crn

existing_secrets_manager_instance_crn ® existing_secrets_manager_instance_crn ® image

- existing_kms_instance_crn

existing_kms_instance_crn Pasted Graphic 133 The value provided for 'existing_kms_instance_crn' is not valid

- existing_kms_key_crn

Pasted Graphic 136 Pasted Graphic 137 image

- backup crn

Pasted Graphic 138 Pasted Graphic 139 The value provided for 'backup crn' is not valid

- existing_backup_kms_key_crn

Pasted Graphic 2 existing_backup_kms_key_crn ® image

- existing_elasticsearch_instance_crn

existing_elasticsearch_instance_crn © existing_elasticsearch_instance_crn ® The value provided for 'existing_elasticsearch_instance_crn' is not valid

- kibana_image_digest

kibana_image_digest ® kibana_image_digest ® Pasted Graphic 9

@shemau
Copy link
Contributor

shemau commented Nov 5, 2025

Here is an example backup CRN:

"crn:v1:bluemix:public:databases-for-mysql:us-south:a/abac0df06b644a9cabc6e44f55b3880e:0493008d-1399-440f-ba1a-89bb00e3ac10:backup:52ea1580-9a3f-424b-895a-423c1f8c104f"

So based on the other checks:
The 5th field should match this ICD instance type.
I am not sure if the 6th or 7th field is ever validated.
The 8th field is 8-4{3}-12 hex. (service instance GUID)
The 9th field is the string backup
The 10th field is 8-4{3}-12 hex. (backup identifier GUID)

@arya-girish-k
Copy link
Contributor Author

/run pipeline

@shemau
Copy link
Contributor

shemau commented Nov 12, 2025

/run pipeline

Copy link
Contributor

@shemau shemau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM the CRN validation on backup is better now.

@arya-girish-k
Copy link
Contributor Author

I'm updating the CRN .Don't merge this PR

@arya-girish-k
Copy link
Contributor Author

/run pipeline

@arya-girish-k
Copy link
Contributor Author

/run pipeline

@arya-girish-k
Copy link
Contributor Author

Added validation rules in variables.tf. Please find attached the screenshots for each variable’s test cases.

Pasted Graphic 29 Pasted Graphic 30 Pasted Graphic 31 Pasted Graphic 32 Pasted Graphic 33 Pasted Graphic 34

@arya-girish-k
Copy link
Contributor Author

/run pipeline

Copy link
Contributor

@shemau shemau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ocofaigh ocofaigh merged commit 41f7bd0 into main Nov 19, 2025
2 checks passed
@ocofaigh ocofaigh deleted the regex-validation branch November 19, 2025 16:53
@terraform-ibm-modules-ops
Copy link
Contributor

🎉 This PR is included in version 2.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants