Realtime feedback for editing .gitlab-ci.yml
## Problem to Solve When working on the `.gitlab-ci.yml` file in the Web IDE there is no feedback on whether or not the syntax of the file is correct or that the configuration written is valid. ## Additional Details The `.gitlab-ci.yml` file has nearly 30 [configuration parameters](https://docs.gitlab.com/ee/ci/yaml/README.html#configuration-parameters). Some of these parameters only accept a specific input, and some of them can be more varied. Finally the `.gitlab-ci.yml` file needs to be [validated](https://docs.gitlab.com/ee/ci/yaml/README.html#validate-the-gitlab-ciyml) to make sure it's following all the correct rules. ## Proposal We should add the [`monaco-yaml`](https://github.com/pengx17/monaco-yaml) extension to allow our Web IDE to provide feedback for yaml files based on defined schemas. For an initial MVC we should provide the `.gitlab-ci.yml` [schema](http://json.schemastore.org/gitlab-ci) from Schemastore. ### Additional Implementation Note This should be released with a feature flag - we may consider launching with the feature flag off in self-managed for a release. ### What about... **...self-managed customers who don't want to/can't connect to an external resource?** This is the MVC. The likely [best path forward](https://gitlab.com/gitlab-org/gitlab/-/issues/218473) here is to have these schema files bundled in GitLab and reference them without going outside the application. **...this other file I'd like to have this type of feedback/validation on?** For some major GitLab files (like .gitlab-ci.yml and CODEOWNERS) those should be bundled within GitLab. For project specific files, we should eventually create a system to read either schema files or paths to schema files out of the repository. ## Resources - [monaco-yaml extension](https://github.com/pengx17/monaco-yaml) - [demo project](https://gitlab.com/jramsay/monaco-gitlab-ci/-/tree/master/examples/react-webpack) and detail comment: https://gitlab.com/groups/gitlab-org/-/epics/2707#note_332473849 ## Availability and Testing Integration tests and possibly white-box feature tests required. Please also make sure existing automation tests for Web IDE pass before merging the change.
issue