jozu-ai / kitops

Tools for easing the handoff between AI/ML and App/SRE teams.
https://KitOps.ml
Apache License 2.0
266 stars 26 forks source link

Generate JSON schema for Kitfile and use it to validate incoming Kitfiles #239

Open amisevsk opened 2 months ago

amisevsk commented 2 months ago

Describe the problem you're trying to solve When a Kitfile does not match the spec (e.g. uses an object instead of a list for datasets), the message displayed is not immediately clear:

❯ kit pack -t test:test .
Failed to pack model kit: yaml: unmarshal errors:
  line 5: cannot unmarshal !!map into []artifact.DataSet

For someone unfamiliar with Go, this might not be clear enough to realize the issue.

In addition, extra fields and typos are silently ignored (e.g. if you misspell a field).

Describe the solution you'd like We should generate a schema from the Kitfile struct and use it to validate incoming Kitfiles, providing more useful error messages when the Kitfile has errors.

Describe alternatives you've considered N/A

Additional context N/A

gorkem commented 2 months ago

related to #88

amisevsk commented 2 months ago

Ah woops, I gotta start searching for existing issues. Sorry.