yaml-language-server icon indicating copy to clipboard operation
yaml-language-server copied to clipboard

document how to enable schema validation on CI

Open ssbarnea opened this issue 5 years ago • 6 comments

vscode-yaml is my favourite vscode plugin and I find it extreamly useful for validating various yaml files and ansible ones in particular.

Still, there is one aspect which is not covered by the tool: how to verify schema on an entire repository from the command line, so we can perform the checks on CI servers.

Before someone argues that this may be outside the scope of the extension please note that both kind of validations should be able to use the same configuration. If I set "roles/**/*.yml" to use Ansible schema, I need to be sure that the same setting is used by vscode and the command line call.

Once we have this sorted we should include a section in the main README that indicates on how to use it with automation.

At this moment I am not aware of any way of doing schema validation on CI so thus is why I opened this ticket.

ssbarnea avatar Nov 27 '18 16:11 ssbarnea

This is out of scope of vscode-yaml. You don't want to run VS Code from a CI build. The way I see it, you'd need to invoke an npm lib that wraps the yaml language server to be invoked from CLI. If anything, this issue should be moved to https://github.com/redhat-developer/yaml-language-server

fbricon avatar Nov 27 '18 16:11 fbricon

@fbricon there is a feature now on github that allows you to move tickets between projects, you only need to enable it on "beta" tab. Worked for me quite nice, with redirect.

ssbarnea avatar Nov 27 '18 16:11 ssbarnea

I know, but I don't have the rights to move it to the proper project

fbricon avatar Nov 27 '18 16:11 fbricon

Is there any update on how to validate schemas from a command line to enable ci scenarios? It would be great to be able to do this. Thanks.

geofflamrock avatar May 06 '19 01:05 geofflamrock

Any news on that enhancement? I'd like to use it in my CI pipelines as well.

KoljaKrueckmeyer avatar May 05 '22 13:05 KoljaKrueckmeyer

As per this comment I've been using https://github.com/InoUno/yaml-ls-check - which uses yaml-language-server under the hood - which is great and fits this need exactly :clap:

jamietanna avatar Sep 07 '23 13:09 jamietanna