Skip to content

chore: validate fields as per coderd #85

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

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Sep 3, 2024

Unfortunately, coderd validation errors don't return the reason why the validation failed, leading to confusing (almost useless) error messages when creating templates, groups or users with invalid names via the provider.

The changes on coderd/httpapi to resolve this are non-trivial, as the struct validation library we use doesn't appear to support attaching an error reason to a field validator function.

Instead, we'll translate the string validation functions and regex from coderd/httpapi/name.go.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @ethanndickson and the rest of your teammates on Graphite Graphite

@ethanndickson ethanndickson marked this pull request as ready for review September 3, 2024 08:28
@ethanndickson ethanndickson merged commit 21bd3ee into main Sep 3, 2024
14 checks passed
@ethanndickson ethanndickson deleted the 09-03-chore_validate_fields_as_per_coderd branch September 3, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants