`check-gitlab-ci` fails to parse multi-document `.gitlab-ci.yml`
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start by reproducing the failure with the multi-document .gitlab-ci.yml example and inspect instance_loader.py around line 50 and parsers/init.py around line 102. Update parsing behavior so this GitLab CI input is accepted, then verify that the check-jsonschema command validates the example without the single-document ComposerError.
Written by the indexing model from the issue text.
Description
GitLab recently added the spec:inputs CI/CD YAML keyword which makes use of multi-document YAML files. The following example is taken straight from their docs:
spec:
inputs:
job-stage:
default: test
environment:
default: production
---
scan-website:
stage: $[[ inputs.job-stage ]]
script: ./scan-website $[[ inputs.environment ]]
However, check-jsonschema refuses to parse such a file and errors out:
> check-jsonschema.exe --verbose --schemafile https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json .\.gitlab-ci.yml
Several files failed to parse.
FailedFileLoadError: Failed to parse .\.gitlab-ci.yml
in "C:\Users\username\pipx\venvs\check-jsonschema\Lib\site-packages\check_jsonschema\instance_loader.py", line 50
>>> data: t.Any = self._parsers.parse_data_with_path(
caused by
ComposerError: expected a single document in the stream
in "<byte string>", line 2, column 1:
spec:
^ (line: 2)
but found another document
in "<byte string>", line 10, column 1:
---
^ (line: 10)
in "C:\Users\username\pipx\venvs\check-jsonschema\Lib\site-packages\check_jsonschema\parsers\__init__.py", line 102
>>> return loadfunc(data)
- Dominant language
- Python
- Stars
- 341
- Forks
- 71
- Avg merge
- 6d 13h
- Merged PRs (30d)
- 6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python-jsonschema/check-jsonschema
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
enhancement
python-jsonschema/check-jsonschema#668 · 9 comments · 1 assignee ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
python-jsonschema/check-jsonschema#655 · 1 reaction ·
All issues in python-jsonschema/check-jsonschema
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
browser-use/browser-use#5905 ·
-
type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ynput/ayon-python-api#363 ·
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
modelscope/FunASR#3728 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
open-compass/opencompass#2655 ·