python-jsonschema / check-jsonschema

A CLI and set of pre-commit hooks for jsonschema validation with built-in support for GitHub Workflows, Renovate, Azure Pipelines, and more!
https://check-jsonschema.readthedocs.io/en/stable
Other
191 stars 39 forks source link

GitLab CI .artifacts.reports.annotations is not supported #439

Open dmytro-golovchenko-luminartech opened 3 weeks ago

dmytro-golovchenko-luminartech commented 3 weeks ago

Issue:

Hook check-gitlab-ci is not able to handle .artifacts.reports.annotations because it is missing the schema

Explanation

  1. GitLab doc is supporting it, see: https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportsannotations
  2. check-gitlab-ci is using schema from https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json that is missing it

Steps to reproduce:

  1. Create new git repo:
    mkdir test-gitlab; cd test-gitlab; git init .
  2. Setup check-gitlab-ci in pre-commit config. Create .pre-commit-config.yaml with a content below:
    
    default_stages: [commit]
    default_install_hook_types: [pre-commit, prepare-commit-msg]

repos:

Schema validation errors were encountered. .gitlab-ci.yml::$.foo.artifacts.reports: Additional properties are not allowed ('annotations' was unexpected)


### Reference
Filed issue on gitlab site: https://gitlab.com/gitlab-org/gitlab/-/issues/465876