feat(schema): add json schema
What does this MR do and why?
This is the start of a json schema for the triage policy yaml file, as suggested in #295. I am submitting this in draft form for:
- early visibility by the project team
- early feedback from anyone so inclined
- for anyone wishing to test it, or who knows json schema better than I, to contribute
😇
Describe in detail what your merge request does and why.
This adds a schema folder with a gitlab-triage.json file. This file should validate triage policy files, with some limitations:
- as it is not current available on schema store you will need to configure it as a source, for example in Visual Studio Code you can add the following to the top of the relevant
.yamlfile:
# %YAML 1.2
# yaml-language-server: $schema=https://gitlab.com/adam-moss/gitlab-triage/-/raw/feat/schema/schema/gitlab-triage.json
# ---
resource_rules:
...
-
A
ruleblock is currently not enforcing being entirely unique. This doesn't affect anything per se, but is a sensible piece of validation to include. -
Validation for
Conditionsdoes not, as yet, filter by resource. In other words conditions likesource_branchandtarget_branchwill be accepted againstepics,issuesandbranchesrather than justmerge_requests -
Abritatray yaml anchors aren't allowed -
yaml anchors aren't validated to be a condition, limit, or action (do we want too
❓ ) -
Validation forActionsis a work in progress. -
Validation forSummariesdoes allows all actions.