Add command to show merged YAML for CI config
Problem to solve
As a developer, I want to be able to view the merged YAML for my GitLab CI configuration inside my VSCode workspace, so that I don't have to leave my IDE and navigate through a web browser to see the results.
Proposal
Utilize the API endpoint to Validate a CI YAML configuration with a namespace, retrieve the merged_yaml
attribute from the response, and display the results in a separate editor.
Further details
For complex pipelines, it can be very challenging to know whether the resulting merged YAML is going to look as desired/expected. Having the ability to view this directly in the developer's IDE would be extremely valuable.
Links / references
Might be blocked by gitlab#320778 (closed).
We can use virtual documents to show the merged result: https://code.visualstudio.com/api/extension-guides/virtual-documents.
- We'd define a
TextDocumentContentProvider
that will serve documents on a custom scheme URI (e.g.gitlab-merged-ci-yaml
)- this provider would somehow have to store the API response
- We'd show the file by running
vscode.workspace.openTextDocument(customUri)