Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blueprint: Validate Blueprint name is not empty (HMS-3801) #1832

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

ezr-ondrej
Copy link
Collaborator

We are now validating Blueprint name on the backend to be non-empty. Adds same validation for frontend

Refs HMS-3801

@regexowl
Copy link
Collaborator

The code looks good to me, one very nit picky question - do we want to set the minimal length to three? As that's what the current regex allows even thought the helper text insists 1-100 characters are possible:

image

Other option would be to adjust the regex for example with a non-capturing optional group so we really do allow 1 or 2 char names.

@regexowl
Copy link
Collaborator

Maybe something like this? ^[a-zA-Z0-9](?:[a-zA-Z0-9-_ ]*[a-zA-Z0-9])?$

image

Could be also probably simplified to ^[a-z0-9](?:[a-z0-9-_ ]*[a-z0-9])?$ since the test is set as case insensitive.

@ezr-ondrej ezr-ondrej force-pushed the validate_blueprint_name branch 2 times, most recently from 248100a to 8d034e1 Compare March 21, 2024 15:34
@ezr-ondrej ezr-ondrej force-pushed the validate_blueprint_name branch 2 times, most recently from 556f212 to 5a2a6a2 Compare March 22, 2024 10:03
@ezr-ondrej
Copy link
Collaborator Author

/retest

We are now validating Blueprint name on the backend to be non-empty.
Adds same validation for frontend

Refs HMS-3801
Copy link
Collaborator

@regexowl regexowl left a comment

Choose a reason for hiding this comment

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

Thank you!

@regexowl
Copy link
Collaborator

/retest

@regexowl regexowl merged commit ad8fd5d into osbuild:main Mar 25, 2024
5 checks passed
@ezr-ondrej ezr-ondrej deleted the validate_blueprint_name branch March 25, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants