Skip to content

Regression in gitlab-ci: coverage regex not recognised #516

Closed
@quentin-ag

Description

@quentin-ag

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregular-expressionsRelated to the regex engines and modes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions