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.
- Configure a local GitLab Docs environment.
- Check out this branch and run
make setupto update dependencies. - Run
make validate-yaml. Tests should pass. - Edit
data/en-us/navigation.yamland add a new property with an invalid name, like:
url: 'user/get_started/'
+ hotdogs: 'yes'
- Run
make validate-yaml. Tests should fail. - Repeat with a file in
data/en-us/walkthroughs. Try removing a required property, like:
- entry_point: "first_step_id"
- 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.
-
I have evaluated the MR acceptance checklist for this merge request.
Edited by Sarah German