Draft: PoC: FY24-Q2 - Ops Hackathon - Enhance the syntax validation with override variables detection on CI::Lint
requested to merge dbiryukov_enhance_syntax_of_ci_lint_by_overriden_variables_FY24-Q2-465 into master
What does this MR do and why?
Enhance the syntax validation of .gitlab-ci.yml
to include highlighting and validation of variables, particularly in cases where pre-defined variables are being overridden within the yaml configuration's variable scope.
Screenshots or screen recordings
Screen_Recording_2023-05-31_at_19.42.44
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Define the Project variable.
- Define a variable with the same name (in Project) in
.gitlab-ci.yml
variables section. - Run
Ci Lint
with enabledSimulate a pipeline created for the default branch
- Check Warnings
Some areas to improve:
- Add tests.
- We have to figure out do we need to make overridden variables calculation for every job in
.gitlab-ci.yml
- or only summarize it at the end. - Add more information to the warnings from which area of variables we get overridden (Project, variables from another yaml file, etc.)
- Optimise warnings calculation as from first glance it could be done together with the errors parsing, but for the prototype, it was introduced with the dedicated call to call
Variables::Builder
from scratch.
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 Dmytro Biryukov