redhat-developer / redhat-developer/vscode-yaml

Better error message when a `$ref` attribute fails validation

Open
#864 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
829
Forks
260
Avg merge
5h 43m
Merged PRs (30d)
1

Description

Is your enhancement related to a problem? Please describe.

For the gitlab-ci-schema plus

              ,
              "variables": {
                "markdownDescription": "Additional environment variables that are passed exclusively to the service. The syntax is the same as [Job Variables](https://docs.gitlab.com/ee/ci/variables/index.html).",
                "$ref": "#/definitions/jobVariables"
              }

in services:, input:

test_docker_image_with_service:
  services:
    - name: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
      alias: service-under-test
      variables:
        - PORT: ${PORT}

gives:

image

which a very weird way of saying "please remove that - from inside variables:".

Describe the solution you would like
  • Error message should be more clear.
  • Also, maybe, "not provide schema-internal information" on the forefront (acceptable on --verbose)
Describe alternatives you have considered
Additional context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the validation failure for the GitLab CI schema's services.variables $ref using the YAML example in the issue, then trace where that validation error is formatted. Done means the message explains that the list item is invalid and should be removed, while schema-internal details are reserved for verbose output.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.