Improve validation messages for runner registration form in Google Cloud
Description
During work at !146545 (merged) we added validation to fields, but more can be done to display more specific validation messages on each field.
Each form field should a specific error message to explain the format an options users have.
- Project ID
- Help text: To improve security, use a project just for CI/CD. Where's my project ID in Google Cloud?
↗ Must be 6 to 30 lowercase letters, digits, or hyphens. It needs to start with a letter and end with a letter or number. Example:my-sample-project-191923
. - Empty: Project ID is required.
- Wrong format: Project ID must have the right format.
- Help text: To improve security, use a project just for CI/CD. Where's my project ID in Google Cloud?
- Region
- Help text: Must have the format
<location>-<sublocation><number>
. Example:us-central1
. - Empty: Region is required.
- Wrong format: Region must have the right format.
- Help text: Must have the format
- Zone
- Help text: View available zones
↗ Must have the format<region>-<zone_letter>
. Example:us-central1-a
. - Empty: Zone is required.
- Wrong format: Zone must have the right format.
- Help text: View available zones
- Machine type
- Help text: For most CI/CD jobs, use a N2D standard machine type
↗ . Must have the format<series>-<type>
. Example:n2d-standard-2
. - Empty: Machine type is required.
- Wrong format: Machine type must have the right format.
- Help text: For most CI/CD jobs, use a N2D standard machine type
Original MR
The following discussion from !146545 (merged) should be addressed:
-
@pedroms started a discussion: (+2 comments) @mrincon suggestion (non-blocking): Ideally, the format and example should be enclosed in a code span. Like so:
Region must have the format
<location>-<sublocation><number>
. Example:us-central1
We can remove the period after the example as it's not a sentence.
cc @fneill
Edited by Pedro Moreira da Silva