Support loading of GitLab `!reference` data during validation
Maintainers usually reply within 7 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start by reproducing the failure with the check-gitlab-ci hook and --data-transform gitlab-ci against the YAML example in the issue. Trace the validation path for the services entry and determine how GitLab !reference values are represented during loading. Done means the shown syntax is accepted without the schema validation error and existing validation still passes.
Written by the indexing model from the issue text.
Description
Preface
GitLab !reference support was added in https://github.com/python-jsonschema/check-jsonschema/issues/112 but there are still some edge cases.
How I verified that there are no duplicate issues in the issue tracker
I searched for the "reference" word between open and closed issues and I found only closed https://github.com/python-jsonschema/check-jsonschema/issues/112.
.pre-commit-config.yaml
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.23.1
hooks:
- id: check-gitlab-ci
args: ["--data-transform", "gitlab-ci"]
Valid .gitlab-ci.yml
include:
- project: "myproject/mynamespace/backend/repositoryname"
ref: v1.1.22
file: ".gitlab-ci-common.yml"
test:
stage: test
services:
- name: mongo:6.0.6
command: ["/bin/sh", "-c", "mongod --logpath /dev/null --bind_ip_all --replSet 'rs0' "]
- !reference [.common_services_for_test_job, services]
before_script:
- echo "Hello"
check-gitlab-ci output
Validate GitLab CI config................................................
Failed
- hook id: check-gitlab-ci
- exit code: 1
Schema validation errors were encountered.
.gitlab-ci.yml::$.test.services[1]: ['.common_services_for_test_job', 'services'] is not valid under any of the given schemas
Underlying errors caused this.
Best Match:
$.test.services[1]: ['.common_services_for_test_job', 'services'] is not of type 'string'
Expected result
Accept the mentioned YAML syntax.
- Dominant language
- Python
- Stars
- 341
- Forks
- 71
- Avg merge
- 6d 13h
- Merged PRs (30d)
- 6
Getting set up
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
python-jsonschema/check-jsonschema#702 ·
Maintainers usually reply within 7 days
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
python-jsonschema/check-jsonschema#680 ·
Maintainers usually reply within 7 days
-
Support ETag for cache validation when Last-Modified is unavailableMay be free again @sirosen claimed this 186 days ago, and no pull request is open. Openenhancement
python-jsonschema/check-jsonschema#668 · 9 comments · 1 assignee ·
Maintainers usually reply within 7 days
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
python-jsonschema/check-jsonschema#663 ·
Maintainers usually reply within 7 days
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
python-jsonschema/check-jsonschema#655 · 1 reaction ·
Maintainers usually reply within 7 days
All issues in python-jsonschema/check-jsonschema
Similar issues
-
bug status/needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
prowler-cloud/prowler#12887 · 1 comment ·
Maintainers usually reply within 1 day
-
area: desktop platform: macos priority: p3 status: ready type: enhancement
Difficulty 1/5 Under an hour Newbie friendliness 92/100
use-agent-os/agent-os#3484 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
open-telemetry/opentelemetry-python-contrib#5113 · 2 comments · 2 reactions ·
Maintainers usually reply within 1 day
-
external
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
langchain-ai/docs#6255 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day