Extend YAML validation for use on Walkthroughs

What does this MR do and why?

  • Refactors the YAML schema validation script we use for the global nav (navigation.yaml) so that it can be used for any set of YAML files + schema files
  • Adds a schema definition for walkthrough YAML
  • Adds a CI job for YAML validation (and adjusts the existing navigation.yaml schema test to run here)

Relates to #298

Screenshots, screen recordings, or links to review app

Successful job on CI: https://gitlab.com/gitlab-org/technical-writing/docs-gitlab-com/-/jobs/10202911290

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Configure a local GitLab Docs environment.
  2. Check out this branch and run make setup to update dependencies.
  3. Run make validate-yaml. Tests should pass.
  4. Edit data/en-us/navigation.yaml and add a new property with an invalid name, like:
  url: 'user/get_started/'
+ hotdogs: 'yes'
  1. Run make validate-yaml. Tests should fail.
  2. Repeat with a file in data/en-us/walkthroughs. Try removing a required property, like:
- entry_point: "first_step_id"
  1. Run make validate-yaml. Tests should fail.

Merge request acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Sarah German

Merge request reports

Loading