- Notifications
You must be signed in to change notification settings - Fork925
chore: improve dynamic parameter validation errors#18501
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Emyrk commentedJun 23, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This stack of pull requests is managed byGraphite. Learn more aboutstacking. |
0e3dc00
toa51570a
Compare0923f4d
to817afe8
Compare817afe8
to21556db
Comparec1d05a0
to129235b
Compare21556db
to5f30d20
Compare129235b
to6a5ee9e
Compare5f30d20
to40063cd
Compare0523a2f
tof4e5548
Compare686b2f7
to6849a80
Comparef4e5548
to0523a2f
Compare6849a80
toa5f35dd
Comparea5f35dd
to3c2904c
CompareUh oh!
There was an error while loading.Please reload this page.
Diagnostics hcl.Diagnostics | ||
Parameter map[string]hcl.Diagnostics |
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.
suggestion: unexport and return a clone via method?
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.
No one should really mutate the diagnostics. But I can do that 👍
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.
Actually I am going to leave it for now. If I make a method to export it, I would either need 1 method to return both diag sets. Or 2 methods. I think the usage is less intuitive in those cases.
func (e*ResolveError)Diagnostics()(hcl.Diagnostics,map[string]hcl.Diagnostics)// Or// This name is not ideal, since Diagnostics does not include the parameter ones :thinking:func (e*ResolveError)Diagnostics()(hcl.Diagnostics)func (e*ResolveError)ParameterDiagnostics()(map[string]hcl.Diagnostics)
coderd/httpapi/httperror/wsbuild.go Outdated
Validations:nil, | ||
} | ||
forname,diag:=rangeparameterErr.Parameter { |
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.
suggestion: sort map keys for deterministic output?
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.
Good idea 👍
5ed0c7a
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
What this does
The current
BuildError
response fromwsbuilder
does not support rich errors from validation. Changed this to use theValidations
block of codersdk responses to return all errors for invalid parameters.Example http response
Cli error