-
Notifications
You must be signed in to change notification settings - Fork 56
Closed
Labels
upstream-schema-issueAn issue with a schema or schema providerAn issue with a schema or schema provider
Description
Issue:
Hook check-gitlab-ci
is not able to handle .artifacts.reports.annotations
because it is missing the schema
Explanation
- GitLab doc is supporting it, see: https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportsannotations
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:
- Create new git repo:
mkdir test-gitlab; cd test-gitlab; git init .
- 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:
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.4
hooks:
- id: check-gitlab-ci
files: ^.*\.gitlab
- Commit it
git add .pre-commit-config.yaml
git commit -a -m 'Add .pre-commit-config.yaml'
- Install pre-commit:
pre-commit install
- Add dummy GitLab job definition in
.gitlab-ci.yml
:
foo:
stage: build
tags:
- bar
script:
- echo "test"
artifacts:
reports:
annotations: upload_report.json
- Try to commit changes in
.gitlab-ci.yml
, would get error like below:
git add .gitlab-ci.yml
git commit .gitlab-ci.yml -m 'Add .gitlab-ci.yml'
Output:
Validate GitLab CI config................................................Failed
- hook id: check-gitlab-ci
- exit code: 1
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
Metadata
Metadata
Assignees
Labels
upstream-schema-issueAn issue with a schema or schema providerAn issue with a schema or schema provider