Add graphql validation error message on create workspace page
Issue: Descriptive validation error messages should be... (#517804 - closed)
What does this MR do and why?
This MR adds description of the error message to the alert displayed to a user when workspace creation fails.
We have some validation rules on the WorkspaceVariableInput type at the GraphQL level, these rules raise a validation error that is caught in the FE. We just display a generic failure message when an error is caught by the FE because these are usually unknown errors.
However in the case where we have validation failures, we want to show this information to the user.
Add graphql validation error message on create workspace page
- Adds format validation rule to workspace_variable model
- Adds length validation rule to input type
- Display error.message if present
References
Screenshots or screen recordings
| Before | After | After |
|---|---|---|
![]() |
![]() |
![]() |
How to set up and validate locally
- In local dev environment, setup remote development workspaces: https://gitlab.com/gitlab-org/workspaces/gitlab-workspaces-docs/-/blob/main/doc/local-development-environment-setup.md
- Navigate to
http://gdk.test:3000/-/remote_development/workspaces/new - Click on
Add variableand add unallowed characters such as/$%etc - Observe the error message
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.


