redhat-developer / redhat-developer/vscode-yaml

.gitlab-ci.yml - Custom tag !reference defined in schema but reported as error.

Open
#925 6 comments 14 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

Describe the bug

Expected Behavior

This code is actually valid:

.gitlab-ci.yml

.common:
  before_script:
    - git config --global credential.helper store

.job:
  before_script:
    - !reference [.common, before_script]

The correct schema is loaded:
https://github.com/SchemaStore/schemastore/blob/master/src/api/json/catalog.json#L1732
https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/editor/schema/ci.json#L29

Current Behavior

Problems are raised for each !reference tag in the file:
Unresolved tag: !reference

Steps to Reproduce

Use the above mentioned file.

Environment

  • [X ] Windows
  • Mac
  • [ X] Linux
  • other (please specify)

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 with the provided .gitlab-ci.yml example and inspect the linked GitLab ci.json schema to understand how !reference is declared. Trace where the YAML language service reports “Unresolved tag: !reference”; done means valid GitLab CI files using this tag no longer show that diagnostic.

Written by the indexing model from the issue text.

Assessment

Tech stack
gitlab, yaml
Domain
developer-experience, tooling
Issue type
Bug
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.