Skip to content
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

Validation errors should give useful debugging information #195

Closed
thomastaylor312 opened this issue Oct 17, 2023 · 1 comment
Closed

Validation errors should give useful debugging information #195

thomastaylor312 opened this issue Oct 17, 2023 · 1 comment
Labels
enhancement New feature or request stale

Comments

@thomastaylor312
Copy link
Contributor

When I was debugging the issue in #194, I was receiving the following validation error:

Validation error in object: {"name":"nats","properties":{"contract":"wasmcloud:messaging","image":"wasmcloud.azurecr.io/nats_messaging:0.17.3"},"traits":[{"properties":{"spread":[{"name":"onkube","requirements":{"cosmo_connect":"k8s","kubernetes":"true"}}]},"type":"daemonscaler"}],"type":"capability"}
Object path: /spec/components/1Validation error in object: {"name":"applier","properties":{"contract":"cosmonic:kubernetes_applier","image":"wasmcloud.azurecr.io/applier:0.3.0"},"traits":[{"properties":{"spread":[{"name":"onkube","requirements":{"cosmo_connect":"k8s","kubernetes":"true"}}]},"type":"daemonscaler"}],"type":"capability"}
Object path: /spec/components/2Validation error in object: {"name":"httpserver","properties":{"contract":"wasmcloud:httpserver","image":"wasmcloud.azurecr.io/httpserver:0.19.1"},"traits":[{"properties":{"spread":[{"name":"onkube","requirements":{"cosmo_connect":"k8s","kubernetes":"true"}}]},"type":"daemonscaler"}],"type":"capability"}
Object path: /spec/components/3

While this is better than nothing, what it doesn't do is provide any indication as to what is missing or wrong with the data. We should update our errors to be more clear about what is missing. An error above should have said something like

Validation error with component "nats": Missing field `replicas`
@thomastaylor312 thomastaylor312 added the enhancement New feature or request label Oct 17, 2023
@thomastaylor312 thomastaylor312 changed the title Validation errors are not actually useful Validation errors should give useful debugging information Oct 17, 2023
Copy link

stale bot commented Dec 16, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this has been closed too eagerly, please feel free to tag a maintainer so we can keep working on the issue. Thank you for contributing to wasmCloud!

@stale stale bot added the stale label Dec 16, 2023
@stale stale bot closed this as completed Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

1 participant