Extend syntax for variables expressions.
What does this MR do?
Add support for operator precedence and operator grouping.
&&
and ||
operators added.
For example:
only:
variables:
- "($CI_COMMIT_REF_NAME == 'master' || $CI_VARIABLE_2) && $CI_OTHER_VARIABLE"
Are there points in the code the reviewer needs to double check?
Yes, in lib/gitlab/ci/pipeline/expression/parser.rb
. Specially the #tokens_rpn
method that implements the Shunting-yard algorithm and #tree
that converts the expression tokens (in Reverse Polish Notation) into an AST.
Why was this MR needed?
These changes try to extend the current ruleset as explained here
Does this MR meet the acceptance criteria?
I need to check with @ayufan
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Conform by the code review guidelines
-
Has been reviewed by a UX Designer -
Has been reviewed by a Frontend maintainer -
Has been reviewed by a Backend maintainer -
Has been reviewed by a Database specialist
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Conform by the database guides -
If you have multiple commits, please combine them into a few logically organized commits by squashing them -
Internationalization required/considered -
End-to-end tests pass ( package-and-qa
manual pipeline job)