Update app/assets/javascripts/editor/schema/ci.json to accept
requested to merge tannerbragg91/gitlab:update-include-project-accept-variables-editor-schema into master
What does this MR do and why?
This merge request updates the json schema to allow VSCode to validate the usage of a Variable in the include.project field. This is a valid usage of a Variable that may be defined at the Project, Group, or Instance scope.
The schema requires either a group/project
or $SOME_VARIABLE
pattern for editor to validate files.
Screenshots or screen recordings
Before updating the schema:
After updating the schema:
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Open VSCode settings.json file.
- Pass the path to the schema
"yaml.schemas": {
"/path/to/schema/ci.json": ".gitlab-ci.yml"
},
This should validate the following properly with hello
being invalid by design:
include:
- project: hello
ref: $CUSTOM_TEMPLATES_REF
file: my/goofy/job.gitlab-ci.yml
- project: hello/world
ref: $CUSTOM_TEMPLATES_REF
file: my/goofy/job.gitlab-ci.yml
- project: $CUSTOM_TEMPLATES_PROJECT
ref: $CUSTOM_TEMPLATES_REF
file: my/goofy/job.gitlab-ci.yml
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Tanner Bragg