-
Notifications
You must be signed in to change notification settings - Fork 257
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
Application validation crate/API #1625
Comments
(I know we chatted about this elsewhere, but just to capture it.) I'm sceptical of a specific, separate "validation" crate. I'd rather that validation rules lived with the stuff they're supposed to be validating, because "what is valid" is part of the nature of that stuff, not an external piece of knowledge that the stuff can consult. (For example, other parts of the stuff's code may rely on the concept of "what is valid", though if the external service did parsing rather than validating, that could mitigate that. But then the external service needs more knowledge of the type it needs to produce, and bang, circular dependency.) The problem then is how other code can consult the "what is valid" rules. My preference here would be to allow selective imports, so a crate that needs to validate config keys can get hold of the As you note, care is also needed about what can be shared because the validations we perform in Spin and the cloud plugin are different. So we cannot clearly say "this is what it means for a manifest to be valid" - conceptually we have kind of a pipeline of: Can we even read the damn thing At the moment this pipeline is fuzzy (at best!) and not readily accessible - the cloud plugin (per the old Thanks for raising this! I hope these rambling thoughts are useful. |
Could you clarify what you mean by this? Feature flags? |
Yes, features. |
Currently, the Spin CLI validates a Spin Application by applying various checks on a well-formed manifest, such as whether the correct key-value stores are enumerated, whether variables marked required are provided during
deploy
, and most recently, @itowlson put together #1623 to correct #1622.It would be ideal if we could factor out a validation crate that could be shared by Spin, the cloud-plugin, and cloud. This issue is to start the conversation regarding the shape and contents of this shared code (i.e. what kind of checks make the most sense to be commonized).
The text was updated successfully, but these errors were encountered: