Closed
Description
Context
This follows from #436, about the wrong report 'coverage: [...] is not a regex' with the gitlab-ci
schema. One solution was to use the following regex (minimal example of .gitlab-ci.yml
file):
tests:
coverage: /TOTAL.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/
Problem
The solution from #436 worked until version 0.30.0 of check-jsonschema
. This can be reproduced with the minimal example above. Assuming it is the content of the file min-gitlab-ci.yml
:
python -m pip install --quiet 'check-jsonschema==0.30'
check-jsonschema --builtin-schema "gitlab-ci" min-gitlab-ci.yml
Result:
ok -- validation done
This now fails with version 0.31
:
python -m pip install --quiet 'check-jsonschema==0.31'
check-jsonschema --builtin-schema "gitlab-ci" min-gitlab-ci.yml
Result:
Schema validation errors were encountered.
min-gitlab-ci.yml::$.tests.coverage: '/TOTAL.*? (100(?:\\.0+)?\\%|[1-9]?\\d(?:\\.\\d+)?\\%)$/' is not a 'regex'
Is this a regression? Should the regex be changed?
Thanks in advance for any support on this.
Environment details
OS: Arch Linux
Python: 3.9.21