WIP: Resolve "Improve syntax for variables expressions in 'only' and 'except': AND"
What does this MR do?
This MR adds parsing support for &&
, ||
, and expression-grouping parenthesis ()
. The and/or operator additions are fairly straightforward - new Lexeme::Operator class are added for each, evaluating their left and right with the corresponding Ruby operators.
The parenthesis support is somewhat more interesting. We create a new Lexeme subclass called Grouping, which is then inherited by separate OpenParenthesis and CloseParenthesis subclasses. These classes are built to be parsed (into RPN) in a fashion similar to operators, but are not subclasses of Lexeme::Operator because they don't operate with a left and right hand side like operators, or end up in the Parser #tokens_rpn list to be evaluated.
This is a branch off of a community MR opened here: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20605
I think this is pretty close, but have pointed out a few places below where I'd like to get some more feedback.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team