Multiple variable declaration causes CI Linter fail (possible a bug)

***Multiple variable declaration causes CI Linter fail ***

Describe your question in as much detail as possible:

Dear community, I’m trying to assign a list of values to the variable in global variable block and then leverage it in the job

variables: &deb_distros
  DISTROS:
    - stretch
    - buster
    - bullseye

variables: &ubuntu_distros
  DISTROS:
    - bionic
    - focal

....
#some more job here
....

BUILD:
  stage: build
  script:
    - *x_node_build
  parallel:
    matrix:
      - <<: *deb_distros
      - <<: *ubuntu_distros

Suddenly (for me), it was executed well:

If I add additional list of variables, the entire pipeline will fail with CI Linter failure:

variables: &deb_distros
  DISTROS:
    - stretch
    - buster
    - bullseye

variables: &ubuntu_distros
  DISTROS:
    - bionic
    - focal

variables: &rpm_distros
  DISTROS:
    - centos6
    - centos7
    - centos8

...
# some tasks here 
....
BUILD:
  stage: build
  script:
    - *x_node_build
  parallel:
    matrix:
      - <<: *deb_distros
      - <<: *ubuntu_distros
      - <<: *rpm_distros

So I expected to see an error in first case or passed pipeline in second. I guess it could be a bug.

Appreciate any suggestion!

I’m using Self-managed Gitlab v14.9

Thanks for your time!

Hi,

you need to post bugs in Gitlab issue tracker Issues · GitLab.org / GitLab · GitLab

anyway variables is reserved keyword. I suggest to name your lists differently.

Oh, I’ve clearly misunderstood, I assumed the intention was to use the keyword.