devspace-sh / devspace

DevSpace - The Fastest Developer Tool for Kubernetes ⚡ Automate your deployment workflow with DevSpace and develop software directly inside Kubernetes.
https://devspace.sh
Apache License 2.0
4.19k stars 351 forks source link

Update schema on schemastore.org #2177

Closed withinboredom closed 1 year ago

withinboredom commented 1 year ago

What happened?

Intellij pulls the schema from schemastore.org in order to provide code completion and assistance. The current schema there doesn't recognize version v2beta1 and the IDE thinks everything is wrong.

What did you expect to happen instead?

The schema to recognize v2beta1 and either provide no assistance or updated to reflect the v2beta1 schema.

/kind bug

tukobadnyanoba commented 1 year ago

@withinboredom Could you please add more info? The current schema is added for v2beta1 only. Can you please add screenshots of the error or devspace.yaml?

tukobadnyanoba commented 1 year ago

pipelines, images, deployments and many other root level keys are map[string]interface. You have to add a key of your choice and you will get assistance in completing value for that key.

withinboredom commented 1 year ago

The current schema is added for v2beta1 only

Looking a little closer, I think maybe the schema definition might be off ... or the documentation.

Example in the documentation:

image

From IDE:

image

Example in the documentation:

image

From IDE:

image

Documentation:

image

From IDE:

image

Documentation:

image

From IDE:

image
LukasGentele commented 1 year ago

We have valid schema plus schema generator already in docs/hack and schema folder. I'll make sure we generate the newest version and submit to schemastore. Thanks for the contribution in hack/ on the root level but it's not producing the correct output. I'll make sure we get the official schema updated. @FabianKramm for reference not to accept any PRs on this topic since we already have a working script to produce a valid schema.

dolfelt commented 1 year ago

@LukasGentele @tukobadnyanoba It appears that the devspace-schema.json isn't a fully valid representation of the devspace.yaml schema. For example the name variable is required on vars and it doesn't recognize strings as a valid value. It seems that the generator isn't able to pick up on all the nuances built into the UnmarshalYAML methods.

Is there a valid schema somewhere that can be used for development?

FabianKramm commented 1 year ago

@dolfelt not yet, but we will update that very shortly. The following tasks are left todo:

  1. Allow string or object as value for vars, pipelines and commands (and all the others where we have an UnmarshalYAML method)
  2. Remove the ./hack/genjsonschema implementation in favor of /docs/hack/config/schemas/ implementation
  3. Remove the json spec description annotations in the devspace latest version
  4. Update the jsonschema in the schemastore.org