Fix CI rules-if comparison with Regexp variables
Compare changes
Files
5- Furkan Ayhan authored
@@ -12,14 +12,14 @@ def evaluate(variables = {})
When the right side of a =~
or !~
comparison is a regexp variable, we consider this as a string. However, we need to try converting it to a regexp if possible.
In this MR, we start to try to consider the right side of an expression as a regexp.
Related to #35438 (closed)
This fix is behind a feature flag ci_fix_rules_if_comparison_with_regexp_variable
(#359740 (closed)).
variables:
teststring: 'abcde'
pattern: '/^ab.*/'
test1:
script: exit 0
rules:
- if: '$teststring =~ $pattern'
test2:
script: exit 0
rules:
- if: '$teststring =~ /^ab.*/'
test1
is not included in the pipeline.
ci_fix_rules_if_comparison_with_regexp_variable
and run a pipeline;Feature.enable(:ci_fix_rules_if_comparison_with_regexp_variable)
test1
is included in the pipeline.
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.