redhat-developer / redhat-developer/yaml-language-server

Using yaml-language-server as a CICD Pipeline yml schema validation tool

Open
#984 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.5k
Forks
352
Avg merge
2d 7h
Merged PRs (30d)
11

Description

Summary

How do I run custom yml schema validation in a CICD pipeline?

Relevant information

We are building CICD Pipeline for Databricks Asset Bundle (DAB), using a bundle_config_schema.json which describes what is allowed to be specified in our config.yml files. If someone puts something incorrect, we would like the CICD Pipeline to be able to explain what the yaml-language-server found that diverges from the schema it is validating against.

I am having trouble getting the yaml-language-server --stdio to work. Maybe someone is able to help me understand how I would prepare and execute a shell command in this scenario:

Two files:

  1. file_to_validate.yml
  2. schema_to_use_for_validation.json

cat file_to_validate.yml | yaml-language-server --stdio > result

What am I missing to introduce the schema in the above command ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the yaml-language-server --stdio command and the two named inputs, file_to_validate.yml and schema_to_use_for_validation.json. Determine how the server receives the schema during stdio execution rather than assuming shell piping supplies it; done means a CI command validates the YAML against the JSON schema and reports divergences.

Written by the indexing model from the issue text.

Assessment

Tech stack
json, shell, yaml
Domain
cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.