Skip to content

feat(editor): auto completion for CI variables

This MR adds auto completion capabilities for CI variables in the .gitlab-ci.yml.

All variables from the predefined variables docs page are in the newly created src/utils/gitlab_ci_variables.js which holds the autocompletable variables.

To update the variables, you can run the following code on the doc page:

[...document.querySelector('tbody').children].map(item => [...item.children].map(subitem => subitem.textContent)).map(item => ({
  label: item[0].trim(),
  description: `${item[3].trim()}\n\n**GitLab Version**: ${item[1].trim()}${item[1].includes('all') ? '' : '+'}${
    '  \n'
  }**Runner Version**: ${item[2].trim()}${item[2].includes('all') ? '' : '+'}`
}))

I know it's not pretty and might be more bad than boring 😉, so if you have a better suggestion, I'm happy to implement it/note it in the file. For now, this would work though. About every new release roughly one new variable is added, which can also be added by hand.

The MR also adds an entry about the CI auto completion in the README.md because I think it's a good selling point (auto completion is always cool!). 😄

Closes #55 (closed)

Screenshots

screenshot of the CI variable autocompletion

Edited by Kev

Merge request reports