-
Notifications
You must be signed in to change notification settings - Fork 16
validate-stack-name-regexp #915
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
base: staging
Are you sure you want to change the base?
Conversation
| .min(1, "Stack name is required") | ||
| .max(255, "Stack name must be less than 255 characters") | ||
| .refine((name) => validateStackName(name), "Stack name is already in use"); | ||
| .max(32, "Stack name must be less than 32 characters") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the designs it was 32, but yes, api is king, so back to 255
| .max(255, "Stack name must be less than 255 characters") | ||
| .refine((name) => validateStackName(name), "Stack name is already in use"); | ||
| .max(32, "Stack name must be less than 32 characters") | ||
| .refine((name) => validateStackNameNotInUse(name), "Stack name is already in use") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As sending the request is the most expensive operation during the validation, we should run it as the last validator. Imo only after all the other checks were good, we should run it. Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, swapped the order, not sure how much it improves, but if earlier rule fails first, it will show up sooner.
|
PTAL |

No description provided.