SublimeText / YamlPipelines

Sublime Syntax Definitions for YAML CI/CD pipelines like GitHub Actions, AzureDevops, Kong API Gateway, Gitlab CICD, Bitbucket, Drone CI etc.
MIT License
18 stars 1 forks source link

Support GitLab references #24

Closed keith-hall closed 5 months ago

keith-hall commented 5 months ago

fixes #18

not sure about scopes though - I consider the first sequence item to be a reference to a label, like a goto in programming languages. The second item is like the type of reference, and the third a specific identifier to reference.

deathaxe commented 5 months ago

The sequence just denotes a path to an item in the object model (like xpath for yaml).

!reference ["job-label", "job-keyword", "variable"]

1st item is the job label or one of the special labels variable, include, ... (see: https://docs.gitlab.com/ee/ci/jobs/#job-name-limitations). => constant.other.label seems suitable.

2nd item represents a job-keyword, like variable, script or any other valid one.

3rd item may be variable, but can probably also be something like an artefact definition (see: https://docs.gitlab.com/ee/ci/yaml/index.html#artifactspaths)

job1:
  artifacts:
    paths:
      - binaries/
      - .config

job2:
  artefacts:
    paths: !reference ["job1", "artefacts", "paths"]

Therefore maybe just treat it as a list of constants without interpreting kind of item - at least on of item 3.

FichteFoll commented 5 months ago

I also wouldn't put too much thought into the scope names of the reference segments since they are just … references to any other block in the pipeline and may use arbitrary names.