prevent typos in unit names + add CI coverage for this use-case
Closes #103 (closed)
This MR:
- adjusts the schema to not allow a unit definition without either
kustomization_specorhelm_releasespec, even ifenabled: false- this in practice will solve the case where a user wants to setenabled: falseon a unit but gets the unit name wrong (today if somebody does this not error will be raised, but of course the user intention won't be applied) - adds code for "negative tests" in sylva-units: values file for which we want the Helm CI jobs to fail
- uses this new CI code for this "typo in unit name" use case
Result:
--------------- Checking values from test-values/unit-name-typo with 'helm template' and 'yamllint' ... 00:01
Error: values don't meet the specifications of the schema(s) in the following chart(s):
sylva-units:
- units.ingress-ngnx: Must validate at least one schema (anyOf)
- units.ingress-ngnx: helmrelease_spec is required
- units.ingress-ngnx: Must validate all the schemas (allOf)
This negative testcase expectedly made 'helm template ..| yamllint ..' fail.
OK
(https://gitlab.com/sylva-projects/sylva-core/-/jobs/3889153809)
Edited by Thomas Morin