CI jobs with rules with != "" (not equal to empty string) always evaluate to true

Summary

The following job is always started, whether the variable is set or not:

notempty:
  stage: one
  script:
    - sleep 10m
  rules:
    - if: '$CI_TOTO != ""'
      when: on_success

Steps to reproduce

cf Above.

What is the current bug behavior?

Unset envars should evaluate to an empty string. The negation should make the CI job only run when the envvar is set to a non-empty value.

What is the expected correct behavior?

When CI_TOTO is not set, or set to an empty string, then the CI job should not run.

When CI_TOTO is set to a string with min length 1, then the CI job should run.

Edited by 🤖 GitLab Bot 🤖